← Articles · abas & XML

abas & XML Part 2: Sales Orders & Procurement – cXML, UBL, and abas XML Import Rules

Processing inbound cXML and UBL Order messages in abas ERP: XSLT transformation to EDP-XML, headless sales order creation, price discrepancy rules, and FOP validation logic.

In Part 1 of our four-part series, we explored the internal XML data model of abas ERP, how the EDP-XML interface functions, and fundamental syntax guidelines. In this second installment, we address one of the most critical B2B integration challenges for mid-sized manufacturers and distributors: receiving and processing inbound purchase orders using modern XML standards—specifically cXML and UBL (Peppol BIS Order 3.0)—and ensuring fully automated, error-free sales order creation in abas.

While traditional EDIFACT ORDERS messages remain vital in automotive and retail, enterprise procurement clouds such as SAP Ariba, Coupa, and Jaggaer communicate almost exclusively via cXML. Concurrently, European public procurement and cross-border commercial networks require Peppol BIS Order 3.0 (built on OASIS UBL 2.1). Thanks to its flexible architecture, abas ERP can natively orchestrate both protocols.

Comparing B2B XML Standards: cXML vs. UBL

Understanding the architectural nuances of these two dominant procurement XML standards is essential before designing the integration:

FeaturecXML (commerce eXtensible Markup Language)UBL (Universal Business Language) Order 2.1
Primary ScopeSAP Ariba, Coupa, direct B2B PunchOut catalogsPeppol network, European B2G and B2B trade
Header & AuthenticationEmbedded Shared Secret and Identity headers (<Header><From>...</Header>)Standardized EndpointID and PartyIdentification elements
XML NamespacesTypically DTD-based or un-prefixed default schemaStrict namespace hierarchy (urn:oasis:names:specification:ubl:schema:xsd:Order-2)
Confirmation MechanismSynchronous HTTP response (200 OK + Status cXML) and async cXML ConfirmationUBL OrderResponse (Peppol BIS Order Response 3.0)

Integration Pipeline Architecture: Inbound XML to abas Sales Order

Incoming XML orders follow a secure, multi-stage processing pipeline before becoming actionable sales orders inside abas ERP:

  1. Ingestion and Pre-Flight Validation: The inbound cXML or UBL document is received via AS2, HTTPS REST API, or SFTP and immediately validated against its official XSD schema to detect syntax and schema violations early.
  2. XSLT Transformation: A dedicated XSLT stylesheet transforms the external XML structure into the proprietary abas EDP-XML format (Head and Table layers).
  3. Master Data Resolution & Cross-Referencing: Using cross-reference tables stored in abas Vartab, external partner identifiers (GLN, Tax ID) and customer part numbers are resolved into internal abas entity IDs.
  4. Headless EDP Import: The abas EDP server initiates a background transaction, invokes the Sales Order mask, executes full ERP business logic (credit limit checks, tax determination, pricing), and generates the order record.
  5. Status Feedback & Notification: On success, the internal order number is logged; if price discrepancies or unrecognized part numbers occur, the order is flagged with a warning status and dispatched to the internal sales team.

XSLT Transformation: Mapping UBL / cXML to abas EDP-XML

