Modification Concepts: IDoc
Inbound Processing
The following modification scenarios are available:
● You use the standard IDoc but want to define the processing yourself.
You create a user-defined processing module, which you copy from the standard function module for the respective message type and adjust accordingly.
● You use the standard IDoc but want to adjust the standard IDoc processing. That is to say, you want to modify error processing or want to interpret the contents of the IDocs to suit your individual needs.
You implement the Business Add-In (BAdI) in the standard function module:
○ If you want to influence error processing, you implement the BAdI /SCWM/WMIDOC with the method Error_Inbound.
○ If you want to influence IDoc processing, you implement the BAdI /SCWM/WMIDOC with the following methods:
■ WMTORD_INBOUND
■ WMTOCO_INBOUND
■ WMCATO_INBOUND
■ WMSUMO_INBOUND
■ WMBBIN_INBOUND
For more information about the BAdI methods, see BAdI Methods for the Interface.
● You use a modified IDoc with user-defined segments and want to execute a particular process for the data from these segments.
In the standard IDoc, you define your own IDoc segments and use the BAdI /SCWM/WMIDOC with the method Error_Inbound to process the data from your own segments.
● You use a modified IDoc with customized segments and want to define IDoc processing yourself.
You define customized IDoc segments in the standard IDoc and create a customized processing function module.
● You use a user-defined IDoc with a new message type and have to implement processing of the IDoc on your own.
You define a user-defined IDoc and create a user-defined processing function module. When you create the function module, you can use the standard auxiliary function modules.
As soon as the SAP system has received the IDoc and saved it, the system calls a main function module of the application, which takes over the processing of the IDoc.
At this point, you have the first opportunity to intervene in the IDoc processing, by creating a user-defined function module.
You enter this function module from the SAP Easy Accessscreen under Tools → ALE → ALE Development → IDoc → Inbound Processing → Function Module → Assign IDoc Type and Message Type.
There, you can also enter an additional partner profile for a certain message variant or message function from the external system to differentiate processing in the SAP system.
Main function modules for inbound IDoc processing
Message type |
Function module |
Use |
/SCWM/WMBBIN |
/SCWM/IDOC_INPUT_WMBBIN |
Block storage bins |
/SCWM/WMCATO |
/SCWM/IDOC_INPUT_WMCATO |
Cancel TW |
/SCWM/WMSUMO |
/SCWM/IDOC_INPUT_WMSUMO |
Move Handling Unit |
/SCWM/WMTOCO |
/SCWM/IDOC_INPUT_WMTOCO |
Confirm TW |
/SCWM/WMTORD |
/SCWM/IDOC_INPUT_WMTORD_MULTIPLE |
Warehouse tasks (WT) |
The main function module filters out the data for each IDoc and calls the actual processing function module of the application in a loop.
A BAdI method is implemented both before and after each call of the function module:
● You can use the BAdI method after the function module call to update your own error status or to change the error status already set.
● You can use the BAdI method before the function module call, for example, to perform your own updates or to evaluate your own segments (that you have added in the IDoc definition).

You can find the name of the BAdI method in the source code for the main function module.
If you create your own function module or BAdIs, make sure that you do not set any COMMIT WORK statements, as these can cause errors during IDoc processing and inconsistencies during error processing. The system returns to the ALE layer following processing, where the system updates any application errors that have occured, sets the IDoc status, and may even execute database rollbacks.

Note that additional I/Os in the BAdIs can reduce performance.
You define your own
IDoc segments from the SAP Easy Access screen, by choosing Tools → ALE → ALE Development → IDoc → IDoc Type Development → IDoc Types. For more information, see
Segment
Editor.
The SAP system offers function modules for general use for the following tasks for using user-defined main function modules:
Auxiliary function modules for inbound IDoc processing
Function module |
Task |
/SCWM/IDOC_CREATED_OBJECTS_SAVE |
Continuously save the documents created from an IDoc |
/SCWM/IDOC_ERROR_SAVE |
Continuously save IDocs with errors |
/SCWM/IDOC_INPUT_REFRESH |
Initialization for IDoc processing (table refresh) |
/SCWM/IDOC_OK_SAVE |
Continuously save processed IDocs |
/SCWM/IDOC_RETURN_CREATE |
Determine and construct status record for the IDoc |
/SCWM/IDOC_ROLLBACK_SAVE |
Update IDoc tables after necessary rollback |
/SCWM/IDOC_STATUS_CREATE |
Determine and construct status record for the IDoc |
/SCWM/IDOC_TIDOC_FETCH |
Fetch internal table for the purpose of status update |
If you define your
own IDocs (intermediate structure), you assign this IDoc to a new message
type. To do this, on the SAP
Easy
Access screen, choose
Tools → ALE → ALE Development → IDoc IDoc Type Development → IDoc Types.
For more information,
see
Defining New IDoc
Types.
You create a partner profile for this message type.
You define the tables for inbound processing for this IDoc under Tools → ALE → ALE Development → IDoc → Inbound Processing.
Standard task TS00008099 is available for error processing.