ml-connector
SAP ECCTwilio

SAP ECC and Twilio integration

SAP ECC handles procurement, invoicing, and vendor management across your supply chain. Twilio sends SMS and email at scale. Connecting the two lets you route critical business notifications from SAP to your team via Twilio's messaging APIs. When a purchase order is created or a vendor invoice arrives in SAP ECC, ml-connector can trigger SMS confirmation to the buyer or email to finance. Payment confirmations and delivery alerts flow the same way, keeping stakeholders informed in real time without manual notification work.

How SAP ECC works

SAP ECC exposes purchase orders, vendor invoices, customers, vendors, materials, cost centers, and general ledger accounts through RFC/BAPI function modules, OData v2 REST via SAP Gateway, or SOAP web services. Authentication uses HTTP Basic Auth for OData and IDoc, or RFC Basic Auth for BAPI calls via the SAP .NET Connector or Java Connector, which must run on the customer's network as an on-premises agent. SAP ECC has no native webhook registry, so events are read via scheduled polling of tables and BAPIs like BAPI_PO_GETDETAIL1 for purchase orders, BAPI_VENDOR_GETLIST for vendors, and RFC_READ_TABLE for direct table reads. Write operations require explicit commit calls to avoid locked document state.

How Twilio works

Twilio exposes messaging capabilities through REST APIs at multiple base URLs: https://api.twilio.com/2010-04-01 for core messaging and calls, https://messaging.twilio.com/v1 for advanced messaging services, and https://verify.twilio.com/v2 for two-factor authentication. Authentication uses HTTP Basic Auth with either Account SID and Auth Token, or an API Key SID and API Secret. Twilio can push message status callbacks (sent, delivered, failed) and incoming message webhooks to a registered endpoint, and every message sent returns a SID for tracking. Webhook signature validation uses HMAC-SHA1 with the Auth Token as the key.

What moves between them

The main flow runs from SAP ECC to Twilio. ml-connector polls SAP ECC on a scheduled interval, reading new purchase orders, vendor invoices, and payment confirmations. When a business event matches a configured trigger - such as a PO creation or an invoice arrival - ml-connector extracts the relevant details (vendor name, PO number, amount, buyer email) and routes an SMS or email notification through Twilio's messaging APIs to the designated recipient. Status callbacks from Twilio flow back for audit tracking. The direction is one-way: SAP ECC to Twilio. Twilio is read-only from this perspective; ml-connector does not write back to SAP.

How ml-connector handles it

ml-connector stores both credential sets encrypted: the SAP ECC host URL, username, and password for Basic Auth OData calls, and the Twilio Account SID and Auth Token for HTTP Basic Auth to Twilio's messaging endpoints. It establishes RFC connectivity through the customer's on-premises SAP Connector agent, which must be running on the same network as the SAP system, and calls BAPI_PO_GETDETAIL1 or RFC_READ_TABLE with the requisite ABAP_AS_CODEPAGE for character encoding to fetch purchase orders and vendor data. On the Twilio side, ml-connector calls either https://api.twilio.com/2010-04-01/Accounts/{SID}/Messages or https://messaging.twilio.com/v1/Services/{ServiceSID}/Messages to send SMS or email, depending on the configured channel. When a message is sent, Twilio returns a SID; ml-connector stores this for audit and listens for status callbacks from Twilio (queued, sent, delivered, failed) to track delivery. Retries respect SAP's 10-50 concurrent RFC call throughput limit to avoid SYSTEM_FAILURE exceptions, and idempotency is maintained by deduplicating on SAP ECC's REF_DOC_NO field. Webhook signatures from Twilio are validated using HMAC-SHA1 before processing any incoming status update.

A real-world example

A mid-market manufacturing company runs SAP ECC for procurement and uses Twilio for employee communications. The procurement team receives new purchase orders in SAP each day but must manually email vendors and text buyers to confirm. With SAP ECC and Twilio connected, when a PO is created in SAP, ml-connector automatically sends an SMS to the buyer with the PO number and amount, and an email to the vendor with the order details and delivery date. Vendor invoices arriving in SAP trigger an email alert to the accounts payable team with the invoice number and amount due. The team no longer spends time on manual notification work, and vendors receive timely information, reducing follow-up calls and improving on-time payment.

What you can do

  • Send SMS and email alerts from SAP ECC purchase orders, invoices, and payments through Twilio's messaging APIs.
  • Poll SAP ECC on a scheduled interval via RFC/BAPI to detect new events and vendor documents without relying on webhooks.
  • Map SAP vendors, cost centers, and materials to Twilio messaging recipients based on configurable business rules.
  • Track message delivery status and audit every notification sent, with full replay capability on failure.
  • Validate Twilio webhook signatures using HMAC-SHA1 and handle idempotent deduplication across retries.

Questions

Which direction does data flow between SAP ECC and Twilio?
Data flows one way: from SAP ECC to Twilio. ml-connector reads purchase orders, vendor invoices, and payment confirmations from SAP, and sends SMS and email notifications through Twilio's messaging APIs. Twilio status callbacks flow back to SAP ECC for audit tracking, but no business records are written back from Twilio to SAP.
Why is an on-premises SAP Connector agent required?
SAP ECC is an on-premises system that exposes data through RFC/BAPI function modules and OData via SAP Gateway, both of which must be accessed from within the customer's network. The SAP Connector agent (SAP .NET Connector or Java Connector) must run on the customer's infrastructure to establish RFC connections to the SAP system. ml-connector calls the agent to fetch purchase orders, vendors, and documents.
How does ml-connector handle the difference between SAP's RFC polling and Twilio's webhook callbacks?
ml-connector polls SAP ECC on a scheduled interval using RFC_READ_TABLE and BAPI calls to fetch new purchase orders and invoices, since SAP ECC has no native webhook registry. Twilio delivers status updates via webhooks (message sent, delivered, failed) to a registered endpoint, which ml-connector listens on to track notification delivery and update audit logs. The two patterns work together: polling feeds events from SAP, webhooks track outcomes in Twilio.

Related integrations

Connect SAP ECC and Twilio

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

Get started