Master Data Replication with IDocs
Learn how master data and transactional flows are replicated between Emporix and SAP ERP or SAP S/4HANA using IDocs and SAP Integration Suite iFlows.
In this example, we highlight a scenario in which asynchronous pricing and order replication occur from the Emporix Commerce Engine to SAP ERP. We selected SAP BTP Integration Suite (formerly known as SCPI) to streamline the integration process, leveraging Emporix flexible API capabilities and SAP IDoc interface.
The video and the diagram show high level overview of the data replication between Emporix and SAP ERP or SAP S/4HANA using SAP Integration Suite.
This demo is a presentation of one potential approach to integrate with SAP. Alternatively, REST APIs or OData can be utilized for integration purposes.
Master data replication
To create an order from Emporix into SAP, the following master data must be replicated to provide the information for the transactional IDoc:
MATMAS05
Material
Product
COND_A04
Condition
Price, PriceModel, PriceList
DEBMAS07
Customer
Company
ADRMAS03
Contact Person
Customer
ADR2MAS03
Address
Location
ADR3MAS03
Address
Location
Transactional IDoc:
SALESORDER_CREATEFROMDAT202
Transaction
Order created Webhook payload
Here's how the replication process looks like:

Product replication
Product replication uses the MATMAS IDoc generated by SAP ERP, which holds essential product details, for example, localized product name, tax type, and product code. Emporix can use the same product code as the ERP, allowing the upsert API to create or update the product as needed, thereby simplifying the integration process.
Price replication
Product prices are replicated through the COND_A IDoc, known as conditions in SAP, which contains details such as price validity, minimum quantity, and customer-specific price lists. Prices are assigned to either net or gross price models, depending on the price type, and customer assignments are made at the ship-to level.
Customer data replication
Customer data is distributed across multiple IDocs. The diagram below shows SAP/Emporix object relations:
To accurately reflect this data in the Emporix Commerce Engine, the following entities must be created:
Company
The DEBMAS IDoc contains core company information, including functional assignments such as Sold To, Ship To, Bill To, Payer, and the Contact Person relationship.
Address details are provided through the ADRMAS IDoc.
Location
Company location details, along with communication information, are derived from data in the DEBMAS and ADRMAS IDocs. Depending on the functional assignments of the addresses, locations are tagged as either shipping or billing.
Customer
The Emporix customer entity is created based on the Contact Person relationship from the ERP system. This relationship includes the customer’s assigned email, phone number, and address details. As illustrated in the diagram, the DEBMAS, ADR2MAS, and ADR3MAS IDocs are required for customer creation within the Emporix Commerce Engine.
Order replication
Order replication from Emporix to SAP ERP is achieved through order creation webhooks, which are sent to the SAP BTP Integration Suite. The necessary company details (e.g., sold-to, ship-to) are added to the order using mixins, ensuring they are included in the webhook payload. The SAP BTP Integration Suite then converts the webhook data into a SALESORDER_CREATEFROMDAT202 IDoc, which is sent to the SAP ERP system through the iFlow.

IDoc-based order replication is one possible approach for integrating transactional flows between Emporix and SAP. For another integration pattern, see SAP Sales and Quotes Integration, which describes order and quote processes using OData services through SAP Integration Suite.
Last updated
Was this helpful?

