ml-connector
SAP ECCMicrosoft Dynamics 365 Sales

SAP ECC and Microsoft Dynamics 365 Sales integration

SAP ECC holds your master data, procurement, and customers. Dynamics 365 Sales tracks prospects and opportunities in the cloud. Connecting the two keeps your sales team aware of what you buy from each vendor, which customers are also suppliers, and how purchase activity flows into the pipeline. Vendors from SAP ECC become accounts in Dynamics 365 Sales, and purchase orders can feed visibility into what deals are moving through the sales funnel. ml-connector handles the very different APIs and auth models on each side and keeps the two in sync on a schedule you control.

How SAP ECC works

SAP ECC exposes vendors, customers, materials, purchase orders, GL accounts, and cost centers through RFC/BAPI function modules (via .NET Connector or Java Connector on an on-premises agent), OData v2 REST via SAP Gateway, SOAP web services, or IDoc XML over HTTP. Authentication uses HTTP Basic Auth for OData and IDoc, or RFC Basic Auth for BAPI via the Connector, with optional mutual TLS via SNC. SAP ECC has no native webhook registry; data is accessed by polling via RFC_READ_TABLE or configured IDoc push from SAP Basis, making it a pull-first system.

How Microsoft Dynamics 365 Sales works

Dynamics 365 Sales exposes accounts, contacts, opportunities, quotes, orders, and products through OData v4 REST at https://{org-name}.api.crm.dynamics.com/api/data/v9.2/. All calls require OAuth2 client credentials via Microsoft Entra ID. The Dataverse Event Framework supports webhooks for Create, Update, Delete, and custom actions with 60-second timeout and automatic retry for 502/503/504. However, Dynamics 365 Sales has no GL accounts, AP/AR ledger, or vendor invoice tracking; those require Dynamics 365 Finance or Business Central.

What moves between them

The main flow runs from SAP ECC into Dynamics 365 Sales. Vendors from SAP ECC (LFA1/LFB1) are pulled into Dynamics 365 Sales as accounts with billing information mapped to the account record. Purchase orders from SAP ECC (EKKO/EKPO) are transformed into opportunities or orders in Dynamics 365 Sales, with line items mapped to quote details. Customer records (KNA1/KNB1) can also sync as accounts to enrich your CRM customer master. The sync runs on a schedule you choose, typically daily or after procurement events, with no real-time push from SAP ECC to Dynamics 365 Sales.

How ml-connector handles it

ml-connector runs a SAP .NET Connector agent on your network to reach SAP ECC via RFC, authenticating with HTTP Basic Auth credentials you provide for OData and IDoc, or RFC Basic Auth for BAPI. On the Dynamics 365 Sales side, ml-connector holds OAuth2 client credentials and refreshes tokens on each call, handling the 60-minute token expiry transparently. It polls SAP ECC tables (LFA1, EKKO, KNA1) on your schedule, transforms the SAP field layout into Dynamics 365 Sales schema (account name, billing country, order totals), and posts via OData. Vendor master data maps to account record type, purchase order header to opportunity or order, and line items to quote lines. ml-connector batches API calls to stay under Dataverse's rate limits, retries on transient failures (COMMUNICATION_FAILURE from SAP, 429 from Dynamics), and maintains an audit log of every sync run so failed records can be replayed. SAP ECC's lack of idempotency means ml-connector must manage deduplication by reference document number on the SAP side and by external ID matching on the Dynamics 365 Sales side.

A real-world example

A mid-market manufacturing company runs SAP ECC on-premises for procurement and finance, and uses Dynamics 365 Sales in the cloud for the sales team. Before integration, the sales team had no visibility into which customers were also vendors or what the company was buying from key accounts. Finance had to manually reconcile customer and vendor lists. With SAP ECC and Dynamics 365 Sales connected, the vendor master automatically flows into Dynamics 365 Sales as account records, enriched with payment terms and contact information. The sales team can now see that their top prospect is also a supplier, uncovering cross-sell opportunities. Purchase orders for key accounts feed into the CRM as opportunities, so sales can track buying patterns and time follow-up calls accordingly. Month-end reconciliation is automated, and the customer and vendor lists stay in agreement.

What you can do

  • Sync vendors from SAP ECC into Dynamics 365 Sales as account records with billing, payment, and contact details.
  • Transform SAP purchase orders into Dynamics 365 Sales opportunities or orders, with line items mapped to quote details.
  • Map SAP ECC customers into Dynamics 365 Sales accounts to consolidate your customer master in the cloud.
  • Authenticate SAP ECC via RFC/BAPI with an on-premises Connector agent, and Dynamics 365 Sales via OAuth2, refreshing tokens automatically.
  • Poll SAP ECC on a schedule you set, with batch API calls, deduplication via reference document numbers, and a full audit trail on every sync.

Questions

Why does ml-connector need an on-premises SAP .NET Connector agent?
SAP ECC is an on-premises system that does not expose a cloud-native REST API. The RFC/BAPI function modules that expose vendors, purchase orders, and customers can only be reached from the SAP network. ml-connector runs the Connector agent on your network to bridge the gap between SAP ECC and Dynamics 365 Sales in the cloud.
What records move from SAP ECC to Dynamics 365 Sales?
Vendors (LFA1/LFB1), customers (KNA1/KNB1), and purchase orders (EKKO/EKPO) are the primary flows. Vendors map to accounts, customers map to accounts, and purchase orders map to opportunities or orders with line items becoming quote details. GL documents and ledger entries do not flow into Dynamics 365 Sales, which has no ledger surface.
How does ml-connector handle the different auth models and API styles?
ml-connector manages HTTP Basic Auth credentials for OData and RFC Basic Auth for BAPI on the SAP side, while holding OAuth2 client credentials for Dynamics 365 Sales and refreshing tokens every 60 minutes. It polls SAP tables on a schedule, transforms the output to Dataverse OData schema, batches calls to respect rate limits, and retries on both COMMUNICATION_FAILURE from SAP and 429 from Dynamics.

Related integrations

Connect SAP ECC and Microsoft Dynamics 365 Sales

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

Get started