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

Synchronous Vs Asynchronous??

Former Member
0 Likes
1,522

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,186

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

12 REPLIES 12
Read only

Former Member
Read only

Former Member
0 Likes
1,187

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

Read only

0 Likes
1,186

thanq,

Pls. Can U differentiate the Asynchro and Synchro, little bit in detail?

thanq.

Read only

0 Likes
1,186

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

Read only

0 Likes
1,186

Check the below link :

http://fuller.mit.edu/tech/sync_asynchronous.html

Thanks

Seshu

Read only

0 Likes
1,186

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

Read only

0 Likes
1,186

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

Read only

0 Likes
1,186

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

Read only

0 Likes
1,186

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

Read only

0 Likes
1,186

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

Read only

0 Likes
1,186

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.

Read only

0 Likes
1,186

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