Skip to main content

SAP S/4HANA

The SAP S/4HANA connector reads billing documents out of S/4HANA over SAP's standard OData service API_BILLING_DOCUMENT_SRV (and the sold-to party from API_BUSINESS_PARTNER), turns each invoice and credit memo into an e-invoice and sends it. Nothing is installed in SAP and no outbound SM59 destination or ABAP transport is needed: GoRoute calls the service with a communication user that can read billing documents.

It works two ways, which can be used side by side:

  • Automatically โ€” GoRoute checks SAP every five minutes and sends each new or changed billing document. Anything it cannot send is held with the reason.
  • One at a time โ€” pick a document on the SAP panel, Dry run it against the compliance rules, then Send.
Status

Sending one document at a time is on every GoRoute service. Automatic sending, Sync now, the held list it keeps, and Retry now, Skip and Never send have been on GoRoute's production and test services since 8 November 2026, and on GoRoute's services in Oman since 10 November 2026.

The connector is built, and the query it uses to find new and changed documents has been run against SAP's public API sandbox. It has not yet run against a customer's own S/4HANA tenant. The first customer tenant confirms the points listed under What a reference tenant confirms.

What you need in SAPโ€‹

  1. A communication user (Communication Users app) with read access to billing documents and business partners.
  2. A communication arrangement for scenario SAP_COM_0120 (billing document read) binding that user, so API_BILLING_DOCUMENT_SRV is exposed. Business-partner reads (API_BUSINESS_PARTNER) let GoRoute fill the customer's name, address and VAT number.
  3. The service base URL, for example https://my-s4.example.com/sap/opu/odata/sap.

For an evaluation you can connect to SAP's public API sandbox (Business Accelerator Hub) with an API key instead. Its data never changes, so automatic sending finds nothing new there; use the one-at-a-time path.

Connectโ€‹

On Connectors โ†’ SAP S/4HANA โ†’ Setup, choose your own S/4HANA, enter the base URL, the communication user and its password, your seller Peppol ID, and tick Send new billing documents automatically. Start from is optional: without it, GoRoute starts at the moment you turn automatic sending on and never sends your older documents.

The same through the API:

curl -X POST https://app.goroute.ai/peppol-api/api/v1/connectors/{id}/connect \
-H "X-API-Key: your_api_key" -H "Content-Type: application/json" \
-d '{
"config": {
"source": "live",
"base_url": "https://my-s4.example.com/sap/opu/odata/sap",
"company_code": "1710",
"seller_peppol_id": "0106:12345678",
"auto_sync": true,
"sync_from": "2026-11-07"
},
"credentials": {"username": "GOROUTE_COMM", "password": "โ€ฆ"}
}'

The password is stored encrypted and never returned. A successful connect also clears any back-off left from an earlier failure.

What is sentโ€‹

SAP (SD document category)GoRoute
M invoice, 5 intercompany invoiceinvoice
O credit memo, 6 intercompany credit memocredit note; the invoice it credits is cited when an item references one
P debit memodebit note
U pro forma, 3 invoice listnot sent (not a tax document)
N, S cancellationnot sent. A cancellation of a document never sent needs nothing. A cancellation of a document already sent is held: a sent e-invoice cannot be withdrawn, so issue a credit memo in SAP

A document marked cancelled in SAP before GoRoute sent it is not sent.

The customer. GoRoute addresses each document to the sold-to party in this order: the connector's party map (SAP customer number โ†’ Peppol ID, for customers you map yourself); for a seller in Oman, the customer's Omani VAT number under scheme 0248; then the Peppol network, from the customer's VAT number (taken from the billing document's VATRegistration, else the business partner's VAT tax number). A customer GoRoute cannot find is held, never sent to a default.

The seller. The connector's seller settings, with anything missing taken from your company settings in GoRoute.

Held documentsโ€‹

This section applies when automatic sending is on ("auto_sync": true).

A document GoRoute cannot send is held on the connector, with the reason and where to correct it: the billing document, the business partner in SAP (a missing VAT number), the connector's party map, or your company settings. The SAP panel's Monitor tab lists them; so do held_invoices on GET /api/v1/connectors and GET /api/v1/connectors/held-invoices, as for every pull connector (see When an invoice cannot be sent).

  • A document corrected in SAP is picked up by its change on the next check.
  • A fix elsewhere (the business partner, the party map, your company settings) is picked up within about 15 minutes, or at once with Sync now.
  • A fault on GoRoute's side is retried on every check; nothing needs changing in SAP.

Each held document can also be acted on by hand: Retry now sends it again at once, Skip (with a reason) stops retrying it until it changes in SAP, and Never send (with a reason) is for a document handled outside GoRoute. Each action is recorded in your audit log, and a document held for more than three days is in the daily e-mail to your administrators. The key is the billing document number. In the portal the buttons are on the Invoice Hub's list of held invoices; through the API see Retry, skip or never send a held invoice.

GoRoute never sends the same billing document twice: each send is keyed on the SAP document number, and a document already sent (automatically or from the panel) is recognised and skipped.

If SAP cannot be reached, the panel says so and GoRoute waits longer between attempts, up to ten minutes. Connect or Test clears the wait.

Sync nowโ€‹

POST /api/v1/connectors/{id}/sync runs one check at once and returns what it did:

{"fetched": 3, "submitted": 2, "failed": 1, "unreachable": 0, "skipped": 0, "last_error": "โ€ฆ"}

With automatic sending off, Sync now pulls nothing and says so.

Sync now for SAP arrived together with automatic sending. On a service without it (the check is in the Status note at the top of this page), send each document one at a time.

How changes are foundโ€‹

GoRoute asks SAP for billing documents whose LastChangeDateTime is at or after its last mark, less fifteen minutes, oldest change first, and skips each document it has already handled at that same change time. The fifteen minutes catch a document saved by a long-running transaction after a later one. A changed document has a new change time and is read again.

What a reference tenant confirmsโ€‹

  • That the tenant fills LastChangeDateTime when a billing document is created, not only on a later change. If it does not, set cursor_includes_unstamped: true on the connector, which also reads documents with no change time created on or after the mark's day.
  • The communication user's access to the business partner's addresses and tax numbers (without it GoRoute falls back to the plain business-partner read).
  • The tax codes and exemption reasons your billing documents carry, for the countries you invoice.
  • Writing the status back into SAP (a Z-table through a customer-side OData service) is not part of this connector; the status is recorded in GoRoute.