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

Wht is UPDATE TASK functionality in CALL FUNCTION??

Former Member
0 Likes
3,245

Hi Experts,

Pls. clarify one of my simple doubt that, Wht is the functionality of UPDATE TASK, in following sttement?

<i><b>call function 'Z_FM_1' in update task</b></i>

I found SAP help as follow, but not understood??

<i>Flags the function module func for execution in the update task. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and a subsequent COMMIT WORK then causes the function module to be executed by the update task. Update function modules must be flagged as such in the Function Builder

The return value is not set.</i>

thanq

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
1,674

Hi,

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.

Regards,

Ferry Lianto

8 REPLIES 8
Read only

ferry_lianto
Active Contributor
0 Likes
1,675

Hi,

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.

Regards,

Ferry Lianto

Read only

0 Likes
1,674

OK, thanq.

1)If the data is not written to DB:

Then Wht is sy-subrc for COMMIT WORK

in this case, Is this z_FM_1 will be called? or not?

2) How it differs from defining a FM as UPDATE FM in its attributes, while creating a FM?

thanq

Read only

0 Likes
1,674

Sy-subrc will have 4 ,then comitt work will not happen.

check the my previous reply and it is similar to LUW.

Thanks

Seshu

Read only

Former Member
0 Likes
1,674

Simple word is LUW..

Check the SAP Help :

http://help.sap.com/saphelp_nw04s/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/frameset.htm

SAP uses LUW (logical unit of work) concept, with this it basically does a sequence of steps and if all of them were successful it commits all the data to the database. During this process it keeps all the data in temporary memory. So lets say in your process you have 4 steps that complete the process, so you want to commit only when all the 4 steps are successful, in this case you will use CALL FM in UPDATE TASK for all the 4 of them, once the 4th FM is successful you use the statement COMMIT WORK to commit all the changes to the database.

Thanks

Seshu

Read only

0 Likes
1,674

thanq for simple, useful explanation.

I understood. If u provide one example(i mean, say, VA01, VL01 etc), it wuld b greate!

thanq.

Read only

ferry_lianto
Active Contributor
0 Likes
1,674

Hi,

Any error during the update, the update work process executes a database rollback and the sy-subrc <> 0.

Regards,

Ferry Lianto

Read only

0 Likes
1,674

so, I guess, this z_fm_1 will not be called!! for un successful COMMIT WORK?

Am i correct?

And wht is the differenmce btwn a Upadate attribute assigning FM and this?

thanq

Message was edited by:

Srikhar

Read only

ferry_lianto
Active Contributor
0 Likes
1,674

Hi,

It sounds like the FM was not called but it was (rollback process).

And what is the difference between an update attribute assigning FM and this?

You control the FM update process by setting the update module attribute.

- Update with immediate start

Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions can be restarted by the update task in case of errors.

- Update w. imm. start, no restart

Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions may not be restarted by the update task.

- Update with delayed start

Set this option for low priority ("V2") functions that run in their own update transactions. These functions can be restarted by the update task in case of errors.

Regards,

Ferry Lianto