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 Session Method.

Former Member
0 Kudos

Hi Friends,

Could any one u tell what will haapen if any error occurs during data transfer by session method.

-


If we have 100 records to upload if 30th record is erroed record wht will happen to the netx records.. i think it skips that record and proceeds to next record.

but how can we tell the user that error occurd in that particular record.

-


BDC call transaction .. upadte 'S' and 'A'.

what is the use of update addition to Call transaction statement

diff bw Synchronous Update and Asynchronus update...

and wher will we use 'A' and where will we 'S'

Jeyaseelan.G

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

SESSION METHOD

Data is not updated in database table unless Session is processed.

No sy-subrc is returned.

Error log is created for error records.

Updation in database table is always synchronous

CALL TRANSACTION

Immediate updation in database table.

Sy-subrc is returned.

Errors need to be handled explicitly

Updation in database table can be synchronous Or Asynchronous

Call transaction :

the transaction will be called immediatly when u run the report and the recording will be done once u execute the program...

Session method:

Session method will create a session ... U can schedule the session at any time so that it runs at the specified time..

Session

The most important aspects of the batch SESSION interface are: - Asynchronous processing - Transfers data for multiple transactions - Synchronous database update During processing, no transaction is started until the previous transaction has been written to the database. - A batch input processing log is generated for each session - Sessions cannot be generated in parallel

Call Transcation

The most important aspects of the CALL TRANSACTION USING interface are: - Synchronous processing - Transfers data for a single transaction - Synchronous and asynchronous database updating both possible The program specifies which kind of updating is desired. - Separate LUW for the transaction The system performs a database commit immediately before and after the CALL TRANSACTION USING statement. - No batch input processing log is generated.

Batch Input Session method is asynchronous as told by others here. But the advantage of this is that you have all the error messages and the data for each transaction held persistantly. You don't have to code anything for processing them or writing the logs.

But at the same time, the same feature can be disadvantageous if you need to react to an error or if there are too many errors to manually correct in a session. Since the session are created in the program and its execution is done seperately, you loose the trackability of such transactions.

With a call transaction, what was a disadvantage above will become an advantage. Call transaction immediately gives you messages back and you can react to it in your program. But the disadvantage is that, if you have several hundreds of transactions to run, running them from within the program can be resource crunching affair. It will hamper the system performance and you cannot really distribute the load. Of course, you have some mechanisms with which you can overcome this, but you will have to code for it. Also, storing the messages and storing the errored transaction data etc will have to be handled by you in the program. Whereas, in batch input session, your program's job is to just create the session, after that everything is standard SAP system's responsibility.

Ideally, you should do a call transaction if the resources are not a problem and if it fails, put the errored transaction into a session.

You can decide based on the data volume that your BDC is processing. If data volume is high go for session else call transaction will do.The call transaction updates will be instantaneous where as session needs to be processed explictly after creation.

Session Method

1) Session method supports both small amount of data aswell as large amount of data

2) data processing is asynchronus and data updation is synchronus.

3) it process multiple apllication while perfomaning validations.

4) in session method data will be updated in data base only after processing session only.

5) system provide by default logfile for handling error records.

6) it supports both foreground aswell as background process

in bdc we use FM ...

bdc_open_group " for creating Session

bdc_insert " adding transaction and bdcdata table for updating database

bdc_close_group " for closing Session

Call Transaction

1) Call transaction exclusively for small amout of data

2) it supports only one apllication while perfoming validations

3) there is no default logfile, We can explicitly provide logic for creating logfile for handling error records.

we can create logfile by using structure....BDCMSGCOLL

4) it doesn't support background processing.

5) data processing is synchronous and Data updation is Synchronous( default), in

this method also supports daya updation in asynchronus process also.

syntax:

Call transaction <transaction-name> using BDCDATA

mode <A/N/E>

update <L/A/S>

messages into BDCMSGCOLL.

The UPDATE addition determines the processing mode for batch input processing. You can specify a character-type object for upd. Its possible content and its effect are displayed in the following table. Without use of one of the additions UPDATE or OPTIONS FROM, the effect is the same as if upd had the content "A".

upd Effect

"A" Asynchronous update. Updates of called programs are executed in the same way as if in the COMMIT WORK statement the AND WAIT addition was not specified.

"S" Synchronous processing. Updates of the called programs are executed in the same way as if in the COMMIT WORK statement the AND WAIT addition had been specified.

"L" Local update. Updates of the called program are executed in such a way as if the SET UPDATE TASK LOCAL statement had been executed in it.

Note

This option is not available for execution of actual batch input sessions. There the update is always synchronous.

Processing.

Synchronus: Best example is Call transaction. Because..the data that we are passing should be immediately uploaded to screens without delay..

asynchronus:

Session Method. We can run program once and can goto SM 35 and run session later..here the process is not simultanious..so it is asynchronus

Message was edited by:

Roja Velagapudi

5 REPLIES 5

Former Member
0 Kudos

hi,

SESSION METHOD

Data is not updated in database table unless Session is processed.

No sy-subrc is returned.

Error log is created for error records.

Updation in database table is always synchronous

CALL TRANSACTION

Immediate updation in database table.

Sy-subrc is returned.

Errors need to be handled explicitly

Updation in database table can be synchronous Or Asynchronous

Call transaction :

the transaction will be called immediatly when u run the report and the recording will be done once u execute the program...

Session method:

Session method will create a session ... U can schedule the session at any time so that it runs at the specified time..

Session

The most important aspects of the batch SESSION interface are: - Asynchronous processing - Transfers data for multiple transactions - Synchronous database update During processing, no transaction is started until the previous transaction has been written to the database. - A batch input processing log is generated for each session - Sessions cannot be generated in parallel

Call Transcation

