ml-connector
SAP S/4HANAOrderful

SAP S/4HANA and Orderful integration

SAP S/4HANA runs your procurement and finance. Orderful delivers EDI documents to your suppliers and partners. Connecting them streams your purchase orders and invoices from SAP directly into EDI format, eliminating the manual translation and re-keying step. SAP S/4HANA business partners automatically map to Orderful routing rules, so each PO and invoice reaches the correct trading partner channel (AS2, SFTP, or VAN) without manual intervention. Every document carries a full audit trail and can be replayed if a downstream delivery fails.

How SAP S/4HANA works

SAP S/4HANA exposes purchase orders, purchase order items, suppliers, supplier companies, supplier invoices, and invoice line items with GL account details through OData V2 and V4 REST APIs at a tenant-specific URL. Authentication uses OAuth 2.0 Client Credentials, with scopes defined per Communication Arrangement; tokens are short-lived and must be refreshed before expiry. SAP S/4HANA has no native webhooks for cloud deployments, so polling via timestamp-based filters or delta tokens is required. GL accounts and cost centers are read-only. On-premise deployments require the sap-client query parameter; cloud public deployments do not.

How Orderful works

Orderful exposes EDI transaction types including 850 (Purchase Order), 860 (Purchase Order Change), 810 (Invoice), 812 (Credit/Debit Adjustment), and routing endpoints via REST JSON API. Every API call uses a static API Key passed in the orderful-api-key header; there is no OAuth, no token refresh, and no scopes. Orderful routes transactions by ISA identifiers (sender.isaId and receiver.isaId) and supports both webhook push (you expose an HTTP endpoint and Orderful POSTs transactions to it) and polling via buckets. Data is region-specific and not synced across US and EU instances. The stream field must be test during development and live in production.

What moves between them

SAP S/4HANA purchase orders and supplier invoices flow one direction into Orderful. ml-connector polls SAP S/4HANA on a schedule you define, extracts purchase orders with their line items and suppliers, and transforms them into EDI 850 Purchase Order documents. Supplier invoices are transformed into EDI 810 Invoice documents. Each document includes the supplier business partner data (name, number, address) needed for Orderful to route to the correct EDI receiver. EDI documents flow outbound to trading partners only; Orderful does not send data back into SAP.

How ml-connector handles it

ml-connector stores the SAP OAuth client credentials and refreshes the bearer token before it expires (typically every 12 hours), eliminating token 401 errors mid-polling. It constructs the correct OData endpoint URL using your SAP tenant identifier and filters purchase orders and invoices by their LastChangeDateTime to retrieve only changed records since the last run. For each document, it maps the SAP A_Supplier and A_Customer entities to Orderful's ISA identifiers and routing configuration, then transforms the purchase order or invoice payload into the Orderful v4 Mosaic JSON schema. Before every API call to Orderful, it validates that the sender and receiver ISA identifiers are correctly assigned and retries with exponential backoff if Orderful returns a 429 rate-limit response. The stream field is set to test during development and switched to live for production deliveries.

A real-world example

A mid-sized industrial equipment manufacturer runs SAP S/4HANA for procurement and finance and ships hundreds of purchase orders to suppliers and distribution partners every month. Historically, the procurement team created purchase orders in SAP, then exported them, manually filled in EDI headers and segment codes using a spreadsheet template, and uploaded the EDI 850 files to a dedicated SFTP server for each partner, or converted them to AS2 format for others. Invoice receipt was manual as well: suppliers sent back their acknowledgments and invoices via email or VAN, and finance staff re-entered invoice totals into SAP. With SAP S/4HANA and Orderful connected, every purchase order automatically flows to Orderful within minutes, routes to each supplier or partner via their preferred channel (AS2 for large partners, SFTP for regional distributors, VAN for legacy suppliers), and the supplier invoices that come back are ready to be received into SAP without re-keying. The procurement team now spends their time on strategy, not formatting, and finance closes the month faster.

What you can do

  • Transform SAP S/4HANA purchase orders into EDI 850 Purchase Order documents and route them to suppliers via Orderful.
  • Map SAP business partners and suppliers to Orderful ISA identifiers and delivery channels automatically.
  • Refresh SAP OAuth tokens before expiry to prevent integration failures mid-polling.
  • Poll SAP S/4HANA on a schedule you define and detect only changed purchase orders and invoices since the last run.
  • Provide a full audit trail on every document and replay failed deliveries without manual intervention.

Questions

Does the integration work with on-premise SAP S/4HANA?
Yes. ml-connector supports both SAP S/4HANA Cloud and on-premise deployments. For on-premise, you provide the server URL and specify the SAP client ID via the sap-client query parameter. Cloud Public deployments do not require the client parameter.
What happens if an SAP OAuth token expires during polling?
ml-connector refreshes the OAuth token automatically before it expires (tokens are typically valid for 12 hours). If a token is near expiry, ml-connector gets a fresh one from the SAP token endpoint before making any OData call, preventing integration interruptions.
How are SAP suppliers mapped to Orderful partners?
ml-connector reads the SAP A_Supplier entity (which includes the supplier number and company code) and matches it to a mapping table you configure in ml-connector, which associates each SAP supplier with the Orderful ISA identifier and delivery channel for that partner. If a new supplier is added to SAP, you add the mapping so that supplier's POs route to the correct Orderful partner.

Related integrations

Connect SAP S/4HANA and Orderful

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

Get started