At the heart of the integration is an efficient XSLT (Extensible Stylesheet Language Transformations) mapping engine. The following example demonstrates converting a standard UBL 2.1 Order into the abas <abasDocument> structure:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
    xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
    xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Order-2"
    exclude-result-prefixes="cac cbc ubl">

    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

    <xsl:template match="/ubl:Order">
        <abasDocument type="SalesOrder" version="2026.1">
            <head>
                <!-- External PO Number and Order Date -->
                <bestellnr><xsl:value-of select="cbc:ID"/></bestellnr>
                <vom><xsl:value-of select="cbc:IssueDate"/></vom>
                <wtermin><xsl:value-of select="cac:Delivery/cac:RequestedDeliveryPeriod/cbc:EndDate"/></wtermin>
                
                <!-- Customer Resolution via GLN / EndpointID -->
                <ygln><xsl:value-of select="cac:BuyerCustomerParty/cac:Party/cbc:EndpointID"/></ygln>
                <waehrung><xsl:value-of select="cbc:DocumentCurrencyCode"/></waehrung>
                
                <!-- Integration Status Flag -->
                <yedistat>XML_IMPORT_NEW</yedistat>
            </head>
            <table>
                <xsl:for-each select="cac:OrderLine">
                    <row n="{position()}">
                        <!-- Buyer Part Number and GTIN / EAN Resolution -->
                        <ycustomerno><xsl:value-of select="cac:LineItem/cac:Item/cac:BuyersItemIdentification/cbc:ID"/></ycustomerno>
                        <yean><xsl:value-of select="cac:LineItem/cac:Item/cac:StandardItemIdentification/cbc:ID"/></yean>
                        <mge><xsl:value-of select="cac:LineItem/cbc:Quantity"/></mge>
                        <he><xsl:value-of select="cac:LineItem/cbc:Quantity/@unitCode"/></he>
                        <preis><xsl:value-of select="cac:LineItem/cac:Price/cbc:PriceAmount"/></preis>
                    </row>
                </xsl:for-each>
            </table>
        </abasDocument>
    </xsl:template>
</xsl:stylesheet>

Headless EDP Import Mechanics in abas ERP

Once the XSLT engine generates clean abas XML, the EDP server executes the background transaction through the following sequence:

  • Customer Resolution via ygln or Tax ID: If the internal abas customer number is unknown, the EDP import searches the customer master by GLN or Tax ID. If no unambiguous match is found, the order is routed to a suspense "Clearing Account" with an import hold.
  • Item Cross-Referencing: When parsing order lines, abas evaluates the yean (GTIN) and ycustomerno fields. Through the Vartab Item Cross-Reference table, it seamlessly maps customer part codes to internal abas part numbers (artikel).
  • Unit of Measure (UoM) Normalization: International UN/ECE Rec 20 codes (e.g., H87 for piece, KGM for kilogram, MTR for meter) are translated into abas internal units (e.g., PCE, kg, m).

Handling Price Discrepancies and Tolerance Rules

A frequent challenge in automated order processing is a price discrepancy: the unit price sent in the buyer's XML does not match the active price list, discount agreement, or contracted price in abas ERP.

In abas, this is handled dynamically via FOP (Format Optimization Program) or FO event scripts:

Automated Price Verification Workflow:
If | XML_Unit_Price - abas_Contract_Price | > Tolerance_Threshold (e.g., > 0.5% or > 0.01 EUR):
  1. The line item is recorded with the buyer's requested price to preserve original transaction integrity.
  2. The order line and header are marked with an "Approval Required" flag (yedistat = 'PRICE_DISCREPANCY').
  3. The order is blocked from automated delivery note (packing slip) creation, and an alert is dispatched to the account manager's dashboard.

Common Pitfalls in XML Order Import

  • XML Namespace Handling in XSLT: UBL documents use precise XML namespaces (e.g., xmlns:cac="..."). Failing to define namespaces correctly in the XSLT template causes XPath expressions to evaluate to empty nodes, resulting in empty order lines inside abas.
  • Unwanted Merging of Duplicate Line Items: If a buyer orders the same product across multiple lines with distinct requested delivery dates or cost centers, aggressive import logic might consolidate them. Line consolidation must be explicitly disabled during EDP mapping.
  • Rounding and Fractional Precision: When foreign XML includes unit prices with 4 or 6 decimal places (e.g., 0.1235 EUR) and the abas field is limited to 2 decimals, net totals will diverge from the customer's calculated amounts.
  • Failure to Detect Order Modifications: When a customer submits an updated XML for an existing order, the middleware must recognize the original document ID rather than inadvertently creating a duplicate sales order.

Summary and What's Next

Automating inbound cXML and UBL orders via XSLT and EDP eliminates manual entry, shortens order confirmation cycles, and preserves database integrity within abas ERP.

In Part 3, we transition to outbound fulfillment: exporting abas delivery notes with complete packaging hierarchies (Handling Units, SSCC) in XML, and synchronizing with external WMS platforms and carrier APIs (GLS, DPD, DHL).

Looking to streamline cXML and UBL order processing in your abas ERP system? Request an expert consultation with our team!