IDoc
ABAP DevelopmentBeginner

IDoc Structure: Control, Data and Status Records

Understand the basic structure of an IDoc and how SAP stores control, data and status information.

Explanation

An IDoc has three main parts: control record, data records and status records. The control record stores header-level technical information such as IDoc number, message type, basic type, sender, receiver, partner and direction. Data records contain actual business data in segments. Status records show what happened to the IDoc during processing. In production support, this structure is the starting point for every IDoc issue. If an invoice IDoc fails, you should first check control details, then segment data, then status messages.

Code example

ABAP Code
* Purpose:* Read basic IDoc records for analysis.* EDIDC = control record, EDID4 = data records, EDIDS = status records. DATA lv_docnum TYPE edidc-docnum.DATA ls_control TYPE edidc.DATA lt_data TYPE TABLE OF edid4.DATA lt_status TYPE TABLE OF edids. lv_docnum = '0000000000123456'. * Step 1: Read control record to understand message type, direction and partnerSELECT SINGLE * FROM edidc INTO @ls_control WHERE docnum = @lv_docnum. * Step 2: Read segment data to understand actual business payloadSELECT * FROM edid4 INTO TABLE @lt_data WHERE docnum = @lv_docnum. * Step 3: Read status history to understand processing resultSELECT * FROM edids INTO TABLE @lt_status WHERE docnum = @lv_docnum ORDER BY countr. * Support tip:* Do not rely only on final status. Always inspect segment data and status details.

Real project scenario

An inbound ORDERS IDoc failed because the sold-to party segment had an incorrect customer number. WE02 showed status 51, but the root cause was visible only after checking the relevant E1EDKA1 segment.

Common mistakes

- Checking only final status. - Ignoring control record partner details. - Not checking segment hierarchy. - Not reading status message long text.

Best practices

- Start IDoc analysis from control record. - Check data records for business payload. - Read complete status history. - Use WE02 or WE05 before custom table checks.

Interview angle

A beginner should explain EDIDC, EDID4 and EDIDS. Experienced candidates should explain how these records help in debugging.