SAP IDOC Structure Introduction

IDOC type and IDOC. An Intermediate Document (IDOC) type represents the structure of the data associated with a message type (DEBMAS02 for message type DEBMAS — Customer Master, and WMMBID02 for message type WMMBXY— Goods Movements), while an IDOC is an object containing the data of a particular message type. IDOCs are data containers with intelligence built in. Each IDOC contains one and only one business object. For example, an IDOC of type SHPMNT01, message type SHPMNT, will contain data only of one Shipment Document. Generally, the architecture of an IDOC is independent of the message type by virtue of ALE’s ability to redefine it for any message type.

An IDOC consists of three record types: the control record, the data record, and the status record (see Figure 1).

Figure 1 Structure of an IDOC.

• The control record, or EDI_DC, is a control structure that contains several fields with information about the IDOC, such as what IDOC type it is, the message type, sender and receiver information, and direction (1 for outbound, 2 for inbound). This information provides control data on the outbound, and processing options on an inbound IDOC. It also has as its key the Client (MANDT) and the IDOC number (DOCNUM). The EDI_DC record of an IDOC is stored in table EDIDC. Every IDOC has one control record.

• The data record, which conforms to the structure EDI_DD, contains the application data. Every EDI_DD record has a key portion that is 55 bytes in length (or 63, depending on the SAP release), which consists of several fields describing the content of the record. The key of 55/63 bytes is followed by a field SDATA, which is 1000 bytes in length and of data type Long Character. The SDATA field holds the application data, and its structure is determined by the key field SEGNAM (Segment Name). An IDOC consists of one or more data records, and its sequence and structure are dictated by the sequence and structure of segments in a given IDOC type. The SDATA portion of the data record is redefined for every occurrence based on the structure of the segment, with the first 55/63 bytes of the data record identifying the segment name, sequence, and hierarchy. In an outbound interface, ALE/EDI function modules populate these segments with application data. In an inbound interface, the application modules process the data contained in the segments. Data records are stored on table EDID2 that belongs to the cluster EDI30C.
Tag Cloud

Large format color printing
Lg usb modem driver
Dell laptop lid
Epson stylus printer
Laptop for kids
Epson stylus printers
Laptops dell 1525

In SAP, from a Data Dictionary perspective, IDOC segments adhere to a naming convention. Each segment has three components, each marked by a different prefix —E1 for segment type, E2 for segment definition, and E3 for segment documentation. For example, the first segment of IDOC type DEBMAS02 is E1KNA1M. Its definition is contained in structure E2KNA1M, and its documentation is in E3KNA1M. When the IDOC is externalized, we see the segment name addressed by its E2 prefix. For all practical purposes, we will use only the E2 prefix when referring to IDOC segments. Also, most segment names represent Data Dictionary tables.

• The status record conforms to the dictionary structure EDI_DS. It contains information on the state of the IDOC as it passes through the various stages of processing. The STATUS field has a length of two bytes (data type CHAR), with a range of values: 01–41 for outbound and 50–73 for inbound IDOCs. The status record also includes date and timestamps for when that particular state was reached. The status records maintain a history of the IDOC states. An IDOC may have one or more status records, which are stored in table EDIDS (see Figure 2, page 82). These records can be accessed or created only by SAP function modules (APIs), and are not externalized.

Figure 2 the IDOC database.

IDOC objects consist of a Basic IDOC type, an Extension type, and an IDOC type.

In an R/3 system, IDOCs are identified by a unique IDOC number (field DOCNUM), and all three record types are tied together with this number. The IDOC number is internally assigned by SAP. It is possible to maintain the number range of IDOCs.

You can display information about IDOC record types by executing transaction WE61 or using the following menu path from the main R/3 menu: Tools -> Administration -> Administration -> Process Technology -> IDOC -> IDOC Basis (*) -> Documentation -> IDOC Record Types. You can reach IDOC Basis (*) by executing transaction WEDI, which is frequently used in ALE and EDI. You can display information about IDOC types, such as DEBMAS02 and INVOIC01 by executing transaction WE60 or using the following menu path from WEDI: Documentation -> IDOC types.

More References