ml-connector
SAP ECCChargebee

SAP ECC and Chargebee integration

SAP ECC is your on-premises financial backbone. Chargebee is your subscription billing engine. Connecting the two keeps customer master records synchronized across systems and pulls Chargebee's invoices and payment transactions back into SAP's general ledger for accurate revenue recognition. New customers and vendors created in SAP ECC flow into Chargebee as billable accounts, and every Chargebee invoice posts into SAP's GL without re-keying.

How SAP ECC works

SAP ECC exposes customers, vendors, GL accounts, cost centers, and materials through RFC/BAPI function modules (BAPI_CUSTOMER_GETLIST, BAPI_CUSTOMER_GETDETAIL, BAPI_VENDOR_GETLIST, BAPI_VENDOR_GETDETAIL, BAPI_GL_ACC_GETLIST) and OData v2 REST via SAP Gateway at http://<host>:<port>/sap/opu/odata/<namespace>/<service>/. Authentication is HTTP Basic Auth with username and password. Because SAP ECC is on-premises, RFC calls require an on-premises agent running SAP .NET Connector or Java Connector on the customer's network. OData services must be manually activated by the SAP Basis team via TCODE SICF. SAP ECC has no published webhook registry, so customer and vendor records are polled on a scheduled interval rather than pushed when they change.

How Chargebee works

Chargebee exposes customers, subscriptions, invoices, transactions, payment sources, and items through REST API at https://{site}.chargebee.com/api/v2/ with regional endpoints for EU and AU. Authentication is HTTP Basic Auth using the API key as username with an empty password. Chargebee publishes 200+ webhook event types across customer, subscription, invoice, and payment categories, supporting outbound push notifications when records change. The webhook delivery system retries for up to 2 days with increasing delays. Rate limits vary by plan tier and region: Starter tier allows 150 requests per minute, while concurrent request limits cap at 50 GETs and 100 POSTs. Pagination is offset-based with a maximum page size of 100 records.

What moves between them

Master data flows from SAP ECC into Chargebee. Customer records from SAP ECC's KNA1 and KNB1 tables (via BAPI_CUSTOMER_GETLIST) are pulled on a scheduled interval and synced to Chargebee as customers with matching external identifiers. Vendor records from LFA1 and LFB1 are synced as well. In the reverse direction, Chargebee invoices and transactions flow back into SAP ECC's general ledger via BAPI_ACC_DOCUMENT_POST. The main pull from SAP ECC happens on a business-defined cadence (daily or weekly), while Chargebee webhook push notifications arrive in real time when invoices or transactions are created, allowing SAP ECC to post GL entries on the same day the billing event occurs.

How ml-connector handles it

ml-connector maintains the on-premises agent connection to SAP ECC and also manages the Chargebee REST API credentials. It polls SAP ECC's OData endpoints or RFC_READ_TABLE on a schedule to retrieve customer and vendor master changes, maps the SAP customer number to a Chargebee external ID for matching, and upserts each customer record in Chargebee with the correct billing contact and address fields. On the inbound side, ml-connector listens for Chargebee webhook events for invoices and transactions, pulls the full GL line-item details via Chargebee's REST API, maps Chargebee's customer ID back to the SAP ECC customer number, and posts the GL entries into SAP ECC using BAPI_ACC_DOCUMENT_POST with the correct GL account and cost center. SAP ECC's write BAPIs require an explicit BAPI_TRANSACTION_COMMIT call to persist the GL entry; ml-connector includes this automatically. Because SAP ECC has a 512-character row width limit on RFC_READ_TABLE for classic versions and Chargebee rate-limits per plan tier, ml-connector batches customer syncs to stay within Chargebee's concurrent request limits and respects SAP ECC's safe throughput of 10-50 concurrent RFC calls. Chargebee invoices carry no HMAC signature, so ml-connector verifies each event by re-fetching the invoice via GET /api/v2/events/{event_id} before posting to SAP ECC.

A real-world example

A mid-market software-as-a-service company uses SAP ECC on-premises for accounting and vendor management, and Chargebee for subscription billing and revenue recognition. Before the integration, the finance team manually exported new customers from Chargebee, entered them into SAP ECC by hand, and then periodically exported Chargebee invoices to post GL entries in SAP's revenue account. Reconciliation at month end was error-prone and labor-intensive. With the integration, each new customer created in Chargebee is automatically synced to SAP ECC as a sales customer, and every Chargebee invoice is posted to the revenue GL account on the same day the customer is billed. The finance team now spends their time on analysis instead of data entry, and monthly revenue reconciliation is automated.

What you can do

  • Sync SAP ECC customer and vendor master records to Chargebee on a defined schedule using RFC/BAPI polling and OData REST.
  • Post Chargebee invoices and transactions into SAP ECC's general ledger using BAPI_ACC_DOCUMENT_POST with correct GL account mapping.
  • Map Chargebee customers back to SAP ECC customer numbers via external ID for GL line-item allocation.
  • Bridge on-premises RFC authentication and SAP Gateway OData to Chargebee's cloud REST API and webhook push notifications.
  • Respect SAP ECC's 10-50 concurrent RFC throughput limits and Chargebee's rate limits per tier, with automatic batching and retries.

Questions

Does SAP ECC require special setup to connect to Chargebee?
Yes. SAP ECC is on-premises, so ml-connector must connect via an on-premises agent running SAP .NET Connector or Java Connector. OData services in SAP Gateway must be activated by the SAP Basis team using TCODE SICF. Additionally, the RFC user account must have authorization to call the required BAPIs (BAPI_CUSTOMER_GETLIST, BAPI_CUSTOMER_GETDETAIL, BAPI_ACC_DOCUMENT_POST, BAPI_ACC_DOCUMENT_CHECK). Chargebee requires a valid API key for your site and region.
In which direction do customer and invoice records flow between SAP ECC and Chargebee?
Customer master data flows from SAP ECC into Chargebee. Each new or updated customer in SAP ECC (KNA1 and KNB1 tables) is synced to Chargebee as a billable customer on a scheduled basis. Invoice and transaction data flows the opposite direction: Chargebee invoices and payments are pulled via webhook push or scheduled polling and posted into SAP ECC's general ledger via BAPI_ACC_DOCUMENT_POST. Revenue transactions are never written back to Chargebee; the flow is read-only on the Chargebee side for financial entries.
How does ml-connector handle authentication differences between SAP ECC on-premises and Chargebee's cloud API?
ml-connector stores both credential sets encrypted. For SAP ECC, it uses HTTP Basic Auth with username and password over the on-premises agent's RFC connection, and separately authenticates to OData via SAP Gateway. For Chargebee, it uses HTTP Basic Auth with the API key as username and empty password. ml-connector presents the correct credentials to each system and manages the connection pools separately, so RFC calls to SAP ECC do not interfere with REST calls to Chargebee.

Related integrations

Connect SAP ECC and Chargebee

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

Get started