Input (Receiving IDocs from the External System) 
Use
The following modification scenarios are possible:
The various modification options are described in the following.
After an IDoc has been received and saved, a master function module in the SAP application, which assumes responsibility for processing an IDoc, is activated. This is the first situation in which you can intervene by generating your own processing function module. You must enter this module in an ALE customizing table so that it can be called (transaction /nSALE : Inbound
® Control ® Methods (inbound). The key of the table is, in addition to the message type, also message variant and message function. This means that you can define an additional partner profile for a specific message variant and function which is specified for the IDoc in the external system. The master function modules available are assigned, as standard, to the following message types:Input master function modules
WMBBIN |
L_IDoc_INPUT_WMBBIN |
Block storage bins |
WMCATO |
L_IDoc_INPUT_WMCATO |
Cancellation TO |
WMINFO |
L_IDoc_INPUT_WMINFO |
Information |
WMINVE |
L_IDoc_INPUT_WMINVE |
System inventory records |
WMMBXY |
L_IDoc_INPUT_WMMBXY |
Goods movements |
WMSUMO |
L_IDoc_INPUT_WMSUMO |
Move storage unit |
WMTOCO |
L_IDoc_INPUT_WMTOCO |
Confirm TO |
WMTORD |
L_IDoc_INPUT_WMTORD_MULTIPLE |
Transfer orders (TO) |
WMTREQ |
L_IDoc_INPUT_WMTREQ |
Release reference number |
SDPICK |
SD_IDoc_INPUT_PICKING |
Report delivery quantities |
SDPACK |
SD_IDoc_INPUT_PACKING |
Report shipping elements |
The master function module filters the useful data for each IDoc and calls the actual processing function module in the application in a loop. A customer exit is implemented both immediately before and after this function module is called. You can use the exit after the call to update a user-defined error status or to change the set error status. You can use the exit before the call to carry out user-defined updates, for example, or to evaluate your own segments that you added to the IDoc definition. You can define your own IDoc segments in the IDoc maintenance transaction (/nWE30). Refer to the appropriate ALE group documentation.
The source code of the master function modules contain the names of the customer exits.
Make sure that no commit work is issued when generating your own function module or when using the customer exits as the function module branches back to the ALE service layer, after processing has been completed; application errors that have occurred are updated, the IDoc status is set and even rollbacks, should these be necessary, are performed here. After a commit work, it would no longer be possible to perform a rollback in the event of an error. This would result, in certain cases, in partially-posted IDocs and thus inconsistent error processing.
It should be noted that additional I/Os which take place in the customer exits can have a negative affect on performance.
If you create your own master function modules, the SAP system offers a series of general-purpose function modules for the various tasks to be performed. Refer also to the above master function modules with regard to this.
Input auxiliary function modules
L_IDoc_CONTINUE_SAVE |
Buffer application objects for follow-up actions |
L_IDoc_CREATED_OBJECTS_SAVE |
Buffer the documents generated from an IDoc |
L_IDoc_ERROR_SAVE |
Buffer IDocs in error |
L_IDoc_INPUT_REFRESH |
Initialize for processing IDocs (table refresh) |
L_IDoc_OK_SAVE |
Buffer processed IDocs |
L_IDoc_RETURN_CREATE |
Determine and generate status record of the IDocs |
L_IDoc_ROLLBACK_SAVE |
Update IDoc tables after necessary rollback |
L_IDoc_STATUS_CREATE |
Determine and generate status record of the IDoc |
L_IDoc_TIDoc_FETCH |
Display the internal table to update the status |
You can define your own IDoc (intermediate document type) in the same way as you maintain your own segments. This IDoc must be assigned to a new message type. You must maintain the partner profile for the new message type. The input tables must continue to be maintained in the transaction /uSALE. The standard task TS 0000 8049 can be used for error processing.
The following modifications can be made in the individual modification scenarios: