We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!
This function module is a user exit within the framework of inbound IDoc processing involving contracts.
Via the call of the function module, customers are offered the option of creating their own batch input session for posting contracts. This may be the case, for example, if a different screen control is desired during processing of the batch input session than is provided in the standard system.
The function module is called after the analysis of the IDoc data and filling of the application structures. IDoc data (control record IDOC_CONTROL and the data records IDOC_DATA) is passed on. You can tell by the message category (field IDOC_CONTROL-MESTYP) whether a newly created document (message category BLAORD) or a change to an existing contract (message category BLAOCH) is involved.
The field string EKKO_DATA contains the data on the document header. Table EKPO_DATA contains data on document items.
In the function module, users can create their own batch input session on the basis of the data passed on (table BDC_DATA).
If a customer's own batch input session is created, the parameter SUBRC must be set to '2', so that the standard creation of the batch input session is not processed by the SAP program.
If an error occurs in the creation of the batch input session, so that no further processing is possible, the parameter SUBRC must be set to '4'. In the field string ERROR_MESSAGE, the error message should be passed on. In this case, error handling is triggered for the IDoc.