The most important aspects of the CALL TRANSACTION USING interface are: - Synchronous processing - Transfers data for a single transaction - Synchronous and asynchronous database updating both possible The program specifies which kind of updating is desired. - Separate LUW for the transaction The system performs a database commit immediately before and after the CALL TRANSACTION USING statement. - No batch input processing log is generated.

Batch Input Session method is asynchronous as told by others here. But the advantage of this is that you have all the error messages and the data for each transaction held persistantly. You don't have to code anything for processing them or writing the logs.

But at the same time, the same feature can be disadvantageous if you need to react to an error or if there are too many errors to manually correct in a session. Since the session are created in the program and its execution is done seperately, you loose the trackability of such transactions.

With a call transaction, what was a disadvantage above will become an advantage. Call transaction immediately gives you messages back and you can react to it in your program. But the disadvantage is that, if you have several hundreds of transactions to run, running them from within the program can be resource crunching affair. It will hamper the system performance and you cannot really distribute the load. Of course, you have some mechanisms with which you can overcome this, but you will have to code for it. Also, storing the messages and storing the errored transaction data etc will have to be handled by you in the program. Whereas, in batch input session, your program's job is to just create the session, after that everything is standard SAP system's responsibility.

Ideally, you should do a call transaction if the resources are not a problem and if it fails, put the errored transaction into a session.

You can decide based on the data volume that your BDC is processing. If data volume is high go for session else call transaction will do.The call transaction updates will be instantaneous where as session needs to be processed explictly after creation.

Session Method

1) Session method supports both small amount of data aswell as large amount of data

2) data processing is asynchronus and data updation is synchronus.

3) it process multiple apllication while perfomaning validations.

4) in session method data will be updated in data base only after processing session only.

5) system provide by default logfile for handling error records.

6) it supports both foreground aswell as background process

in bdc we use FM ...

bdc_open_group " for creating Session

bdc_insert " adding transaction and bdcdata table for updating database

bdc_close_group " for closing Session

Call Transaction

1) Call transaction exclusively for small amout of data

2) it supports only one apllication while perfoming validations

3) there is no default logfile, We can explicitly provide logic for creating logfile for handling error records.

we can create logfile by using structure....BDCMSGCOLL

4) it doesn't support background processing.

5) data processing is synchronous and Data updation is Synchronous( default), in

this method also supports daya updation in asynchronus process also.

syntax:

Call transaction <transaction-name> using BDCDATA

mode <A/N/E>

update <L/A/S>

messages into BDCMSGCOLL.

The UPDATE addition determines the processing mode for batch input processing. You can specify a character-type object for upd. Its possible content and its effect are displayed in the following table. Without use of one of the additions UPDATE or OPTIONS FROM, the effect is the same as if upd had the content "A".

upd Effect

"A" Asynchronous update. Updates of called programs are executed in the same way as if in the COMMIT WORK statement the AND WAIT addition was not specified.

"S" Synchronous processing. Updates of the called programs are executed in the same way as if in the COMMIT WORK statement the AND WAIT addition had been specified.

"L" Local update. Updates of the called program are executed in such a way as if the SET UPDATE TASK LOCAL statement had been executed in it.

Note

This option is not available for execution of actual batch input sessions. There the update is always synchronous.

Processing.

Synchronus: Best example is Call transaction. Because..the data that we are passing should be immediately uploaded to screens without delay..

asynchronus:

Session Method. We can run program once and can goto SM 35 and run session later..here the process is not simultanious..so it is asynchronus

Message was edited by:

Roja Velagapudi

0 Kudos

Hi

in the below.

Batch Input Session method is asynchronous as told by others here. But the advantage of this is that you have all the error messages and the data for each transaction held persistantly. You don't have to code anything for processing them or writing the logs.

where can we we see the logs... error messages ...

if like while uploading material data...

mat1

mat2

mat3

mat4

mat5.

if an error occurs in mat3. and mat5 .. these will not be upadted to database..

where can we see these mat3 and mat5 are the errored documents.

jeyaseelan.

Former Member
0 Kudos

Hi Guru,

Message: 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.

L Local updating. If you update data locally, the update of the database will not be processed in a separate process, but in the process of the calling program. (See the ABAP keyword documentation on SET UPDATE TASK LOCAL for more information.)

Thanks,

Reward If Helpful.

former_member181962
Active Contributor
0 Kudos

HI Guru,

When a record errors out, it will skip that record as expected.

YOu can find that errored record in the error log in SM35 transaction.

YOu can correct it by running the one record in online mode.

Update 'S' means that the control will not retrun to the next statement until all the tables in the LUW get updated.

Update 'A: means that the control og the program doesn't wait for all the updates to be done to the tables in the LUW(Logical Unit of Work).

REgards,

Ravi

Former Member
0 Kudos

hi,

but how can we tell the user that error occurd in that particular record.

u can check error log in Sm35.

we use program to download by using session name in selection

RSBDCLOG

or use We have the tables BDCLD and BDCLM, which will capture the log details inthe session. Firstly, sesssion should be processed. After that log will be created. Then caputure the information into an internal table using BDCLM and BDCLD.

BDC call transaction .. upadte 'S' and 'A'.

what is the use of update addition to Call transaction statement

diff bw Synchronous Update and Asynchronus update...

and wher will we use 'A' and where will we 'S'

synchronous Update - It will update transaction level and it goes database level.

then it goes next record.

Asynchronous Update : it will update transaction level and lt goes next record.

later it updates database level.

Synchronous update is slow processing

Asynchronous update is speed processing.

when you update the data at transaction level and it should update the data with respect to corresponding tables .. when you use asyn or syn ,all are sme but only thing is Syn update is it update the record transaction level and it goes db level and it will go next record.

where as Asyn update ,it updates transaction level and it goes next record.but it updates DB Level later.