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: 

regarding bdc

Former Member
0 Kudos
98

hey gurus,

well im new to abap,i wud like to know under watt circumstances do we choose to use session method and call transaction method.

do we have any set criteria,or is it just a personal choice.?

thnaks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos
67

Hi kuldeep,

Even though both call transaction and session method do the same job there are some differences.

1. If no. of records to be uploaded is less (<500) u can as well choose call transaction method but if the no. of records is more (>10000) u need to choose session method as call transaction will create some performance issues.

2. If u want to execute the program in future u can create a session and keep it ready so that u can execute it at any point of time. That is not possible in call transaction method.

hope this helps....

rewrad points if useful...

take care

5 REPLIES 5

Former Member
0 Kudos
67

Hi kuldeep,

IN CALL TRANSACTION TO CAPTURE THE ERRORS WE SHOULD PERFORM THE FOLLOWING.

FIRST WE MUST DECLARE AN INTERNAL TABLE WITH THE STRUCTURE OF BDCMSGCOLL TABLE.

THEN WHILE WRITING THE CALL TRANSACTION STATEMENT WE SHOULD PUT THE 'E' MODE FOR CAPTURING ALL THE ERRORS.

THEN FINALLY THE CAPTURED ERRORS MUST TO SENT TO THE INTERNAL TABLE WHICH WE DECLARED IN THE BEGINNING WITH BDCMSGCOLL BY USING THE FUNCTION MODULE "FORMAT_MESSAGE"

AND THUS THE ERROR MESSAGES WILL BE SENT TO THE INTERNAL TABLE WHICH WE DECLARED AT THE BEGINNING......

basically

In Session method The records are not added to the database until the session is processed. sy-subrc is not returned. Error logs are created for error records. Updation in database table is always Synchronous.

Call Transaction method: The records are immediately added to the database table. sy-subrc is returned to 0 if successful. Error logs are not created and hence the errors need to be handled explicitly. Updation in database table is either Synchronous or Asynchronous

it is a set-criteria.it is not of personal choice kuldeep.

thanks

karthik

GauthamV
Active Contributor
0 Kudos
67

hi,

WELCOME TO SDN.

Session method.

1) synchronous processing.

2) can tranfer large amount of data.

3) processing is slower.

4) error log is created

5) data is not updated until session is processed.

Call transaction.

1) asynchronous processing

2) can transfer small amount of data

3) processing is faster.

4) errors need to be handled explicitly

5) data is updated automatically

Call transaction is faster then session method. But usually we use session method in real time...because we can transfer large amount of data from internal table to database and if any errors in a session. Process will not complete until session get correct.

Session method:

1. This method is used to upload huge data

2 it has error log so that v can trace the errors easily.

3. it slower than call transaction method.

Call transaction:

1. This very fast than session method.

2. This is used to upload small volume of data.

3.Error tracing is bit difficult and v use MSGBDCCALL to get the error message

Session method – Use the BDC_OPEN_GROUP to create a session. Once we have created a session, then we can insert the batch input data into it with BDC_INSERT. Use the BDC_INSERT to add a transaction to a batch input session. We specify the transaction that is to be started in the call to BDC_INSERT. We must provide a BDCDATA structure that contains all the data required to process the transaction completely. Use the BDC_CLOSE_GROUP to close a session after we have inserted all of our batch input data into it. Once a session is closed, it can be processed.

Call Transaction -

In this method, we use CALL TRANSACTION USING to run an SAP transaction. External data does not have to be deposited in a session for later processing. Instead, the entire batch input process takes place inline in our program.

Call transaction is faster then session method. But usually we use session method in real time...because we can transfer large amount of data from internal table to database and if any errors in a session, then process will not complete until session get correct.

reward points if hlpful.

Former Member
0 Kudos
68

Hi kuldeep,

Even though both call transaction and session method do the same job there are some differences.

1. If no. of records to be uploaded is less (<500) u can as well choose call transaction method but if the no. of records is more (>10000) u need to choose session method as call transaction will create some performance issues.

2. If u want to execute the program in future u can create a session and keep it ready so that u can execute it at any point of time. That is not possible in call transaction method.

hope this helps....

rewrad points if useful...

take care

Former Member
0 Kudos
67

Hi Kuldeep,

Both call transaction and session method do the same job there are some differences.

1. If no. of records to be uploaded is less (<500) u can as well choose call transaction method but if the no. of records is more (>10000) u need to choose session method as call transaction will create some performance issues.

2. If u want to execute the program in future u can create a session and keep it ready so that u can execute it at any point of time. That is not possible in call transaction method.

Check out the below thread

http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm