Application Development and Automation 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: 
Read only

update task

Former Member
0 Likes
826

hi all,

when is it necessary to call a func mod(fm) in update task?

how is it different from calling a fm normally?

and also when do we use update mode as 'LOCAL' in a call transaction method apart from 'S' (sync) and 'A'(async).

what are the uses and requirements?

is it the same as set update task local?

i read the docmn but unable to grasp when to use these?

any answers would be greatly appreciated...

4 REPLIES 4
Read only

Former Member
0 Likes
635

Hi, if you set a function to be update task, you write some DB access statemen like delete or update, and return the function. Those DB access won't be submitted to DB, until you run COMMIT WORK. When run commit, all of update task FMs before this commit will be runned, as they are in the same LUW.

And LOCAL mode is mean that if use it, the process will be waitting, until the DB access works in LUW is finished.

If not LOCAL mode, it won't wait, and the DB access works will be runned in other seperate task.

Hope it will be helpful

Thanks a lot

Read only

Former Member
0 Likes
635

Hi,

The question is WHEN is it necessary to call a func mod(fm) in update task?

and not how?

Thanks

Dan

Read only

Former Member
0 Likes
635

Hello,

One situation in which to call an FM in update task is when you want to ensure

that any updates done in your FM are committed to the DB only if the updates in the rest of the LUW complete successfully. If you call the FM without the 'in update task' addition your changes could be commited to the database and then some other processing after that commit fails and it becomes necessary to back out your upates.

Regards

Greg Kern

Read only

Former Member
0 Likes
635

Calling a FM in Update Task is one of the bundling techniques used in ABAP to avail functionality provided by SAP Update System. Here all database updates are processed at the end of the SAP LUW in contrast to normal FM call where the database updates are done and commited at the time of call (Database LUW). It is necessary to bundle all your database updates in an SAP LUW e.g. all database updates in a transaction (like VA01) should be bundled. Almost all standard SAP transactions use bundling techniques.

This technique separates the dialog process and update process. The dialog part of the transaction can span more than one screen(one dialog step) and can be processsed by more than one dialog work process. A work process is released when the dialog step changes (screen changes) and the work process sends a database commit (called Implicit Database LUW). So with each screen change there is a database commit and database remains in consistent state.

Now when using bundling technique, when a COMMIT WORK is encountered, system ends the dialog process with a dialog work porcess and starts the update process using an update work process.

The dialog step containing the COMMIT WORK is considerd as the last dialog step of the transaction and all the update function modules are processed now in the last dialog step by the update work process though they were called earlier during the earlier dialog steps.

It is necessary to create update FMs to take advantage of this technique. The update FM is created FM by setting the Update function radiobutton in the Attributes tab in SE37.

In a normal FM call, if there are database updates (UPDATE, INSERT, MODIFY, DELETE) than database is commited after the FM processing is over as the FM starts its own Database LUW and ends it too.

SET UPDATE TASK LOCAL is same as calling a transaction using CALL TRANSACTION in LOCAL mode. Here the database updates are handled by the same dialog work process that was handling the dialog process hence the name LOCAL. System doesn't try to find a separate work process. I have not used LOCAL mode so far and really don't have any idea about the usage requirements.

Hope this helps.

Thanks

Sanjeev