The previous steps: Configure generation of prefilled checklists
After filling the measuring point readings by a technician and finishing the checklist, the checklist data is transferred to SAP ECC/S4. The measurement reading can be retrieved and used to create new measurement documents for the relevant measuring points.
Measurement reading posting should be implemented as a customer-specific solution, using one of the following approaches:
Use Maintain the inbound checklist mapping customizing (transaction /PACG/ECM_VCLCNY - Checklists mapping customising or /PACG/ECM_VCLCNZ - New checklists mapping customising) and implement your custom logic in a Z-class created based on interface /PACG/ECM_IF_A_CHKL_MAP_PROC
Implement your custom logic in BAdI /PACG/ECM_CHECKLIST_BEF_COMMIT (method DATA_BEFORE_COMMIT), which is called when a checklist instance object is saved in the database, just before the commit.
Approach 1 - Inbound checklist mapping customizing
Transaction /PACG/ECM_VCLCNY - Checklists mapping customising or /PACG/ECM_VCLCNZ - New checklists mapping customising) can be used to maintain inbound checklist mapping.
Mapping class
Create a Z-class which will be called during inbound checklist instance processing. The class should implement interface /PACG/ECM_IF_A_CHKL_MAP_PROC (method PROCESS_DATA_BEFORE_INSERT).
Its name should be entered as ‘Class/Interface’ in the mapping customizing.
Field mapping
Create a structure (to be entered as 'Table name') with which checklist template fields will be mapped. Then maintain mapping between this structure’s fields and the checklist template’s fields the mapping in the checklist mapping customizing.
Create a measuring document
Use method PROCESS_DATA_BEFORE_INSERT of your Z-class to implement measurement reading posting. For all measuring points retrieved from the checklist instance (mapping is passed as parameter it_data), post a measuring document with method /PACG/ECM_CL_A_MEASURING_POINT=>CREATE_MEASURING_DOC_SINGLE. The following parameters should be exported to it:
Parameter | Description |
---|---|
iv_measurement_point | Measuring point |
iv_reading_date | Reading date |
iv_reading_time | Reading time |
iv_recorded_value | Recorded value |
iv_work_order_objectnr | E.g. a reference service order |
Make sure that the processing finishes with a commit.
Approach 2 - BAdI /PACG/ECM_CHECKLIST_BEF_COMMIT
BAdI /PACG/ECM_CHECKLIST_BEF_COMMIT, method DATA_BEFORE_COMMIT is called when saving a checklist instance object in the database, just before the commit. It has access to checklist data header, positions or attached objects.
The mapping between checklist template fields and a structure used for creating measurement documents should be implemented directly in the code. For all measuring points retrieved from the checklist instance, post a measuring document with method /PACG/ECM_CL_A_MEASURING_POINT=>CREATE_MEASURING_DOC_SINGLE. Make sure that the processing finishes with a commit.