ml-connector
SAP ECCTradeshift

SAP ECC and Tradeshift integration

SAP ECC runs procurement and finance on premises. Tradeshift runs AP automation and supply chain finance in the cloud. Connecting them keeps your POs and invoices moving without manual entry or format conversion. New purchase orders from SAP ECC appear in Tradeshift's supplier network automatically, supplier invoices received in Tradeshift post into SAP ECC's AP ledger with cost center allocation, and remittance advice flows back to suppliers. ml-connector handles the on-premises RFC/BAPI gateway, OAuth 1.0a authentication to the Tradeshift cloud API, and conversion between SAP's internal GL format and Tradeshift's UBL 2.0/2.2 XML document model.

How SAP ECC works

SAP ECC is an on-premises ERP suite that exposes purchase orders, vendor invoices, general ledger accounts, and cost centers through BAPI function modules and OData REST via an SAP Gateway agent running on the customer network. Authentication uses HTTP Basic Auth (username and password) against the Gateway, while BAPI calls also require an on-premises SAP .NET Connector or Java Connector agent configured with NCo/JCo and network access to the SAP application server. SAP ECC has no published rate limits but typically supports 10 to 50 concurrent RFC calls; exceeding this causes SYSTEM_FAILURE exceptions. There is no native webhook registry, so data is read by polling via RFC_READ_TABLE or BAPI calls on a schedule you control. IDoc outbound push is available but requires SAP Basis configuration in the WE21/WE20 transaction set.

How Tradeshift works

Tradeshift is a cloud B2B network accessed via REST HTTPS at https://api.tradeshift.com/tradeshift/rest/external/. All documents (invoices, purchase orders, remittance advice) are exchanged in UBL 2.0/2.2 XML format and identified by documentProfileId. Authentication uses OAuth 1.0a two-legged (server-to-server) with consumer_key, consumer_secret, token, and token_secret, and every call requires the X-Tradeshift-TenantId header. Tradeshift has no native GL account or cost center API; those are embedded in line item dimensions. A sandbox environment is available at https://sandbox.tradeshift.com/ with the same OAuth flow for testing without affecting live operations.

What moves between them

Purchase orders flow from SAP ECC into Tradeshift. ml-connector polls SAP ECC for new or changed POs via BAPI_PO_GETDETAIL1, maps the line items to UBL 2.0 format, and posts them to Tradeshift's REST API so suppliers can access them in the network. Invoices and remittance advice flow from Tradeshift back into SAP ECC. ml-connector polls Tradeshift for new invoice and remittance documents received from suppliers, maps them from UBL XML back to SAP document structure, and posts them into SAP ECC's general ledger via BAPI_ACC_DOCUMENT_POST with cost center allocation. Vendor master data (names, addresses, payment terms) may also flow from SAP to Tradeshift to keep supplier profiles current. The schedule is typically tied to your procurement and payment cycles, not real-time.

How ml-connector handles it

ml-connector stores both credential sets encrypted: the SAP Basic Auth username/password for the on-premises Gateway, and the OAuth 1.0a key/secret/token for Tradeshift. On the SAP side, it calls BAPI_PO_GETDETAIL1 via RFC to fetch purchase orders, using REF_DOC_NO as an external idempotency key to detect and skip duplicate submissions on retry. It converts SAP PO line items (material, quantity, cost center) to UBL 2.0 XML format, maps SAP vendor IDs to Tradeshift network partners via a cached lookup table, and POSTs to Tradeshift's REST API with OAuth 1.0a signature in the Authorization header and the tenant ID in X-Tradeshift-TenantId. On the inbound side, ml-connector polls Tradeshift's GET documents/v2/ endpoint with a changedAfter timestamp filter to find new invoices and remittance advice, parses the UBL XML to extract line-item dimensions (GL account, cost center, amount), and calls BAPI_ACC_DOCUMENT_POST to post journals into SAP ECC's general ledger. It retries on BAPI locks (SYSTEM_FAILURE) with exponential backoff, and tracks every record in an audit log so a failed posting can be replayed without duplication.

A real-world example

A mid-sized industrial equipment supplier runs SAP ECC on premises for procurement, AP, and GL accounting, and uses Tradeshift to collaborate with 200+ customers who want invoices in UBL format via the Tradeshift network instead of email and custom EDI. Before the integration, the AP team manually entered incoming Tradeshift invoices into SAP ECC, re-keying vendor names, invoice amounts, and GL codes, and outbound POs were printed, scanned, and uploaded to Tradeshift by hand. The vendor master in Tradeshift was stale because updates in SAP were never pushed out. With SAP ECC and Tradeshift connected, new POs from SAP appear in Tradeshift within minutes so customers see them immediately, invoices received in Tradeshift post into SAP ECC's AP ledger automatically with GL codes and cost centers already correct, and vendor profiles in Tradeshift stay in sync with SAP. The manual invoice entry step is eliminated, PO-to-invoice matching is cleaner, and month-end close is faster because AP is no longer chasing data across systems.

What you can do

  • Poll SAP ECC for purchase orders and post them to Tradeshift in UBL 2.0/2.2 XML format so suppliers see them in the B2B network.
  • Receive invoices and remittance advice from Tradeshift and post them into SAP ECC's general ledger with GL codes and cost center allocation.
  • Map SAP ECC vendor IDs to Tradeshift network partners and sync vendor master data (name, address, payment terms) from SAP to keep supplier profiles current.
  • Authenticate SAP ECC via HTTP Basic Auth and on-premises RFC/BAPI, and Tradeshift via OAuth 1.0a with proper tenant isolation.
  • Detect duplicate submissions via REF_DOC_NO, retry failed BAPI calls, and maintain a full audit trail so any invoice can be replayed if a downstream ledger post fails.

Questions

How does ml-connector handle SAP ECC's on-premises architecture and Tradeshift's cloud API?
ml-connector requires an on-premises SAP .NET Connector or Java Connector agent installed on the customer network with network access to the SAP application server. The agent runs ml-connector's polling logic locally to call RFC/BAPI functions, while a cloud component handles Tradeshift OAuth 1.0a calls and document format conversion between SAP internal GL structure and UBL 2.0/2.2 XML. Both components stay in sync via job IDs and an encrypted audit log.
What happens if an invoice posts successfully to Tradeshift but the SAP ECC BAPI_ACC_DOCUMENT_POST call fails?
Every record carries a job ID and is stored in the audit log before posting. If the BAPI call fails (due to a locked document or SYSTEM_FAILURE exception), ml-connector backs off with exponential jitter and retries. If the retry succeeds, the audit log shows both the failure and the success. If it exhausts retries, the record is flagged for manual review and can be replayed once the root cause is fixed.
Does ml-connector support Tradeshift's event stream API instead of polling?
Not yet. ml-connector currently polls Tradeshift via GET documents/v2/ with a changedAfter timestamp filter on a schedule tied to your procurement cycle. Event stream support (protobuf messages for registered plugins) requires additional Tradeshift app registration and client code; if your organization requires real-time invoicing, that can be evaluated as a future enhancement.

Related integrations

Connect SAP ECC and Tradeshift

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

Get started