The Example Program for Processing an IDoc shows how the fictitious message type XAMPLE, which was passed with IDocs of type XAMPLE01, is processed using the inbound function module IDOC_INPUT_XAMPLE. The IDoc type has a header segment, E1xhead, and any number of item segments E1xitem. The data from the IDoc is written to two database tables, XHEAD and XITEM respectively. XHEAD and XITEM contain the same field names as E1xhead and E1xitem respectively. The fields names and data types are shown in the following two tables:
Field Name in XHEAD |
Meaning |
Type in e1xhead |
Type in XHEAD |
Docmnt_no |
Document number |
CHAR |
NUMC |
Date |
Date |
CHAR |
DATS |
Currency |
Currency |
CHAR |
CUKY |
Country |
Country |
CHAR |
CHAR |
Field Name in XITEM |
Meaning |
Type in e1xitem |
Type in xitem |
Item_no |
Item number |
CHAR |
NUMC |
Materialid |
Material number |
CHAR |
CHAR |
Descript |
Material description |
CHAR |
CHAR |
Unit |
Measurement unit |
CHAR |
UNIT |
Quantity |
Amount |
CHAR |
QUAN |
Value |
Value |
CHAR |
CURR |
Ship_Inst |
Shipping instructions |
CHAR |
UNIT |
The data in the database is assigned a new document number (field DOCMNT_NO) by means of number assignment. The field DOCMNT_NO is not stored in the newly created table XHEAD.