ml-connector
SAP S/4HANAMicrosoft Power BI

SAP S/4HANA and Microsoft Power BI integration

SAP S/4HANA runs your supply chain and general ledger. Microsoft Power BI visualizes your data and powers your dashboards. Connecting the two keeps your finance reports current without manual exports and re-imports. Suppliers, purchase orders, invoices, GL accounts, cost centers, and journal entries flow from SAP into Power BI on a schedule you control, so your dashboards always reflect the latest procurement and accounting activity.

How SAP S/4HANA works

SAP S/4HANA exposes suppliers, purchase orders, supplier invoices, GL accounts, cost centers, journal entries, and business partners through OData V2 and OData V4 REST APIs, documented in the SAP API Business Hub and within each tenant instance. Authentication uses OAuth 2.0 Client Credentials with scopes defined per Communication Arrangement, and token endpoints vary by tenant so they must be copied from the Communication Arrangement rather than constructed. Tokens are short-lived, typically 12 hours, so they must be cached and refreshed before expiry. On-premise deployments require the sap-client query parameter, while cloud editions do not. GL Account and Cost Center data are read-only in SAP and maintained by system administrators. SAP publishes no native webhooks, so connectors must poll using LastChangeDateTime filters or delta tokens.

How Microsoft Power BI works

Microsoft Power BI is a cloud analytics platform that accepts data through REST APIs. The API requires OAuth 2.0 Client Credentials via a service principal, obtained from an Azure app registration with a client secret. Power BI does not push events outward, so it is strictly a destination for incoming data. Before pushing rows to a Power BI push dataset, the connector must define the table schema, specifying column names and data types. Service principals must be added as Member or Admin on the target workspace and enabled in the Power BI Admin portal Developer Settings. Tokens expire after approximately one hour and must be refreshed by re-requesting credentials. Push datasets have size and latency limits per Microsoft documentation.

What moves between them

The primary flow is SAP to Power BI. ml-connector reads suppliers, purchase orders, invoices, GL accounts, cost centers, and journal entries from SAP on a polling schedule, maps SAP entity fields to Power BI table columns, and pushes the transformed rows into dedicated Power BI push datasets. Cost centers and GL accounts are synchronized first to ensure reference data integrity, then transactional records (invoices, journal entries) are pushed and refresh cycles are triggered. The cadence typically aligns with your accounting close calendar or daily reconciliation needs.

How ml-connector handles it

ml-connector retrieves the OAuth token endpoint URL from SAP's Communication Arrangement configuration rather than constructing it, since the endpoint varies by tenant. It then authenticates with SAP client credentials and caches the short-lived token, refreshing it before expiry to avoid mid-stream auth failures. For Power BI, ml-connector uses a service principal authenticated with a client secret, and includes the bearer token on every API call. Before the first data push, ml-connector creates or validates the target Power BI push dataset schema to match the transformed entity structure. It polls SAP using LastChangeDateTime filters to fetch only new and changed records since the last sync, reducing unnecessary API calls. When SAP pushes partial data across multiple pages, ml-connector handles pagination. After all rows are posted to Power BI, ml-connector triggers a dataset refresh so reports and dashboards reflect the latest figures immediately. Rate limiting on either system is handled with exponential backoff and jitter. Every record pushed includes a timestamp and source identifier for audit purposes.

A real-world example

A mid-sized manufacturing company runs SAP S/4HANA for procurement and accounting across three plants and a central office. Finance and operations teams use Power BI dashboards to track open purchase orders, supplier performance, and GL account balances in real time. Before the integration, analysts ran SAP reports manually each morning, exported them to CSV, and uploaded the data to Power BI, a process taking two hours and prone to timing gaps. With SAP S/4HANA and Power BI connected, overnight batch polls fetch the latest supplier, purchase order, and GL data, push it into Power BI datasets, and trigger dashboard refreshes before the business opens. Teams see current metrics without waiting, and month-end close starts with up-to-date GL balances already in the finance dashboard.

What you can do

  • Pull suppliers, purchase orders, invoices, and GL entries from SAP S/4HANA on a daily or custom polling schedule.
  • Push transformed procurement and finance data into Power BI push datasets and trigger automatic dashboard refreshes.
  • Synchronize SAP cost centers and GL accounts as reference data so Power BI reports use consistent dimensions.
  • Authenticate SAP with OAuth 2.0 Client Credentials and refresh short-lived tokens automatically before expiry.
  • Handle SAP pagination, Power BI rate limits, and schema mismatches with retries and a full audit trail on every record.

Questions

How does ml-connector handle SAP S/4HANA's short-lived OAuth tokens?
ml-connector caches the OAuth token returned by SAP's tenant-specific token endpoint and refreshes it before expiry, typically before the 12-hour mark. This prevents mid-sync authentication failures and reduces unnecessary token requests. If a refresh fails, ml-connector retries with exponential backoff and surfaces the error for investigation.
What data moves from SAP S/4HANA into Power BI and in which direction?
Data flows one direction: from SAP to Power BI. Suppliers, purchase orders, invoices, GL accounts, cost centers, and journal entries are polled from SAP and pushed into Power BI datasets. Power BI is a reporting destination, not a source, so changes made in Power BI dashboards do not flow back to SAP.
Does ml-connector handle Power BI's schema requirements and rate limits?
Yes. ml-connector defines the Push Dataset schema once, specifying table names and column data types before posting any rows. It also monitors for HTTP 429 rate-limit responses, backs off exponentially, and retries. On the SAP side, it uses LastChangeDateTime filters to fetch only new and changed records, reducing API calls on both systems.

Related integrations

Connect SAP S/4HANA and Microsoft Power BI

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

Get started