This blog demonstrates a scenario for updating a transparent table using (PERFORM ON COMMIT) and (CALL FUNCTION IN UPDATE TASK).
The main goal is to show what is most priority and the global variables flow.
I did this test in 2008 but only now am publishing with the creation of my blog.
Create transparent table
Create the table with fields bellow:
Create the function module bellow with processing type in (update module):
Add the field parameter I_COUNTER
Put the source code in function.
Create report executable program
Create the program with the source code below:
Results of execution and Conclusion
Result in output list:
Result in table:
Looking the result above, you can note that (PERFORM ON COMMIT) is executed before the (CALL FUNCTION IN UPDATE TASK).
However, (CALL FUNCTION IN UPDATE TASK) the value parameter imported to execute the function module are those current at the time of the call.
The (PERFORM ON COMMIT) global data values takes the current at the time of the command COMMIT.
Thanks to friends Fabricio Souza and Rodrigo Ferrari that needed this theory and decided to share with you the knowledge.