A customer extension in the coding of the inbound function module which maintains the application tables with data from the extension segments relates to the extension segments.
You must have completed the required steps inExtending an IDoc Type .
The customer extension to the corresponding function modules is written using transaction CMOD. You proceed in a similar way as toOutbound processing.
In the example, extend the function module IDOC_INPUT_ORDERS in the additional project ZEDA0001. The extension writes the value from the segment field Z1TEST1-KONTINENT in the field IHREZ (customer character) of structure XVBAK. The contents of this structure are used in the structure of batch input table BDCDATA, which transfers transaction VA01 (create standard order).
IHREZ is already supplied from field E1EDKA1-IHREZ of the basic type ORDERS01, therefore an extension here is not necessary at all. The example should just be used as an illustration of the principle.
EXIT_SAPLVEDA_001 (Customer extension of data segments for inbound order document)
Customer Top Include
The source text appears as follows:
DATA: BEGIN OF hxvbak.
INCLUDE STRUCTURE vbak.
DATA END OF hxvbak.
segnam = segment-segnam.
"Name of customer segment
z1test1 = segment-sdata. "Data receives structure
hxvbak-ihrez = z1test1-continent. "Fill help structure
MOVE hxvbak TO dxvbak. "supply CHANGING-Parameter
The CASE instruction in the source text is essential because the same customer exit is called for each segment in the function moduleIDOC_OUTPUT_ORDERS . For this reason, the new include must first determine whether the call came from the correct parent segment.