IDocs are archived in three database tables in SAP - one for the control record, one for the data records, and one for the status records.
Viewed externally (that is, as they are sent to the subsystem), the IDocs are located in three structures which correspond to the three database tables: The control records, data records and status records are also used there. A description of the individual fields can be accessed using the documentation tools in the system.
The figure below shows the basic structure of the IDocs in the SAP System (IDoc Interface viewed externally, that is, the "external structures") with some sample fields.
The parent-child structure of the segments is realized by thePSGNUM field, which contains the number of the parent segment (if applicable). In addition, the HLEVEL field also contains the hierarchy level. The actual application data, that is, the actual segment, is located in the SDATA field. This field, in turn, is subdivided into individual application fields. The maximum length of SDATA is 1000 bytes.
The SEGNUM field in the status record is used to identify segments which have caused syntax errors. SEGFLD fulfills the same function at the lowest level of the segment fields.
A segment is defined as a required segment in the IDoc type, but was not filled when the actual IDoc was generated. For this reason, the relevant IDoc does not contain this required segment - the syntax check returns an error; the missing segment is marked in the SEGNUM field.