Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 1 of 5

IDoc structure

10 min

Listen to this lesson

0:00 / 6:03

An IDoc (Intermediate Document) is SAP's container for a business message moving between systems: a sales order from a customer, a purchase order to a supplier, an invoice, a material master. IDocs have been part of SAP ERP for decades, and they remain one of the most used integration technologies in SAP S/4HANA on-premise and Private Edition landscapes, especially after a system conversion, which carries every existing IDoc interface across.

At Contoso Motor Co., the conversion from SAP ECC 6.0 EHP 8 to SAP S/4HANA keeps about 25 IDoc interfaces. The most important are inbound sales orders from Great Lakes Fleet Services over EDI and outbound purchase orders to Lakeside Components. Integration lead Theo and test lead Priya need every one of them retested in the quality system CMQ.

Three kinds of record

Every IDoc is made of three kinds of record. SAP's IDoc display shows them as a tree under the IDoc number:

Control record (one per IDoc)The envelope: IDoc number, direction (1 outbound, 2 inbound), message type, IDoc type, sender and receiver partner and port
Data records (one or more)The content, organized in segments such as header, partners, items and texts
Status records (one or more)The processing history: each step adds a status with date, time and message
The three record types of an IDoc. Control and status records are the same for every IDoc type; data records differ.
The Sign-Off Table · thesignofftable.com/academy/sap-int-201

The control record works like the address on an envelope. When something goes wrong with routing, for example an IDoc goes to the wrong partner profile, the control record is the first place to look. The data records hold the business content. The status records are the IDoc's diary: they tell you what happened, when and with which error. In current releases the three record types are stored in database tables EDIDC (control), EDID4 (data) and EDIDS (status); you rarely need the tables, because the display transactions present them for you.

One control record per IDoc in EDIDC, with many data records in EDID4 and many status records in EDIDS, all keyed by the IDoc number.
The Sign-Off Table · thesignofftable.com/academy/sap-int-201

Message types, IDoc types and segments

Two names describe what an IDoc contains. The message type gives the business meaning: ORDERS (purchase or sales order), ORDRSP (order confirmation), DESADV (shipping notification), INVOIC (invoice), MATMAS (material master), DEBMAS (customer master). The IDoc type (also called basic type) defines the technical structure: which segments exist, in which order and how often. ORDERS05 is a common basic type for the ORDERS message type. One message type can be linked to several basic types, usually newer versions with more fields.

TermAnswers the questionExampleWhere it is defined
Message typeWhat business message is this?ORDERSWE81, linked to IDoc types in WE82
Basic typeWhat is the technical structure?ORDERS05WE30 (IDoc type development)
ExtensionWhich customer segments were added?A Z-extension carrying Contoso's fleet contract numberWE30, combined with a basic type
SegmentWhich group of fields is this?E1EDK01 header data, E1EDKA1 partner, E1EDP01 itemWE31 (segment editor)
Message type, basic type, extension and segment. Document any IDoc type with WE60.
The Sign-Off Table · thesignofftable.com/academy/sap-int-201

Segments from SAP start with E1; customer segments usually start with Z1. Some segments are qualified: the first field says what the segment means. The partner segment E1EDKA1, for example, appears several times in an order, once with the qualifier for the sold-to party and once for the ship-to party. A mapping that puts the ship-to number under the sold-to qualifier creates a perfectly valid IDoc with the wrong customer.

The same partner segment E1EDKA1 appears twice in a Great Lakes order, and only its qualifier says which one is the sold-to and which is the ship-to.
The Sign-Off Table · thesignofftable.com/academy/sap-int-201
  1. Control recordRead direction, message type and partner: is this the IDoc you expect?
  2. Data recordsOpen header, partner and item segments: are the business values right?
  3. Status recordsRead from newest to oldest: where did processing stop and why?
  4. Linked documentFollow the link to the posted application document and check it in the app
The order to read an IDoc when you test or troubleshoot it.
The Sign-Off Table · thesignofftable.com/academy/sap-int-201

What would you do?

Maria reports that a test order from Great Lakes Fleet Services was posted for the wrong ship-to address. The IDoc is in status 53. What should Theo check first?

Key points
  • Every IDoc has one control record, one or more data records and one or more status records.
  • The message type gives business meaning (ORDERS); the basic type gives structure (ORDERS05).
  • Segments group fields; qualified segments such as E1EDKA1 depend on a qualifier for their meaning.
  • Status 53 proves an IDoc posted, not that its content was right; always check the posted document.

Check your understanding · not graded

Lesson check

  1. 1. Which record type would you check first if an IDoc went to the wrong partner?

  2. 2. What does the message type ORDERS tell you that the basic type ORDERS05 does not?

  3. 3. Why can a qualified segment cause a valid IDoc to post wrong data?