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: 

Call function module in backgrouns task and in update task

Former Member
0 Kudos

Hi Gurus,Pls crear me on the " <b>Call function module in backgrouns task and in update task</b>".

how it works and waht is the link with LUW releated to these .

also heard that commit work statement aslo linked with this.

Pls clarfiy me with expalnation of code.

1 ACCEPTED SOLUTION

Pawan_Kesari
Active Contributor
0 Kudos

To my best knowledge..

1. IN UPDATE TASK

When FM is called with this extension then call to the FM is not made until COMMIT WORK is executed. This flags the function module for later execution when implicit or explicit COMMIT WORK is executed.

2. IN BACKGROUND TASK

Same as IN UPDATE TASK with addition that FM is called in another work process. Here you can also specify the DESTINATION so that this function module may execute in different system sepcified .

2 REPLIES 2

Pawan_Kesari
Active Contributor
0 Kudos

To my best knowledge..

1. IN UPDATE TASK

When FM is called with this extension then call to the FM is not made until COMMIT WORK is executed. This flags the function module for later execution when implicit or explicit COMMIT WORK is executed.

2. IN BACKGROUND TASK

Same as IN UPDATE TASK with addition that FM is called in another work process. Here you can also specify the DESTINATION so that this function module may execute in different system sepcified .

Clemenss
Active Contributor
0 Kudos

Hi sridhar,

the explanation already given is correct and good. Small add-on:

All functions called during one LUW with addition IN UPDATE TASK are stored together with their actual parameters in a temporary memory area. The moment a COMMIT WORK is issued, the functions are released to be executed by a so-called update task which is running in the background. This explains why functions called in update task never return anything, no SY-SUBRC and no export or table parameters If a function called in update task raises an exception or runs into an error the calling user will get an express message informing about this. Also, all database updates done by this update process are rolled back to keep consistency.

This proceeding helps to keep database tables consistent and allows the user to keep on doing his work before all database updates are complete. You may have seen messages like "material will be changed" after saving. If you open the same material immediately, you'll get a message "object locked by...<yourself>". This means the update task is still running.

Regards,

Clemens