SAP S/4HANA and Cleo integration
SAP S/4HANA runs procurement and finance across your enterprise. Cleo Integration Cloud routes orders, invoices, and shipments to your trading partners. Connecting the two lets you push purchase orders from SAP directly to suppliers through Cleo as EDI 850 transactions, and pull incoming supplier invoices back into SAP as SAPInvoice records mapped to the correct GL accounts. Your procurement data flows end-to-end without manual EDI re-keying or format translation.
What moves between them
The primary flow runs from SAP S/4HANA into Cleo. ml-connector polls SAP for new and changed Purchase Orders, Purchase Order Items, and Supplier Invoices on a cadence you define (typically daily or hourly depending on your procurement velocity). Purchase orders are mapped to ANSI X12 850 format and loaded into Cleo as EDI transactions for transmission to suppliers. Supplier invoices are mapped to 810 format and similarly routed through Cleo. The reverse flow is optional: if suppliers send invoices back through Cleo as 810 transactions, ml-connector can parse them and create corresponding Supplier Invoice records in SAP. GL Account and Cost Center data flow as read-only reference tables, updated once per day to ensure Cleo mappings land on valid SAP dimensions.
How ml-connector handles it
ml-connector stores SAP OAuth credentials and the tenant-specific token endpoint URL from the Communication Arrangement OAuth details, and it retrieves a fresh Bearer token before expiry (typically every 11 hours to avoid the 12-hour limit). On the Cleo side it exchanges username and password for a short-lived Bearer token using the password grant flow. For each SAP Purchase Order, ml-connector reads the order header and line items, maps quantity, unit price, and line amount to the 850 segment structure, and posts the transaction to Cleo as a file in the configured folder. GL Accounts and Cost Center mappings are pre-fetched and cached so every line item carries a valid SAP GL Account code. Because SAP has no webhooks, ml-connector polls at your chosen interval using LastChangeDateTime filters to capture only new and modified records since the last run. Cleo rate limits are respected with exponential backoff, and every transaction carries full audit metadata. If a Cleo file upload fails, the transaction is retried with the same job ID to avoid duplicates.
A real-world example
A mid-sized discrete manufacturer running SAP S/4HANA for procurement and finance uses Cleo to orchestrate orders to regional suppliers and a contract manufacturer in Asia. Before the integration, the procurement team manually exported purchase orders from SAP each day, translated them into customer-specific EDI formats, and uploaded them to Cleo by hand. With SAP and Cleo connected, each purchase order created in SAP appears in Cleo automatically as an 850 EDI transaction, routed to the correct supplier folder based on the supplier master data in SAP. When suppliers send back invoices through Cleo, those invoices are automatically parsed and posted to SAP as Supplier Invoice records with GL accounts pre-populated. The daily manual export step is eliminated, and procurement velocity increases because there is no re-keying or format translation delay.
What you can do
- Poll SAP S/4HANA for new and changed purchase orders, purchase order items, and supplier invoices using OData filters.
- Map purchase orders to ANSI X12 850 EDI format and load them into Cleo for transmission to suppliers.
- Map supplier invoices to X12 810 format and route them through Cleo for receipt and GL posting.
- Handle SAP OAuth 2.0 token refresh before expiry and Cleo password grant authentication, with secure credential storage.
- Sync GL Account and Cost Center reference data from SAP to ensure all Cleo invoice mappings land on valid SAP dimensions.
Questions
- Which direction does data move between SAP S/4HANA and Cleo?
- The primary flow is SAP into Cleo. Purchase orders and supplier invoices are polled from SAP, mapped to EDI formats (850 and 810), and loaded into Cleo for supplier transmission and receipt. GL Accounts and Cost Centers flow as read-only reference data to enable accurate mapping. Incoming supplier invoices can optionally flow back from Cleo into SAP as Supplier Invoice records.
- How does ml-connector handle SAP's tenant-specific OAuth endpoint?
- SAP requires each tenant to provide a unique OAuth token endpoint URL, which must be copied from the Communication Arrangement OAuth details in SAP. ml-connector stores this endpoint per customer and does not construct it manually. Tokens are short-lived (typically 12 hours), so ml-connector refreshes them before expiry to avoid authentication failures during a polling run.
- What EDI formats does the integration support?
- ml-connector maps SAP purchase orders to ANSI X12 850 format and supplier invoices to X12 810 format for routing through Cleo. These formats are the standard for procurement EDI and are understood by most suppliers. GL Account codes and cost centers from SAP are embedded in the mapped transactions so invoices land on the correct accounts without downstream re-mapping.
Related integrations
More SAP S/4HANA integrations
Other systems that connect to Cleo
Connect SAP S/4HANA and Cleo
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started