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 inside update task

0 Likes
4,627

When you are in a V1 update task and you call another function module in update task, is it just registered until the commit triggers it or is it executed immediately ? does it make a difference if the called function is V1 or V2 in this case ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,466

Hi Wagner,

            i tested the scenario myself and found out that update function module inside update function module just register the inside FM again and execute it on next commit.now coming to your second question, V1 and V2 are two different types of update function module.V1 has top most priority while execution. Inside FM if you select start immediately radio button it is V1 and if you select start delay or without restart it is a V2 update

in short again i can tell when control executes commit work, all the FM in update task starts execution in the sequence ( V1 first and V2 ).

Regards

Animesh Sundriyal

14 REPLIES 14
Read only

Former Member
0 Likes
3,466

Entries are stored in VBLOG table in the order of occurance and are excuted when commit work is triggered.they are executed in order of Occurances.

Read only

uppu_narayan
Active Participant
0 Likes
3,466

Hi wagner,

      Function module are registered when update function module  in update task is encountered and is executed only when commit work is triggered.

      The use of V1 and V2 depends on what data you are updating.....the following link explains it superbly...

http://help.sap.com/saphelp_nw70ehp2/helpdata/en/23/e9aa61638e404d81575e939b5cd847/content.htm?frame...

regards,

narayan

Read only

Former Member
0 Likes
3,467

Hi Wagner,

            i tested the scenario myself and found out that update function module inside update function module just register the inside FM again and execute it on next commit.now coming to your second question, V1 and V2 are two different types of update function module.V1 has top most priority while execution. Inside FM if you select start immediately radio button it is V1 and if you select start delay or without restart it is a V2 update

in short again i can tell when control executes commit work, all the FM in update task starts execution in the sequence ( V1 first and V2 ).

Regards

Animesh Sundriyal

Read only

0 Likes
3,466

Hi Animesh

i tested the scenario myself and found out that update function module inside update function module just register the inside FM again and execute it on next commit

thanks, that was helpful.

as for the other question, i know the difference between v1 and v2, i just dont know if that applies when they are started from a v1.

from the caller perspective (online transaction), v1 will be executed first. does this mean that eventual v2s started from that v1 will be executed before the v2s started from the caller ?

Read only

0 Likes
3,466

Hi Wagner,

          see lets say there are three custom function module FM1( type V1), FM2( type V1) and FM3( type V2 ) and say they are getting called from the standard transaction with some standard FM ( not considering one FM called inside the other FM) .Now when commit work statement comes, the control started execution in the following order.

FM1 ( as it is V1 )

FM2 ( as it is V1 )

Standard SAP FM ( can be V1 V3 V5 )

FM3 ( as it is V2 ) so V2 as the last

No, it doesnt mean that V2s are started from that V1 ( however it can happen if you call a V2 FM from a V1 FM but then too it is just registered and gets executed on the next commit ). It is just a sequence followed by the control ( V1 first and V2 second ). Consider an example where lets say your FM1 data update should happen before the FM3 data update from the example above, there sequencing matters.

it is purely the callers perspective, in which update FM gets called. like on first commit all the update FM registered earlier will follow the sequence as described above and on second commit all the update FM registered between first commit and second commit follow the sequence.

Hoping it is clear to you now.

Regards

Animesh Sundriyal

Read only

0 Likes
3,466

Let´s say i have another custom function FM4(v2), called inside FM2.

Will it be executed after FM3 ?

Read only

0 Likes
3,466

yes..... but only when the control reaches next commit statement ( considering if the FM2 is the only registered FM only that will execute )

Read only

0 Likes
3,466

and the next commit will be the one that ends the V1s LUW:

UP1 workprocess:

FM1 ( as it is V1 )

FM2 ( as it is V1 ) - calls FM4 (v2)

Standard SAP FM ( can be V1 V3 V5 )

COMMIT (triggers FM4)

UP2 workprocess:

FM3 ( as it is V2 ) so V2 as the last

FM4

COMMIT

correct ?

can FM3 and FM4 rely on the data updated by FM1 and FM2 ?? is it already in the disk??

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,466

Hello Wagner,

UP1 workprocess:

FM1 ( as it is V1 )

FM2 ( as it is V1 ) - calls FM4 (v2)

Standard SAP FM ( can be V1 V3 V5 )

COMMIT (triggers FM4)

UP2 workprocess:

FM3 ( as it is V2 ) so V2 as the last

FM4

COMMIT

If you are planning to do a COMMIT WORK with the update WP, then please note that this will cancel the whole update. (Refer: http://help.sap.com/abapdocu_731/en/abapcall_function_update.htm).

What is your exact business requirement? If you want to nest the main transaction you can use the SAP Object Services - Transaction service.

BR,

Suhas

Read only

0 Likes
3,466

sure, see my last answer

Read only

Former Member
0 Likes
3,466

yes it is like that only....... FM3 and FM4 can rely in the data updated by FM1 and FM2, it. will be available on disk...

one thing you cannot use commit statement inside update FM

and it is not mandatory to have commit statement between V1s and V2s.

Read only

0 Likes
3,466

sure, i was refering to the commits in the first picture (Process):

http://help.sap.com/saphelp_nw70ehp2/helpdata/en/c8/ed15db039b4f45a8507015f531976b/content.htm

thanks!

Read only

Former Member
0 Likes
3,466

Wagner,

I see many replies on this. But may I ask is this a valid scenario that you are thinking of? The reason I am this is cuz, SAP does not recommend to have an commit inside an update task.

check the below link under the notes sections

http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_UPDATE.htm

Thanks,

Vikram.M

Read only

0 Likes
3,466

sure, see my last answer