ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.

SAP IDoc — Intermediate Document

SAP's pivot format. The IDoc is not a transport standard like EDIFACT or X12: it is the internal data container through which SAP sends and receives its business documents. In practice, every EDI integration with a SAP-run company ends up mapping EDIFACT or X12 to — and from — an IDoc.

What is an IDoc?

IDoc stands for Intermediate Document. It is a data structure standardised by SAP to carry a business document (order, invoice, despatch advice, material master…) between a SAP system and another system — whether SAP (via ALE, Application Link Enabling) or external (via an EDI interface).

The key point: the IDoc is independent of the transport and of the target standard. SAP always produces an IDoc; it is a separate component — the EDI subsystem (SAP Integration Suite / PI-PO, or a vendor such as SEEBURGER, Lobster, OpenText…) — that translates this IDoc into EDIFACT, X12 or another format before sending it to the partner, and the other way around on receipt.

The three records

Every IDoc consists of three record types:

RecordTableRole
Control (exactly 1)EDIDCRouting metadata: sender/receiver (logical partners), message type, IDoc type, direction (1 = outbound, 2 = inbound), port.
Data (n)EDIDDThe business content, organised into hierarchical segments (E1EDK* header, E1EDP* items…).
Status (n)EDIDSThe processing history: a sequence of timestamped status codes (03 passed to port, 53 posted, 51 error…).

Anatomy of an IDoc

An outbound ORDERS05 IDoc (purchase order) reads as a control header followed by the nested data segments:

text orders05-idoc.txt
EDI_DC40   |IDoctype=ORDERS05 |Mestype=ORDERS |Direction=1 (outbound)
           |Sender=PARTNER_SAP |Receiver=4012345500004 |Port=SUBSYS_EDI
E1EDK01    Header data: currency EUR, order number, Incoterm
E1EDK14    Organisation qualifiers (company code, division)
E1EDKA1    Partner role AG (sold-to) — GLN 5412345000013
E1EDKA1    Partner role LF (supplier) — GLN 4012345500004
E1EDP01    Item 1: quantity 240, unit PCE
  E1EDP19  Item object id: GTIN 4006381333931
  E1EDP05  Pricing conditions: EUR 2.85
E1EDP01    Item 2: quantity 120, unit PCE
  E1EDP19  Item object id: GTIN 4006381333948

Segments start with E1 followed by a mnemonic code: E1EDK01 (header, Kopf), E1EDKA1 (partner), E1EDP01 (item, Position), E1EDP19 (item identifier). The hierarchy (header → items → sub-items) is carried by segment levels, much like the segment groups of an EDIFACT message.

Message type vs basic type

Two notions not to confuse:

  • Message type — the logical nature of the document: ORDERS, INVOIC, DESADV, MATMAS.
  • Basic type / IDoc type — the versioned technical structure: ORDERS05, INVOIC02, DELVRY03. The numeric suffix is the structure version.
Message typeCommon basic typeDocument
ORDERSORDERS05Purchase / sales order
ORDRSPORDERS05Order response / confirmation
DESADVDELVRY03Despatch advice
INVOICINVOIC02Invoice / credit note
MATMASMATMAS05Material master (master data)
DEBMAS / CREMASDEBMAS06 / CREMAS04Customer / vendor master
REMADVPEXR2002Remittance advice

ALE, ports and partner profiles

IDoc flow is configured by a few key objects, handled via SAP transactions well known to integrators:

  • Partner profile (WE20) — for each partner and message type, the direction, basic type, port and processing mode.
  • Port (WE21) — the outbound channel: file (the subsystem reads a directory), tRFC (to another SAP), or XML.
  • Message control — triggers an IDoc from an application document (e.g. a created order generates an ORDERS05).
  • Monitoring (WE02 / WE05) — the IDoc list and their statuses; BD87 to reprocess, WE19 to test.

Outbound: application document → IDoc → port → EDI subsystem → EDIFACT/X12 → partner. Inbound: partner → EDIFACT/X12 → subsystem → IDoc → a posting function module that creates the document in SAP.

IDoc ↔ EDIFACT / X12

Status codes

The most common statuses (outbound 0x–4x, inbound 5x–7x):

StatusDirectionMeaning
03OutboundIDoc passed to port (handed to the subsystem).
12OutboundDispatch OK (send confirmed).
30OutboundIDoc ready, awaiting processing.
02 / 04OutboundTransfer / port error.
53InboundApplication document posted successfully.
51InboundPosting error (business data rejected).
64InboundIDoc ready to be posted.

Further reading