WRITE: / 'Am I triggered via PERFORM ON COMMIT?', lv_on_commit.
WRITE: / 'Current LUW Key' , lv_luw_key.
The execution result shows the fact that the normal FM call, the FM registered to COMMIT WORK and the update task all run within the same LUW, and also proves the explanation of COMMIT WORK in ABAP help: "The COMMIT WORK statement closes the current SAP LUW and opens a new one". :smile:
The WRITE keyword executed in update task will not generate any output in SE38 list, and apart from switching on "update debugging" and check the three flags in debugger, there is also another way to log the content of the variable like lv_luw_key:
Just create a new checkpoint group via tcode SAAB, specify option "Log" for Logpoints and maximum validity period.
Then append the following code in the FM implementation:
IF lv_in_update = 1.
LOG-POINT ID ZUPDATELOG SUBKEY 'Current LUW KEY' FIELDS lv_luw_key.
Now after report execution, go to tcode SAAB, click Log tab, and we can find the content of lv_luw_key which is logged by the above ABAP code LOG-POINT ID ZUPDATELOG SUBKEY 'Current LUW KEY' FIELDS lv_luw_key.