Entering content frame

Procedure documentation IDoc Processing Locate the document in its SAP Library structure

The function module should carry out the following steps:

·        Check that the IDoc contains the correct message type (field Idoc_Contrl-Mestyp). If it does not, raise the exception Wrong_Function_Called with an appropriate message.

¡        When implementing an inbound function module for master data that can be "reduced" by customers, don’t check the message type; check the basic IDoc type instead (field Idoc_Contrl-Idoctp) Initialize/refresh any global variables and/or tables.

·        Initialize/update all global variables or tables. The inbound function module can be called up more than once by a process. The global variables are therefore filled with values the second time.

·        Convert the character data in table Idoc_Data to internal format in internal tables. See the example coding below to see how to do this. Special attention must be paid to fields containing:

¡        Units of measure (ISO code in IDoc)

¡        Currency codes (ISO code in IDoc)

¡        Country codes (ISO code in IDoc)

¡        Shipping instructions (ISO code in IDoc)

¡        Monetary amounts (conversion factor needed)

¡        Dates and times (see below)

During processing of inbound function modules, date and time fields can lead to errors if the field in the IDoc is empty: If an empty character field is entered in the date field in ABAP, the date field remains empty instead of initial (only zeros). This is an Invalid value for the date field. Errors will occur in subsequent processing whenever the field is checked for an initial value "if DateField is initial..." To avoid this, clear the date field if the IDoc field is empty, as shown in the example code.

 

Caution

Note that the function module should not do a Commit Work.

If you have the choice, don’t update the database using Call Function "xxx" In Update Task - it is unnecessary for ALE inbound processing, and only increases database load.

 

 

 

Leaving content frame