ml-connector
SAP S/4HANAAnaplan

SAP S/4HANA and Anaplan integration

SAP S/4HANA is the system of record for finance and procurement. Anaplan is where the budget, forecast, and workforce plans are built. Connecting the two means the planning models run on the same accounts, cost centers, and posted actuals that live in SAP, instead of on a spreadsheet exported by hand. When a plan is approved in Anaplan, the approved values can be posted back into SAP as journal entries. ml-connector handles the very different APIs on each side and moves the data on a schedule you control.

How SAP S/4HANA works

SAP S/4HANA Cloud exposes suppliers and customers as Business Partners, plus supplier invoices, purchase orders, GL accounts, GL account line items, and cost centers, through OData V2 and V4 services on a tenant-specific URL. An SAP admin must first set up a Communication Arrangement, which issues the OAuth 2.0 client credentials used as a bearer token. GL accounts and cost centers are read-only master data, while supplier invoices and journal entries can be posted. Every write requires an X-CSRF-Token fetched first, and S/4HANA does not push native webhooks, so finance data is read by polling with an OData filter on the last change date.

How Anaplan works

Anaplan is a planning platform, not an ERP, so it has no native invoice, vendor, purchase order, or GL account objects. All data lives inside a workspace and model as lists, modules, and line items, and nearly every call needs a workspace ID and model ID. Data moves through bulk import and export actions that a model builder must create first; the API runs those named actions, it cannot create them. Imports and exports are asynchronous, return a task ID to poll, and lock the model while they run. Auth is a basic or certificate token that lasts 35 minutes, or OAuth2; client credentials grant is not supported, and Anaplan never pushes events.

What moves between them

Data moves in both directions. From SAP S/4HANA into Anaplan, ml-connector reads master data such as GL accounts, cost centers, and suppliers and loads them into the matching Anaplan lists, then reads posted actuals such as GL account line items and supplier invoices and imports them into the actuals modules. From Anaplan back into SAP, approved plan and budget values are pulled from an export action and posted into SAP as journal entries against the right company code and cost center. The SAP-to-Anaplan loads usually run nightly or after period close, and the writeback runs once a plan is approved. Read-only SAP master data is never overwritten by Anaplan.

How ml-connector handles it

ml-connector stores both credential sets encrypted. On the SAP side it requests an OAuth2 client credentials token from the tenant token endpoint, caches it until it nears its expiry, and fetches an X-CSRF-Token before any journal entry post, re-fetching and retrying if a write returns 403. On the Anaplan side it refreshes the 35-minute auth token before it expires rather than per call, and it carries the lowercase workspace ID and uppercase model ID required on every request. SAP GL accounts and cost centers are loaded into Anaplan lists first, so every imported actual and every journal posted back lands on a dimension that already exists on both sides. Anaplan imports and exports are asynchronous and lock the model, so ml-connector starts an action, polls the task until it reports complete, downloads the export file in chunks, and serializes jobs so two of them never hit the same model at once. Because neither system pushes events for this pair, both are polled on a schedule. SAP returns HTTP 429 with a Retry-After header and Anaplan caps the tenant at 600 requests per minute, so ml-connector backs off with jitter on both. SAP rejects a duplicate supplier invoice for the same vendor, reference, company code, and fiscal year, and every record carries a full audit trail and can be replayed if a downstream call fails.

A real-world example

A mid-sized manufacturer with about 900 employees runs SAP S/4HANA Cloud for finance and procurement and builds its annual budget and rolling forecast in Anaplan. Before the integration, an analyst exported the chart of accounts and actuals from SAP to CSV every month and loaded them into Anaplan by hand, which meant the forecast was always a few days stale and a renamed cost center could quietly break the load. With SAP S/4HANA and Anaplan connected, GL accounts and cost centers stay aligned as lists, actuals import after each close, and once the finance team approves the reallocation in Anaplan the journal entries post straight back into SAP. The manual export step is gone and planning works from current ledger numbers.

What you can do

  • Load SAP S/4HANA GL accounts and cost centers into Anaplan lists so plans use the live chart of accounts.
  • Import posted SAP actuals, such as GL line items and supplier invoices, into Anaplan actuals modules.
  • Post approved Anaplan plan and budget values back into SAP S/4HANA as journal entries on the right cost centers.
  • Bridge SAP OAuth2 client credentials and X-CSRF-Token writes with Anaplan's 35-minute token and workspace and model IDs.
  • Poll both systems on a schedule, serialize Anaplan model jobs, and keep a full audit trail with replay on every record.

Questions

Which direction does data move between SAP S/4HANA and Anaplan?
It moves both ways. SAP S/4HANA master data and posted actuals, such as GL accounts, cost centers, and journal line items, are read and imported into Anaplan, and approved plan values from Anaplan are posted back into SAP as journal entries. Read-only SAP master data such as GL accounts and cost centers is never overwritten from Anaplan.
Does Anaplan store invoices or GL accounts the way SAP does?
No. Anaplan is a planning platform with no native invoice, vendor, or GL account objects. It holds everything as lists, modules, and line items inside a workspace and model, so ml-connector maps SAP accounts and cost centers to Anaplan lists and loads SAP actuals into modules through bulk import actions a model builder has already created.
How does the integration handle the lack of webhooks on both sides?
Neither SAP S/4HANA nor Anaplan pushes events for this connection, so ml-connector polls. SAP is queried with an OData filter on the last change date, and Anaplan import and export actions are started and then polled by task ID until they complete. Because Anaplan locks a model during a job, ml-connector serializes work so two jobs never run against the same model at once.

Related integrations

Connect SAP S/4HANA and Anaplan

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

Get started