ml-connector
SAP ECCSPS Commerce

SAP ECC and SPS Commerce integration

SAP ECC runs procurement and finance for manufacturing and distribution companies. SPS Commerce connects suppliers to retail trading partners like Walmart, Target, and Amazon through a shared EDI network. Connecting the two keeps your retail purchase orders aligned with your supply chain and ensures invoices and shipping notices reach buyers without manual export or file drops. ml-connector bridges the very different connection models (on-premises RFC and cloud OAuth) and translates between SAP's native document formats and SPS's standardized RSX/JSON wrapper.

How SAP ECC works

SAP ECC (SAP ERP Central Component) is an on-premises ERP suite that exposes purchase orders, purchase requisitions, vendors, GL accounts, cost centers, and materials through RFC/BAPI function modules or OData v2 via SAP Gateway. RFC calls require an on-premises agent running SAP .NET Connector or Java Connector, while OData is delivered over HTTP at http://<host>:<port>/sap/opu/odata/<namespace>/<service>/ with HTTP Basic Auth. OData services must be manually activated by the SAP Basis team via TCODE SICF and are not active by default. SAP ECC has no native webhook system, so purchase orders and other documents are read by polling RFC_READ_TABLE or OData queries on a schedule.

How SPS Commerce works

SPS Commerce is a cloud-based EDI network and REST API that sits between a supplier ERP and major retail trading partners. It exposes purchase orders, invoices, advance ship notices (ASNs), inventory advice, and POS data through JSON endpoints wrapped in RSX 7.7.7 envelope format. All calls use OAuth 2.0 client credentials, returning a JWT bearer token valid for 1 hour. SPS supports polling via scheduled REST calls to /fulfillment/v1/purchaseorders and other endpoints, and outbound documents (invoices, ASNs) are pushed immediately on ERP events. Trading partner IDs (Walmart, Target, Amazon, etc.) are provisioned during onboarding and are not discoverable via API. Rate limits are not publicly documented; SPS recommends exponential backoff with jitter on 429 responses.

What moves between them

The main flow runs from SPS into SAP ECC. ml-connector polls SPS at configurable intervals (typically 5-15 minutes) for purchase orders and demand signals, then posts them into SAP ECC as purchase requisitions or purchase orders. When SAP documents post (invoices after delivery receipt, advance shipping notices after picking), ml-connector immediately formats them in RSX 7.7.7 and pushes them to SPS for distribution to the retail trading partners. Reference data such as vendors and materials is aligned in both directions.

How ml-connector handles it

ml-connector manages the on-premises agent connection to SAP ECC by accepting the RFC/BAPI configuration (host, port, user, password) per customer and calling RFC functions directly via the .NET or Java Connector; credentials are encrypted and the agent runs on the customer network. For SPS, ml-connector caches the OAuth token and refreshes it when a call returns 401 or when the token nears expiry. Polling from SPS uses cursor-based pagination (cursor is Base64-encoded and opaque) and respects SPS rate limits by backing off on 429 responses and retrying with exponential jitter. Documents posted to SPS must be wrapped in RSX 7.7.7 JSON envelopes per SPS schema, not sent as raw ERP data. Purchase orders flowing from SPS into SAP are mapped to SAP purchase requisitions (MM01 transaction equivalent) or direct POs, with vendor and GL account lookups performed against SAP's vendor master (BAPI_VENDOR_GETLIST) and cost center master (BAPI_COSTCENTER_GETLIST). Invoices flowing from SAP to SPS are mapped from SAP's FI documents (BAPI_ACC_DOCUMENT_POST history) and matched to the original purchase order via document reference numbers. Since SPS has no vendor-defined idempotency mechanism, ml-connector deduplicates at the document level using purchase order number, invoice number, and ASN reference, and stores state in its audit log so replays do not double-post. Every record carries a full audit trail and can be replayed if a downstream call fails.

A real-world example

A mid-sized consumer goods distributor runs SAP ECC at the head office and fulfills purchase orders from major retailers: Walmart, Target, and Amazon. Before the integration, the supply chain team exported purchase orders from each retailer's EDI mailbox or SPS portal, re-entered line items into SAP ECC by hand, then waited for picking/packing, and manually exported invoices and ASNs back to SPS for each retailer. Month-end reconciliation required chasing which orders had been invoiced to which partner and re-keying missing shipments. With SAP ECC and SPS Commerce connected, each retailer PO flows automatically into SAP, picking and packing trigger automatic ASN export to SPS, and invoicing in SAP automatically posts the invoice to SPS without manual export. The supply chain team sees a unified order pipeline, and retailers receive timely shipment notices without manual intervention.

What you can do

  • Poll SPS Commerce for purchase orders and demand signals at configurable intervals and post them into SAP ECC as purchase requisitions with vendor and GL account matching.
  • Automatically format invoices and advance shipping notices from SAP ECC in RSX 7.7.7 envelope format and push them to SPS Commerce for retail trading partner delivery.
  • Authenticate SAP ECC via on-premises RFC/BAPI agents (NCo/JCo) and SPS Commerce via OAuth 2.0, managing token refresh and RFC connection pooling.
  • Deduplicate at the document level using purchase order number, invoice number, and ASN reference to prevent double-posting on retry or replay.
  • Handle SPS Commerce rate limits with exponential backoff and jitter, and maintain a full audit trail on every purchase order, invoice, and shipment notice.

Questions

How does ml-connector connect to SAP ECC if it runs in the cloud?
ml-connector accepts the SAP RFC configuration (host, port, user, password) and uses the SAP .NET Connector (NCo) or Java Connector (JCo) installed on an on-premises agent running on the customer network. The agent initiates RFC calls to SAP ECC and returns data to ml-connector. Credentials are encrypted, and the agent can be deployed as a container or Windows service.
What happens when SPS Commerce rate limits kick in?
SPS does not publish rate limits but recommends exponential backoff with jitter on 429 responses. ml-connector detects 429 errors, waits with backoff, and retries the call. If a limit is exceeded during a polling cycle, ml-connector pauses the next poll and alerts via the audit log.
Can ml-connector sync documents that are already in SAP ECC when the integration is turned on?
ml-connector deduplicates at the document level using purchase order number, invoice number, and ASN reference. Documents already in SAP ECC will not be re-posted to SPS. Backfill of historical documents requires a one-time manual export and upload or a custom backfill plan discussed with the ml-connector team.

Related integrations

Connect SAP ECC and SPS Commerce

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

Get started