User Exits from SIS
Usually only data from the documents themselves are used for the statistical update from deliveries. If you want to use additional data for the statistical update that are not included in the documents, determine this data by using User Exits.
User Exit '001' - Enhancing data on the document header level User Exit '002' - Enhancing data on the item level
Procedure:
1. Definition of the new data as fields in the ABAP/4 Data Dictionary The fields must be incorporated into the User structures MCLIKPUSR
(document header level) and MCLIPSUSR (item level) that are provided for them.
2. Determining the new User-Exit fields Document data is made available to determine the field contents:
User Exit '001': I_XMCLIKP (all fields from the document header - structure MCLIKPB)
I_XMCVBUK (all fields from the document status - structure MCVBUKB) I_CONTROL (general updating control, for example, if a normal update or the set up is to be taken into consideration)
User Exit '002': I_XMCLIKP (all fields from the document header - structure MCLIKPB)
I_XMCVBUK (all fields from the document status - structure MCVBUKB) I_XMCLIPS (all fields from the document item - structure MCLIPSB) I_XMCVBUP (all fields from the item status - structure MCVBUPB) I_CONTROL (general updating control, for example, if a normal update
or the set up is to be taken into consideration), that is, even data from the document header is available during item processing. If more than one item is included in the document, the User Exit will then run more than once (for every item). When processing an item, no data on the other items will be available.
After determining the new field contents, they will be transferred to the update program by using the structures E_XMCLIKPUSR (User Exit '001') and E_XMCLIPSUSR (User Exit '002').
3. Field catalogs Incorporate the new fields in the field catalogs so that they can be used in the info structure definitions.
CAUTION !!! Please take note of the following situations when using this User Exit:
1. Updating when changing documents
When changing documents, the application will provide two types of data: the document data that correspond to the document status before the change and the document data after the change.
When using data before the document change, the statistical update will take back the original updated statistical data (negative posting). With the new data, the normal statistical update takes place. If additional data is determined by using User Exits, you must first
ensure that when document changes are made, this data was not changed since the last change or that the old data status can be determined. You can recognize when the old status is processed by the field SUPKZ in the structures. SUPKZ = '1' indicates that the old document data is
being processed and SUPKZ = '2' means that the new document status is available.
2. Data that is read twice
If you want to determine additional data from the customer or material master records, check to see if you cannot enhance the document data
instead. When processing documents, the master data is already read. If the document data is expanded by the additional fields that are necessary for the statistical update, they can be made available when reading the master data during document processing. User Exits in document processing are also available here. Making a second
determination in the statistical update is therefore no longer necessary. Even the problem with determining the 'old' data status (see above) no longer exists as the old field contents have already been saved in the document. 3rd usage of data from I_XMCVBAK, I_XMCVBAP
The data is only available to the item in the user exit, because each delivery item can have a different predecessor document and so there is no definitive assignment. Both order structures are often not filled for each transaction/each document type. They can also be BLANK. You therefore need to create a query and/or read the data from the
Function/Program: - EXIT_SAPLMCS5_001: SIS: User Exit for Deliveries - Header Data
- EXIT_SAPLMCS5_002: SIS: User Exit for Deliveries - Item Data
|