ml-connector
SAP ECCShopify

SAP ECC and Shopify integration

SAP ECC runs your finance and operations. Shopify runs your e-commerce channel. Connecting the two keeps your revenue records in sync with your order fulfillment, aligns your customer data, and reconciles inventory across online and ERP channels. Orders flow from Shopify into SAP ECC as accounting documents or material receipts, mapped to the correct GL accounts and cost centers. Customer records stay current so Shopify orders route to the right sold-to party in your ledger.

How SAP ECC works

SAP ECC exposes customers, materials, GL accounts, cost centers, purchase orders, and general ledger documents through RFC/BAPI function modules, OData v2 REST via SAP Gateway (http://<host>:<port>/sap/opu/odata/<namespace>/<service>/), SOAP web services, and IDoc XML via a customer-configured HTTP port. Authentication uses HTTP Basic Auth for OData and IDoc, or RFC Basic Auth for BAPI via the SAP .NET Connector or Java Connector, which must run on the customer network as an on-premises agent. SAP ECC has no published webhook registry, so data is read by polling RFC_READ_TABLE on demand or at a scheduled interval, though outbound IDoc push is available if the customer configures SAP Basis settings in transaction codes WE21/WE20.

How Shopify works

Shopify exposes orders, customers, transactions, inventory levels, draft orders, fulfillments, and disputes through the Shopify Admin API, available in GraphQL and REST with a base URL of https://{shop}.myshopify.com/admin/api/2026-04/. Writes and reads use OAuth 2.0 with long-lived offline tokens (prefix shpat_) that do not expire. Shopify delivers order, customer, inventory, and fulfillment events via webhooks with topics like orders/create, orders/updated, customers/create, and inventory_levels/update. Every webhook includes a X-Shopify-Webhook-Id header for deduplication.

What moves between them

Orders flow from Shopify to SAP ECC. When a Shopify order is placed or updated, ml-connector creates or updates a corresponding sales document or accounting entry in SAP ECC, mapped to the matching customer (from Shopify customer records synced to SAP KNA1 customer master), GL account, and cost center. Inventory levels flow bidirectionally so Shopify inventory is decremented when SAP ECC goods are issued, and SAP sees updates when Shopify orders are fulfilled. Customer records are kept current in both directions, with Shopify customers mapped to SAP KNA1/KNB1 and used to route orders to the correct sold-to party and billing address.

How ml-connector handles it

ml-connector runs an on-premises SAP agent (using .NET Connector or Java Connector) that sits on your network and handles all RFC/BAPI calls to SAP ECC. It authenticates Shopify via OAuth 2.0 offline tokens and validates webhook signatures using the X-Shopify-Webhook-Id header, returning 401 on signature failure so Shopify retries. On receipt of a Shopify webhook, ml-connector reads the customer record from Shopify's Admin API, matches or creates it in SAP ECC using BAPI_CUSTOMER_GETDETAIL and BAPI_CUSTOMER_CREATE, then posts the order as an accounting document or material receipt via BAPI_ACC_DOCUMENT_POST or a purchase order via BAPI_PO_CREATE1, mapped to the correct GL account and cost center. Because BAPI requires an explicit BAPI_TRANSACTION_COMMIT call, ml-connector commits the transaction to prevent locked documents. Inventory updates use RFC_READ_TABLE to poll SAP stock levels and respond to Shopify fulfillment/inventory updates via the InventoryLevel mutation. Every transaction carries an external reference (using Shopify Order ID in SAP REF_DOC_NO field) to detect duplicates on retry, and all records are logged in the audit trail for replay if a downstream call fails.

A real-world example

A mid-market apparel brand uses SAP ECC for inventory, costing, and month-end close, and Shopify for its direct-to-consumer e-commerce site handling dozens of orders daily across multiple collections. Before the integration, every Shopify order was manually entered into SAP by the finance team as a sales order or accounts receivable document, and inventory was reconciled once a week by exporting Shopify stock, comparing it to SAP, and manually adjusting both. This manual process introduced keying errors, allowed inventory discrepancies to compound between syncs, and made month-end close slow. With SAP ECC and Shopify connected, each Shopify order posts into SAP automatically, allocated to the correct revenue GL account and cost center, inventory levels are kept current in both systems within seconds of fulfillment, and month-end close begins with revenue and stock already reconciled.

What you can do

  • Sync Shopify orders into SAP ECC as sales documents or accounting entries, mapped to the correct customer, GL account, and cost center.
  • Keep SAP ECC customer master data (KNA1/KNB1) aligned with Shopify customers so orders route to the correct sold-to party and billing address.
  • Reconcile inventory levels bidirectionally between Shopify and SAP ECC when orders are placed, fulfilled, or adjusted.
  • Authenticate Shopify via OAuth 2.0 offline tokens and SAP ECC via the on-premises RFC agent, with webhook signature validation and deduplication.
  • Detect duplicate orders using Shopify Order ID as the external reference, and replay failed postings with a full audit trail.

Questions

How does ml-connector handle the on-premises SAP agent requirement?
ml-connector deploys an agent (using SAP .NET Connector or Java Connector) on your network that bridges from cloud Shopify webhooks to your SAP ECC instance. The agent sits behind your firewall and handles all RFC/BAPI calls, so your SAP data never travels through a public internet connection. The agent is lightweight and requires minimal SAP Basis configuration.
Which direction do orders and inventory flow between Shopify and SAP ECC?
Orders flow from Shopify into SAP ECC as sales documents or accounting entries. Inventory levels flow bidirectionally: SAP ECC stock decrements are reflected in Shopify when goods are issued, and Shopify inventory changes from order fulfillment are pushed back to SAP ECC. Customer records are also kept current in both directions using Shopify customer IDs matched to SAP KNA1 customer master records.
What happens if a Shopify order fails to post into SAP ECC?
ml-connector stores the order with an external reference (Shopify Order ID) in the SAP REF_DOC_NO field so duplicate attempts are detected. Every transaction is logged in the audit trail and can be replayed once the root cause is fixed. If SAP BAPI calls timeout or fail, ml-connector retries on the next webhook or polling cycle and notifies your team via the audit log for manual investigation.

Related integrations

Connect SAP ECC and Shopify

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started