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: 

BDC

Former Member
0 Kudos

What is the difference betwee synchronous and asynchronous updates in call transaction .... and which method is better.. why?

session/call transaction which is bettr... why

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

<b>Synchronous versus Asynchronous</b>

<u>Synchronous</u>

With synchronous updating, we can check SY-SUBRC to determine the success of the transaction and the actual update to the database.

DO.

………

PERFORM FILL_BDC_TAB.

CALL TRANSACTION ‘FK02’

USING BDC_TAB

MODE ‘N’

UPDATE ‘S’.

IF SY-SUBRC < > 0.

WRITE: /‘ERROR’.

ENDIF.

ENDDO.

<u>Asynchronous</u>

With asynchronous updating, we can check SY-SUBRC to determine the success of the transaction only, not the actual update to the database.

DO.

………

PERFORM FILL_BDC_TAB.

CALL TRANSACTION ‘FK02’

USING BDC_TAB

MODE ‘N’

UPDATE ‘A’.

IF SY-SUBRC < > 0.

WRITE: /‘ERROR’.

ENDIF.

ENDDO.

<b>Reward ifusefull</b>

2 REPLIES 2

Former Member
0 Kudos

Hi

<b>Synchronous versus Asynchronous</b>

<u>Synchronous</u>

With synchronous updating, we can check SY-SUBRC to determine the success of the transaction and the actual update to the database.

DO.

………

PERFORM FILL_BDC_TAB.

CALL TRANSACTION ‘FK02’

USING BDC_TAB

MODE ‘N’

UPDATE ‘S’.

IF SY-SUBRC < > 0.

WRITE: /‘ERROR’.

ENDIF.

ENDDO.

<u>Asynchronous</u>

With asynchronous updating, we can check SY-SUBRC to determine the success of the transaction only, not the actual update to the database.

DO.

………

PERFORM FILL_BDC_TAB.

CALL TRANSACTION ‘FK02’

USING BDC_TAB

MODE ‘N’

UPDATE ‘A’.

IF SY-SUBRC < > 0.

WRITE: /‘ERROR’.

ENDIF.

ENDDO.

<b>Reward ifusefull</b>

Former Member
0 Kudos

HI

use Asynchronous Update

Synchronous Update : This means say if u have 10 records to update and the processing is going on in a loop the Synchronous update will wait till each update is actually done in the data base and then it will move on the next record's updation.

Asynchronous : In This mode, the updates are lined one after the other and the system doesn't wait for the updates to actually happen. These updates are then triggered by an internally scheduled job which then actually updates the data in the databse.

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.

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.

DataBase Commit:

This statement will apply any outstanding database updates and wait until they have actually been put on the database before proceeding to the next statement.

An ordinary commit work will initiate the process to update the databases in a separate task and will press on in your abap.

COMMIT WORK: ( Asynchronous)

Your program does not wait for any acknowledgement. it just start executing the next statment after COMMIT WORK.

<b>session/call transaction which is</b>

In general Call Transaction is used for small amount of data where as Session method used for large amount of data.

Call transaction we can not interrupt the process once it is started we can just collect the error messages but in session method we can set it as background or we can just see error recodes which are not updated in database tables or we can see messages for all the record.

Session method is synchronous process where as call transaction we can call as synchronous or asynchronous both the way.

If any error occurs in a call transaction method, the user can either remove it at the same time (mode 'E') else, that record is discarded and all other records are updated in the database..

However, session method does not update the database till the session is completed successfully.. It can be rescheduled after removing the error..

However we can not reschedule the call transaction.. call transaction fast as compared to session method..

In session method we can pass data to multiple transactions.. in call transaction.. only to one..

I came across a requirement that no record should be updated if there is even a single error record.. in that case i used session method..

<b>REward ifuseful</b>