Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SET UPDATE TASK LOCAL.

Former Member
0 Kudos

can anyone expalin the meaning of the following statments

SET UPDATE TASK LOCAL.

DATA: lv_vbeln TYPE lips-vbeln,

lv_lfimg TYPE lips-lfimg,

lv_lfdat TYPE dats,

lv_traty TYPE likp-traty,

lv_traid TYPE likp-traid,

lv_blank_log TYPE flag.

init.

8 REPLIES 8

former_member188685
Active Contributor
0 Kudos

Read the SAP help on

SET UPDATE TASK LOCAL

It is easy to understand and you get lot of explanation.

Former Member
0 Kudos

Former Member
0 Kudos

Hi

Local Update

In a local update, the update program is run by the same work process that processed the request. The dialog user has to wait for the update to finish before entering further data. This kind of update is useful when you want to reduce the amount of access to the database. The disadvantage of local updates is their parallel nature. The updates can be processed by many different work processes, unlike asynchronous or synchronous update, where the update is serialized due to the fact that there are fewer update work processes (and maybe only one).

You switch to local update using the ABAP statement SET UPDATE TASK LOCAL. This statement sets a u201Clocal update switchu201D. When it is set, the system interprets CALL FUNCTION ...IN UPDATE TASK as a request for local update. The update is processed in the same work process as the dialog step containing the COMMIT WORK. The transaction waits for the update to finish before continuing.

As an example, suppose you have a program that uses asynchronous update that you normally run in dialog mode. However, this time you want to run it in the background. Since the system response time is irrelevant when you are running the program in the background, and you only want the program to continue processing when the update has actually finished, you can set the SET UPDATE TASK LOCALswitch in the program. You can then use a system variable to check at runtime whether the program is currently running in the background.

By default, the local update switch is not set, and it is reset after each COMMIT WORK or ROLLBACK WORK. You therefore need to include a SET UPDATE TASK LOCAL statement at the beginning of each SAP LUW.

If you reset data within the local update, the ROLLBACK WORK statement applies to both the dialog and the update part of the transaction, since no new SAP LUW is started for the update.

Hope this will help.

Kindly Reward points if helps

ian_maxwell2
Active Participant
0 Kudos

> can anyone expalin the meaning of the following statments

> SET UPDATE TASK LOCAL.

Executing the Set Update Task Local command will cause update tasks for the current transaction to be executed in the current process as opposed to being put in queue and passed to one of the V1 update processes.

Any function that is called with "In Update Task" is not actually executed until an explicit Commit Work is executed. Usually these functions are executed in a seperate process aysnchrnous to the main process (The queue can be viewed via transaction SM13). Update tasks are usefull for creating a LUW (Logical Unit of Work) that can span many implicit commits related to processes rolling in and out. They also allow for updates to be asynchrnous to the user on the front-end.

A couple things to take note of:

1) With local update tasks, the statements "Commit Work" and "Commit Work And Wait" are equivalent becuase the execution of the udpate tasks will always be synchrnous.

2) After a commit or a rollback is executed you must re-execute the Set Update Taks Local command if you wish for the next transaction to also be local.

3) The local update task setting has no effect on SQL updates to the DB that are not contained in an update task function

An example where local update tasks are used is in the ALE framework where the framework executes this command prior to calling an IDoc processing function.

~Ian

Former Member
0 Kudos

The dialog user has to wait for the update to finish before entering further data. This kind of update is useful when you want to reduce the amount of access to the database. The disadvantage of local updates is their parallel nature. The updates can be processed by many different work processes, unlike asynchronous or synchronous update, where the update is serialized due to the fact that there are fewer update work processes (and maybe only one).

You switch to local update using the ABAP statement SET UPDATE TASK LOCAL. This statement sets a u201Clocal update switchu201D. When it is set, the system interprets CALL FUNCTION ...IN UPDATE TASK as a request for local update. The update is processed in the same work process as the dialog step containing the COMMIT WORK. The transaction waits for the update to finish before continuing.

As an example, suppose you have a program that uses asynchronous update that you normally run in dialog mode. However, this time you want to run it in the background. Since the system response time is irrelevant when you are running the program in the background, and you only want the program to continue processing when the update has actually finished, you can set the SET UPDATE TASK LOCALswitch in the program. You can then use a system variable to check at runtime whether the program is currently running in the background.

By default, the local update switch is not set, and it is reset after each COMMIT WORK or ROLLBACK WORK. You therefore need to include a SET UPDATE TASK LOCAL statement at the beginning of each SAP LUW.

If you reset data within the local update, the ROLLBACK WORK statement applies to both the dialog and the update part of the transaction, since no new SAP LUW is started for the update.

Former Member
0 Kudos

Hi Tummala Swapna.

I would like to suggest a couple of references,

[SAP HELP - Standard Reference for Local Update - SET UPDATE TASK LOCAL|http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4d7a79e11d1950f0000e82de14a/content.htm]

[SAP HELP - Standard Reference for Persistent Objects and COMMIT WORK - SET UPDATE TASK LOCAL|http://help.sap.com/saphelp_nw04/helpdata/en/d2/7849b8bec911d4b2e80050dadfb92b/content.htm]

[SAP HELP - Standard Reference for Using CALL TRANSACTION USING for Data Transfer - SET UPDATE TASK LOCAL|http://help.sap.com/saphelp_nw04/helpdata/en/fa/09715a543b11d1898e0000e8322d00/content.htm]

Hope that's usefull.

Good Luck & Regards.

Harsh Dave

Former Member
0 Kudos

THANKYOU

0 Kudos

This message was moderated.