Application Development 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: 

Synchronous and asynchronous mode

Former Member
0 Kudos

Hi all,

when to use synchronous and asynchronous mode in BDC

cheers

7 REPLIES 7

Former Member
0 Kudos

HI

GOOD

Synchronous Process -The synchronous process used in the process when we are using the call transaction process,in this process one record update in the database than the second record comes,

Asynchronous Process-The asynchronous process used in when we are using tbe bdc session process,in this process multiple record process at a time.

thanks

mrutyun

ferry_lianto
Active Contributor
0 Kudos

Hi Kumar,

Synchronus data processing is that in which the program calling the update task waits for the update work process to finish the update before it continues processing.

In Asynchronus update the callng program does not wait for update work process to finish the update and continues as normal.

A BDC done with sessions is always synchronus.

A BDC with call transaction is by default asynchronus

unless you define it explicitly as

call transaction 'XXXX' ...... update 'S'.

( If you donot define update option it is defaulted to "A" ).

The update method is of importance when one transaction locks data which may be required by a subsequent transaction . The subsequent transaction will fail if data is locked from previous one. An example would be you are creating sales order for same material in succession ( with asynchronus update ). Quite likely that some of transactions would fail due to material locked.

For large volume of data Call Transaction will be faster but you have no restart capability here. Suppose from 1000 transactions 100 fails . You will have to run the BDC program again exclusing the ones which wrere successful. However with session method you have the option to process the error transactions again in SM35 . So if you are sure that errors will not occur use call transaction else use session method.

Please also check this link for differences between call transaction and batch input method

http://help.sap.com/saphelp_47x200/helpdata/en/fa/097015543b11d1898e0000e8322d00/frameset.htm

Hope this will help.

Regards,

Ferry Lianto

Please reward points if helpful.

Former Member
0 Kudos

Hi,

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.

Asynchronous processing is NOT recommended for processing any larger amount of data. This is because the called transaction receives no completion message from the update module in asynchronous updating. The calling data transfer program, in turn, cannot determine whether a called transaction ended with a successful update of the database or not.

If you use asynchronous updating, then you will need to use the update management facility (Transaction SM12) to check whether updates have been terminated abnormally during session processing. Error analysis and recovery is less convenient than with synchronous updating.

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.

Regards,

Tanveer.

<b>Please mark helpful answers</b>

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Kumar,

<b>Synchronous</b> calls are slower but should be used for transactions that are updating the database because control is not passed back to the program until a successful database commit (or rollback) has been executed. Note this the real SQL commit at the database level not the ABAP command COMMIT WORK. Synchronous calls will set the return code (sy-subrc) if an error is encountered. There are actually two synchrounous update modes:

'S', Synchronous update mode makes database entries describing the updates to be done and an update task (potentially running on a different computer) reads those database entries, does the update, and then deletes the entries describing the update task.

'L', Local update mode describes the updates to be done in the memory of the current process. No entries are made in and then deleted from the database describing the update task.

<b>Asynchronous</b> calls are the default if the UPDATE parameter is not specified. Asynchronous calls do not effect the return code (sy-subrc).

Note - This is opposite of how synchronous/asynchronous workflow tasks behave, in the sense that control is returned to the workflow in a synchronous step even if there is no commit or rollback encountered!

Question - Does a synchronous call transaction cause the ABAP to issue a COMMIT WORK AND WAIT command within the transaction

Regards,

Sridhar

0 Kudos

Synchronus data processing is that in which the program calling the update task waits for the update work process to finish the update before it continues processing.

In Asynchronus update the callng program does not wait for update work process to finish the update and continues as normal.

A BDC done with sessions is always synchronus.

A BDC with call transaction is by default asynchronus

unless you define it explicitly as

call transaction 'XXXX' ...... update 'S'.

( If you donot define update option it is defaulted to "A" ).

The update method is of importance when one transaction locks data which may be required by a subsequent transaction . The subsequent transaction will fail if data is locked from previous one. An example would be you are creating sales order for same material in succession ( with asynchronus update ). Quite likely that some of transactions would fail due to material locked.

For large volume of data Call Transaction will be faster but you have no restart capability here. Suppose from 1000 transactions 100 fails . You will have to run the BDC program again exclusing the ones which wrere successful. However with session method you have the option to process the error transactions again in SM35 . So if you are sure that errors will not occur use call transaction else use session method.

http://www.sappoint.com/abap/bdcconcept.pdf

sushant_singh
Participant
0 Kudos

hi ,

basically we have both synchronous and asynchronous options while using call transaction method.

but choose one of them according to the reqirement

such as if we need that the execution continues without waiting for the database changes then we use asynchronous.

but if the process need to wait for database changes maybe in situation that further processing reqire changed data i that situation we use synchronous.

Former Member
0 Kudos

hi

In syncronous Update untill the previous updations is done completely it will not do next updation.

while in Asynchronous update there could be parrallel updations at a time.

regards

vikas