2013 May 09 3:09 PM
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 ?
2013 May 09 5:41 PM
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
2013 May 09 3:17 PM
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.
2013 May 09 5:13 PM
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...
regards,
narayan
2013 May 09 5:41 PM
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
2013 May 09 7:12 PM
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 ?
2013 May 09 7:32 PM
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
2013 May 09 7:54 PM
Let´s say i have another custom function FM4(v2), called inside FM2.
Will it be executed after FM3 ?
2013 May 09 7:59 PM
yes..... but only when the control reaches next commit statement ( considering if the FM2 is the only registered FM only that will execute )
2013 May 09 8:12 PM
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??
2013 May 10 7:20 AM
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
2013 May 10 2:02 PM
2013 May 09 8:33 PM
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.
2013 May 09 8:46 PM
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!
2013 May 10 5:21 AM
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
2013 May 10 2:02 PM