‎2007 Aug 14 9:31 PM
Hi Experts,
Just for my curiosity sake, pls. clarify,
1- DB updation
A - Synchronous DB updation
B - Asynchronous DB updation
2 - I guess, CALL TRANSACTION is Asynchronous, Am I correct?
3 - I hv seen some programs, they r using 'S' i.e. Synchronous, So, pls. let me clarify, In Wht scenarios, we need to choose the Synchronous?
Thanq.
‎2007 Aug 14 10:01 PM
HI,
Asynchronous is the default that we normally use when dealing with data upload into SAP.
When we should go with Synchronous..
Let us say we have a scenerio.. where in i want to create a sales order upon successful creation i have to trigger a logic for creating the delivery..
in this case the fate of delivery is determined by the fate of sales order upload.. so u run the sales order logic in synchronous mode and create delivery after this..
if you have successive dependent steps then you have to go with synchronous.
Thanks
Mahesh
‎2007 Aug 14 9:46 PM
Here is what will explain you..
http://help.sap.com/saphelp_nw2004s/helpdata/en/41/7af4cba79e11d1950f0000e82de14a/content.htm
Cheers
A.
‎2007 Aug 14 10:01 PM
HI,
Asynchronous is the default that we normally use when dealing with data upload into SAP.
When we should go with Synchronous..
Let us say we have a scenerio.. where in i want to create a sales order upon successful creation i have to trigger a logic for creating the delivery..
in this case the fate of delivery is determined by the fate of sales order upload.. so u run the sales order logic in synchronous mode and create delivery after this..
if you have successive dependent steps then you have to go with synchronous.
Thanks
Mahesh
‎2007 Aug 14 10:07 PM
thanq,
Pls. Can U differentiate the Asynchro and Synchro, little bit in detail?
thanq.
‎2007 Aug 14 10:16 PM
HI,
Synchronous is interactive way of updating...
perform step1... wait till it is completed and you get the reply back
perform step2 .... wait till it is completed and you get the reply back.
..
Asynchronous
perform step1
perform step2.
Thanks
mahesh
‎2007 Aug 14 11:30 PM
‎2007 Aug 14 11:39 PM
Check it my personal note :
A Asynchronous updating. In this mode, the called transaction does not wait for any updates it produces to be completed. It simply passes the updates to the SAP update service. Asynchronous processing therefore usually results in faster execution of your data transfer program.
S Synchronous updating. In this mode, the called transaction waits for any updates that it produces to be completed. Execution is slower than with asynchronous updating because called transactions wait for updating to be completed. However, the called transaction is able to return any update error message that occurs to your program. It is much easier for you to analyze and recover from errors
one simple example : You are creating sales order from file and also you want to update header text of sales order.
when you want to update sales order header text,you need to use save_text function module ,here you need to pass sales order number.
when you use call transaction update 'A', data will update transaction level and it goes to the next record,here it will not wait for database .
when you use call transaction update 'S',data will update transaction level and it will update database then it goes next record.
if you want to update header text,then you need to use sync update
database commit -
comitt work - it will update data in database sucessfully
roll back - it will not update in database.
Thanks
Seshu
‎2007 Aug 15 2:31 AM
thanq.
Actually, this to_b_enhance_z_prog. is using the same code/scenario, wht is mentioned/questioned at th every bottom line of the Documentation of ur link...i.e.
<i><b>Question - Does a synchronous call transaction cause the ABAP to issue a COMMIT WORK AND WAIT command within the transaction?</b></i>
I mean, to_b_enhance_z_prog is coded like,
CALL TRANSANSACTION mode 'S'
(and next) COMMIT WORK AND WAIT
has been coded? Any clue, why commit is used, even after S mode?
So, pls. clarify,
thanq,
Message was edited by:
Srikhar
‎2007 Aug 15 2:58 AM
Hello Srikhar,
Who writtens comitt work after call transaction.
Comitt work will not work if you use call transaction . if you need comitt work for any kind of call transaction command then you have to use update mode is 'S'.
This is equal to comitt work.
Hope you got it so comitt work should not apply after call transaction.
Thanks
Seshu
‎2007 Aug 15 3:07 AM
hi,
actually, am not facing any issue, just curiuos to know,
the code goes like,
data: no_screens value N
data: synchronous value S
CALL TRANSACTION 'XXXX'
using bdcdata
moode No_screens
update Synchronous
messages into bdcmsgcoll.
if synchromous = S
commit work and wait.
endif.
comments pls,
2 - from ur link documentationm i understand that, V1 type FM r works like SYNCHRONOUS type, Am i correct? or in other words, If I use V1 type FM, Is it necessory for me to keep COMMIT WORK & WAIT code, to delete/update next record from DB?
thanq.
Message was edited by:
Srikhar
‎2007 Aug 15 3:11 AM
Okay
data: no_screens value N
data: synchronous value S
CALL TRANSACTION 'XXXX'
using bdcdata
moode No_screens
update Synchronous
messages into bdcmsgcoll.
<b>if synchromous = S -> This code is not required and unnessary command.
commit work and wait.
endif.</b>
2. that is correct ...
and one more thing call transaction calls other transaction and updating the data into other transactions ,here we don't have any control,so no need to use comitt work command..
Thanks
Seshu
‎2007 Aug 15 3:16 AM
thanq,
i got it.
actually, y am is getting doubt is that, this prog. was written by very very experienced programmer, thats y am digging!
any how , thaq.
‎2007 Aug 15 3:25 AM
Does not matter how much experience we have ,some times i used do silly mistakes.
But final thing is we should not use comitt work after call transaction..instead of comitt work we need to use update mode 'S'..
I hope you got it.
Thanks
Seshu