ml-connector
SAP ECCUPS

SAP ECC and UPS integration

SAP ECC manages procurement and logistics for distribution and manufacturing. UPS handles the physical shipping and tracking. Connecting the two keeps your shipping operations synchronized with your ERP records. Purchase orders move from SAP ECC into UPS as shipments, tracking numbers flow back into ECC, and proof of delivery events update order status without manual intervention.

How SAP ECC works

SAP ECC exposes purchase orders, shipment headers, cost allocations, and logistics master data through RFC/BAPI function modules and OData services via SAP Gateway. The on-premises system authenticates with HTTP Basic Auth for OData and IDoc, or RFC Basic Auth for BAPI calls via an on-premises SAP .NET Connector or Java Connector agent running on the customer network. SAP ECC has no native webhook registry for outbound events, so shipment and order data are read by polling via RFC_READ_TABLE on a customer-controlled schedule. Outbound IDoc push is available but requires SAP Basis configuration in WE21 and WE20 tables.

How UPS works

UPS exposes shipment creation, rating, tracking, address validation, and pickup scheduling through a REST JSON API. Every call authenticates with OAuth 2.0 client credentials, a client secret, and an optional 6-digit UPS account number in the x-merchant-id header. Access tokens expire after approximately 4 hours and are subject to a 250-request-per-day limit on token requests. UPS can push tracking events to a registered Track Alert webhook subscription, valid for 14 days, and also supports polling via the Quantum View feed for shipment visibility. UPS has no billing or invoice API.

What moves between them

Purchase orders and shipment headers flow from SAP ECC into UPS via scheduled RFC polling. ml-connector extracts order lines with ship-to addresses, creates UPS shipments, and retrieves carrier rates and pickup appointments. Tracking numbers and shipment status events flow back into SAP ECC via BAPI callbacks, updating the purchase order headers with the UPS tracking reference and proof of delivery status. Cost allocations and general ledger postings remain in SAP ECC; UPS does not receive financial data. The sync runs on a customer-defined schedule tied to order fulfillment cycles, typically daily or on-demand.

How ml-connector handles it

ml-connector maintains the on-premises RFC agent connection to SAP ECC by storing the host, port, client number, and credentials encrypted per cell. It polls SAP ECC on a schedule using RFC_READ_TABLE to extract purchase orders with EKKO/EKPO data, handles the 512-character row width limit by chunking wide tables, and deduplicates retries by checking the REF_DOC_NO field to avoid duplicate shipment creation in UPS. On the UPS side, ml-connector refreshes the OAuth 2.0 access token every 3 hours to stay well under the expiry window and handles 429 rate-limit responses with exponential backoff. Tracking numbers and delivery events are written back to SAP ECC via BAPI_PO_CHANGE, which requires an explicit BAPI_TRANSACTION_COMMIT call to release the locked document state. Address validation is performed against UPS validation rules before shipment creation to avoid failed pickups. ml-connector tracks the 14-day Track Alert subscription lifetime and renews it automatically.

A real-world example

A regional distributor runs SAP ECC for procurement and order fulfillment, and uses UPS for outbound small-parcel shipping to hundreds of retail locations. Before integration, the logistics team exported purchase orders from SAP ECC, manually entered order lines into the UPS shipping portal, and tracked shipments separately, then re-entered tracking numbers and POD dates back into ECC by hand. This process created delays, transcription errors, and month-end reconciliation work. With SAP ECC and UPS connected, each approved purchase order automatically generates a shipment request in UPS, tracking numbers populate in ECC within minutes of carrier pickup, and POD events automatically update order status in ECC. The logistics team now focuses on exception handling rather than data re-keying, and finance can close purchase orders in ECC with proof of delivery already attached.

What you can do

  • Extract purchase orders from SAP ECC via RFC polling and create shipments in UPS with the correct ship-to addresses and weight.
  • Retrieve UPS tracking numbers and shipment status events and write them back into SAP ECC purchase order headers via BAPI.
  • Validate ship-to addresses against UPS requirements before shipment creation to prevent failed pickups.
  • Handle the 14-day Track Alert subscription lifecycle, renewing subscriptions automatically so tracking events continue to flow.
  • Bridge SAP ECC on-premises authentication and RFC agent connectivity with UPS OAuth 2.0, managing token expiry and rate limits.

Questions

How does the integration handle SAP ECC being on-premises when UPS is cloud-based?
ml-connector runs in the customer's cloud cell, which is deployed on Railway with a tunnel or VPN connection back to the on-premises SAP ECC network. The on-premises SAP .NET Connector or Java Connector agent is installed locally and handles RFC calls, while ml-connector communicates with the agent via the secure tunnel. This isolates the customer's SAP network while allowing cloud-to-cloud connectivity to UPS.
What happens if a UPS tracking number fails to write back to SAP ECC?
ml-connector tracks every write attempt in its audit log and stores the tracking number in a retry queue backed by BullMQ and Redis. If the BAPI call returns a locking error or timeout, it retries after a delay using the same REF_DOC_NO to ensure the update lands exactly once. If the purchase order is deleted in ECC before the write succeeds, the tracking event is logged and can be replayed manually.
Does the integration handle address validation and special UPS requirements like signature on delivery?
Yes. ml-connector validates every ship-to address against UPS requirements before creating a shipment, and returns validation errors so the logistics team can correct the order in ECC. For shipments that require signature, insurance, or special handling, ml-connector reads those attributes from SAP ECC cost center codes or purchase order line notes and passes them to the UPS shipment create endpoint.

Related integrations

Connect SAP ECC and UPS

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

Get started