EDI knowledge base & standards > IDOC

About IDOC

IDoc or Intermediate Document is a standard data structure for electronic data interchange (EDI) between SAP application programs or between a SAP application and an external program. IDocs serve as the vehicle for data transfer in SAP's Application Link Enabling (ALE) system and are used for asynchronous transactions: each IDoc generated exists as a self-contained text file that can then be transmitted to the requesting workstation without connecting to the central database.

Documents

IDocs have two levels, the technical level and the business level. IDoc documentation can be extracted from SAP by executing the WE60 transaction.

  1. Technical level - Defined by the three record types compatible with the IDoc interface:
    1. Control record
    2. Data record
    3. Status record
  2. Business level - Defined by the segments of an IDOC.

Example of IDOC structure

BEGIN_RECORD_SECTION
  BEGIN_CONTROL_RECORD
    BEGIN_FIELDS
    NAMETABNAM
    TEXTName of table structure
    TYPECHARACTER
    LENGTH000010
    FIELD_POS0001
    CHARACTER_FIRST000001
    CHARACTER_LAST000010
    .
    .
    .
    END_FIELDS
  END_CONTROL_RECORD
  BEGIN_DATA_RECORD
    BEGIN_FIELDS
    NAMESEGNAM
    TEXTSegment (external name)
    TYPECHARACTER
    LENGTH000030
    FIELD_POS0001
    CHARACTER_FIRST000001
    CHARACTER_LAST000030
    .
    .
    .
    END_FIELDS
  END_DATA_RECORD
  BEGIN_STATUS_RECORD
    BEGIN_FIELDS
    NAMETABNAM
    TEXTName of table structure
    TYPECHARACTER
    LENGTH000010
    FIELD_POS0001
    CHARACTER_FIRST000001
    CHARACTER_LAST000010
    .
    .
    .
    END_FIELDS
  END_STATUS_RECORD
END_RECORD_SECTION
BEGIN_SEGMENT_SECTION
  BEGIN_IDOCORDERS03
    BEGIN_SEGMENTE2EDK01005
      SEGMENTTYPEE1EDK01
      LEVEL01
      STATUSMANDATORY
      LOOPMIN0000000001
      LOOPMAX0000000001
      BEGIN_FIELDS
      NAMEACTION
      TEXTAction code for the whole EDI message
      TYPECHARACTER
      LENGTH000003
      FIELD_POS0001
      CHARACTER_FIRST000064
      CHARACTER_LAST000066
      NAMEKZABS
      TEXTFlag: order acknowledgment required
      TYPECHARACTER
      LENGTH000001
      FIELD_POS0002
      CHARACTER_FIRST000067
      CHARACTER_LAST000067
      .
      .
      .
      END_FIELDS
    END_SEGMENT
  END_IDOC
END_SEGMENT_SECTION

IDoc Transactions

The table bellow contains some of the IDOC transactions and their EDIFACT and X12 equivalent messages.

X12

EDIFACT

IDOC

850

ORDERS

ORDERS01, ORDERS02, ORDERS03, ORDERS04, ORDERS05

855

ORDRSP

ORDERS01, ORDERS02, ORDERS03, ORDERS04, ORDERS05

810

INVOIC

INVOIC01

832

PRICAT

PRICAT01

856

DESADV

DELVRY01, DELVRY02, DELVRY03