Updater synchronization problem
The SAP R / 3 System uses update modules to transactionally store additional data related to master data. You can read more about this, for example, here .
For data consistency after saving, it is necessary to wait for the execution of modules of type V1. In general, this is achieved by executing the COMMIT WORK AND WAIT command.
Some standard BAPI function modules call COMMIT WORK in the text . After performing such FM, you will not be able to make sure that the saving process is complete with any simple commands. To solve this problem, some programmers write some complicated queries to the VB table or wait for unreasonable n seconds. Everything is much simpler.
SET UPDATE TASK LOCAL comes to the rescue
In short, it launches local execution mode for V1 update modules. The mode is activated for V1 update modules registered from the moment the operator is called until the moment the current DB of the LUW ends. In this case, V1 modules:
- saved in ABAP-memory, not in the VB update table;
- are executed in the current process, not in parallel;
- synchronized by the COMMIT WORK statement.
That is, when COMMIT WORK is called, the program will wait until the V1 update modules registered locally are executed. The difference is shown in the figure:
Total SET UPDATE TASK LOCAL is useful if you cannot control the COMMIT WORK statement and want to wait for all V1 modules for a process to complete.