Integration Patterns in SAP

Forget marketing slides. Here are the real integration patterns you’ll deal with in SAP, how they map to technologies (IDoc, RFC, SOAP, OData, Events), and when to use what. Practical O2C examples included.

Patterns at a Glance

Use this page to quickly decide between API, IDoc, and Events, and whether you need sync (request/response) or async (message/event) flow.

1) Point-to-Point (Direct Invocation)

SAP Tech: RFC, SOAP services, direct OData/REST calls. When used: fast, cheap, 1:1 integration for a single consumer with tight coupling; good for simple or short‑lived scenarios.

O2C Example: Sales Order creation triggers an RFC call to an external credit check system. Works fine until you have 5 partners and each needs a slightly different API.

Pros
  • Simple setup — no mediator.
  • Lowest latency for request → reply.
  • Good for one consumer or a spike/POC.
Cons
  • N connections over time → spaghetti.
  • Each new consumer = new interface variant.
  • Tight coupling; difficult to govern and monitor.

2) Hub‑and‑Spoke (Mediated Integration)

SAP Tech: SAP PI/PO, SAP Cloud Integration (CPI), SAP Integration Suite. Pattern: systems publish/consume via a central mediator that handles mapping, routing, and errors.

O2C Example: Sales Order in S/4HANA generates an IDoc (ORDERS05); CPI transforms and routes it to CRM, 3PL, and Billing — one source → many consumers without spaghetti.

Why it works
  • Each system connects once (governed contracts).
  • Central mapping, transformation, and error handling.
  • End‑to‑end monitoring and retries in one place.
Weakness
  • Hub can become a bottleneck without sizing.
  • Needs governance to avoid “everything through CPI” anti‑pattern.
ORDERS05 via CPI to multiple targets

3) Event‑Driven (Publish/Subscribe)

SAP Tech: SAP Event Mesh, SAP Integration Suite — Advanced Event Mesh. Pattern: producer emits an event; broker distributes to all subscribers (loose coupling; add consumers without upstream change).

O2C Example: SalesOrder.Created is published from S/4HANA; Logistics, CRM, and Finance subscribe in parallel. Tomorrow Data Lake subscribes too — with zero change to SD.

Why it rocks
  • Loose coupling — producers don’t know consumers.
  • New consumers can subscribe with zero upstream change.
  • Great for real‑time, scalable multi‑consumer flows.
Watch‑outs
  • Lifecycle & versioning of event schemas.
  • Topic design, governance, and consumer lag.
SalesOrder.Created fan‑out

Learn More

4) Synchronous vs Asynchronous

Two timing models: request/reply for immediate answers (pricing, ATP, credit) vs message/event for decoupled flows that can wait in a queue. If the target is down, async buffers; sync blocks.

👉 Rule: Validate = sync. Notify = async.
AspectSynchronous (Req/Reply)Asynchronous (Message/Event)Best
TechRFC, SOAP, OData/RESTIDoc, Event Mesh/AEM
UseImmediate validation (ATP, pricing, credit)Loosely coupled distribution (SO, delivery, invoice)
ResilienceCaller blocks if callee is downQueue/broker buffers; process continues
LatencyLowestVaries; consumer‑paced

5) Pub/Sub vs Streaming

Pub/Sub pushes ephemeral events to subscribers for real‑time triggers. Streaming keeps an append‑only log for replay and backfills; consumers read at their own pace (Kafka/AEM streaming).

👉 Pub/Sub = triggers. Streaming = history & replay.
AspectPub/SubStreaming (Event Log)Best
DeliveryPush to subscribers; fire‑and‑forgetAppend to log; consumers read at own pace
HistoryTypically ephemeralReplayable history
Good forReal‑time triggers (order notifications)Analytics, recovery, ML
TechEvent Mesh / AEMKafka / AEM streaming

6) Choosing Between API, IDoc, and Event

Quick chooser for SAP interfaces. Match the job: APIs for validations, IDocs for bulk/legacy transfers, Events for real‑time fan‑out and scale.

Pick the tool that matches coupling, timing, and consumers.
PatternSAP TechWhen to UseO2C Example
API (REST/OData, SOAP, RFC)RFC, OData, SOAP, BAPIRequest/response, synchronous validationATP check during Sales Order creation
IDoc (ALE, Middleware)ORDERS, DELVRY, INVOICBulk transfer, batch sync, legacy ECC ↔ EWMDistribute Sales Orders to 3PL via IDoc
Events (Pub/Sub)Event Mesh, AEMReal‑time, multi‑consumer, scalableSalesOrder.Created → CRM, Billing, Logistics in parallel