ml-connector
SAP ECCCoupa

SAP ECC and Coupa integration

SAP ECC is the source of truth for your vendor master and general ledger. Coupa manages your procurement workflows and supplier relationships in the cloud. Connecting the two keeps supplier records synchronized across both systems and ensures that purchase order matches and invoice reconciliation in Coupa reflect current data from your ERP. New vendors added in SAP ECC flow into Coupa, and invoices created in SAP ECC can be synced to Coupa for match-to-order processing without manual re-entry.

How SAP ECC works

SAP ECC is an on-premises ERP suite that exposes vendor master data (LFA1, LFB1 tables), purchase order headers and line items (EKKO, EKPO), general ledger accounts and cost centers, and supplier invoices through BAPI function modules and OData v2 REST. Access requires an on-premises agent running SAP .NET Connector (NCo) or Java Connector (JCo) and HTTP Basic Auth (username and password). Because SAP ECC has no native webhook system, data is read by polling RFC_READ_TABLE or calling BAPI_VENDOR_GETLIST on a scheduled interval. Write operations require explicit BAPI_TRANSACTION_COMMIT to persist changes, and duplicate detection on retry uses the REF_DOC_NO field on invoices. Concurrent RFC throughput is typically 10 to 50 calls; exceeding this causes communication failures. The RFC connection is bound to the customer's SAP instance hostname and port.

How Coupa works

Coupa is a cloud-based procurement platform that exposes suppliers, purchase orders, invoices, and payments through REST API at https://{instanceUrl}/api. Authentication uses OAuth2 client credentials with a required X-Coupa-API-Version header. Coupa also supports webhooks for requisition, purchase order, invoice, supplier, and payment events, each signed with HMAC-SHA256 and delivered to a registered endpoint. Rate limits return HTTP 429; the Coupa API enforces a 30-second timeout per request and caps webhook payloads at 256KB. Write operations to Coupa create or update invoices, suppliers, and requisitions through REST endpoints, and all updates are idempotent via Coupa's deduplication logic on natural keys.

What moves between them

The primary flow moves vendor and invoice data from SAP ECC into Coupa. Vendor master records (name, tax ID, payment terms, business address) are read from SAP ECC's LFA1 table via RFC_READ_TABLE or BAPI_VENDOR_GETLIST and posted to Coupa's Supplier endpoint on a scheduled interval. Invoices created in SAP ECC's BSEG table (accounting document line items) are read and mapped to Coupa's Invoice entity with PO and cost center references. The sync runs on a fixed schedule (e.g., hourly or daily), not in response to a webhook, because SAP ECC is pull-only. Mapping includes translating SAP vendor numbers to Coupa supplier IDs, matching GL accounts to Coupa cost centers, and ensuring all invoice line items reference valid purchase order numbers in Coupa.

How ml-connector handles it

ml-connector maintains an on-premises RFC agent (or gateway URL) per customer and uses it to authenticate against SAP ECC with HTTP Basic Auth over OData or BAPI calls. For each polling interval, it reads LFA1 vendor records and BSEG invoice documents using RFC_READ_TABLE or BAPI_VENDOR_GETLIST, then translates each SAP record to Coupa's Supplier or Invoice JSON schema. Before posting to Coupa, ml-connector refreshes the OAuth2 access token and prepares the X-Coupa-API-Version header. Each Coupa POST includes an idempotency key based on the SAP document number to prevent duplicate invoices on retry. If Coupa returns 429, ml-connector backs off and retries with exponential backoff capped at 30 seconds. For invoices, the integration maps SAP cost center codes to Coupa cost center fields and cross-references PO numbers, so each line item lands on the correct procurement dimension. Vendor master changes in SAP ECC are detected on the next polling cycle and upserted into Coupa, overwriting outdated supplier records. Every record carries a full audit trail, including the SAP document number, the Coupa API response, and any transformation errors.

A real-world example

A mid-market manufacturing company runs SAP ECC on-premises for accounting and procurement, and recently adopted Coupa in the cloud for supplier collaboration and invoice matching. Before the integration, the procurement team manually entered new vendors into Coupa by copying names and tax IDs from SAP ECC, a process that lagged by days. Invoices received from vendors were keyed into both SAP ECC and Coupa separately, creating reconciliation gaps and duplicate payment risk. With SAP ECC and Coupa connected, each new vendor in SAP ECC appears in Coupa automatically on the next polling cycle, and invoices created in SAP ECC post into Coupa with the correct PO reference and cost center in a single sync job. The procurement and accounting teams now have a single source of truth for supplier master data, and invoice matching in Coupa matches what was actually posted in SAP ECC.

What you can do

  • Poll vendor master data from SAP ECC via BAPI and RFC, then post new and changed vendors into Coupa's supplier endpoint.
  • Sync invoices from SAP ECC's accounting documents into Coupa with correct PO and cost center mapping.
  • Authenticate SAP ECC with HTTP Basic Auth and Coupa with OAuth2 client credentials, managing token refresh automatically.
  • Handle SAP ECC's on-premises RFC constraints including agent routing, concurrent call limits, and BAPI transaction commits.
  • Detect duplicate invoices on retry using SAP document numbers as idempotency keys and back off on Coupa rate limits with exponential retry.

Questions

Which direction does data move between SAP ECC and Coupa?
The primary flow moves vendor master data and invoices from SAP ECC into Coupa. Vendor records are read from SAP ECC's LFA1 table and posted to Coupa as suppliers. Invoices are read from SAP ECC's accounting documents and synced to Coupa with PO and cost center references. Changes in SAP ECC are detected on the next polling cycle.
Why does ml-connector require an on-premises RFC agent for SAP ECC?
SAP ECC is an on-premises system with no cloud REST API. RFC/BAPI calls cannot originate directly from the cloud; the agent must run on the customer's network with SAP .NET Connector (NCo) or Java Connector (JCo) installed. The agent translates ml-connector's requests into SAP-native calls and returns the results over a secure connection.
How does the integration handle duplicate invoices when SAP ECC posts the same invoice twice?
ml-connector uses the SAP document number (from BSEG) as an idempotency key when posting to Coupa. Each Coupa POST includes this key, so if the same SAP invoice is read on a retry or a second polling cycle, Coupa's idempotency logic deduplicates it automatically, preventing double-entry.

Related integrations

Connect SAP ECC and Coupa

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

Get started