Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Access →  Data Consistency →  SAP LUW 

SET UPDATE TASK LOCAL

Quick Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


SET UPDATE TASK LOCAL. 

Effect

This statement switches the local update on. In the local update, high priority update function modules - registered during the current SAP LUW using CALL FUNCTION ... IN UPDATE TASK - are registered in the ABAP memory instead of the VB... database tables. In addition, it specifies that the current work process and not the update work process run these modules during the current database LUW, when the statement COMMIT WORK is executed. This statement has no effect on low-priority update function modules.

At the beginning of every SAP LUW, the local update function is deactivated. If required, it must be activated again before the first update function module is registered.

The local update is executed in a separate internal session of the current ABAP session and not in a dedicated update session.

System Fields

sy-subrc Meaning
0 The local update function is activated.
1 The local update function has not been activated, because the program has already registered at least one update function module for the normal updating procedure in the current SAP LUW.


Notes

  • The local update function performs a synchronous update after the statement COMMIT WORK, independently of the addition AND WAIT.
  • If a database rollback occurs during the local update, all previous change requests are affected.
  • The profile parameter abap/force_local_update_task can be used to set the local update centrally for an AS ABAP. This should be done with great care, however, and while respecting all updates that can take place in the system. If not, the behavior of programs not subject to local updates may change. The performance of database locks may also deteriorate.

Example

Activates local update for the subsequent registrations of update function modules using the statement CALL FUNCTION IN UPDATE TASK.

SET UPDATE TASK LOCAL. 

... 

DATA(values) = VALUE demo_update_tab( 
  ( id = 'Y' col1 = 1111 col2 = 2111 col3 = 3111 col4 = 4111 ) ). 

CALL FUNCTION 'DEMO_UPDATE_UPDATE' IN UPDATE TASK 
  EXPORTING 
    values = values. 

... 

COMMIT WORK. 

Executable Example

SAP-LUW, UPDATE TASK