Entering content frameProcedure documentation Example of Processing an IDoc Locate the document in its SAP Library structure

The Example Program to Process an IDoc shows how the fictitious message type XAMPLE, communicated 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

Description

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

Description

Type in e1xitem

Type in xitem

Item_no

Item number

CHAR

NUMC

Materialid

Material number

CHAR

CHAR

Descript

Material description

CHAR

CHAR

Unit

Unit of measure

CHAR

UNIT

Quantity

Quantity

CHAR

QUAN

Value

Value

CHAR

CURR

Ship_Inst

Shipping instructions

CHAR

UNIT

The data on the database is assigned a new document number (field DOCMNT_NO) using number assignment. The field DOCMNT_NO is not stored in the newly created table XHEAD.

 

 

 

 

Leaving content frame