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 - Difference bw Transaction and Batch method

Former Member
0 Kudos

Hi

How we can handle the error messages in transaction and batch method?.

Regards

Nikhil V Kumar

6 REPLIES 6

Former Member
0 Kudos

Hi,

An error log will be created in the case of BAtch Input;but not in the case of CAll Transaction.

BAtch Session:

We look into the list of incorrect session and process it again. To correct incorrect session we analyize the session to determine which screen and value produced the error.For small errors in data we correct them interactively otherwise modify batch input program that has generated the session or many times even the datafile

Regards,

Gayathri

Message was edited by: Gayathri Hariharan

0 Kudos

Hi Gayathri Hariharan ,

How we can handle errors in Transaction method?.

Regards

Nikhil V Kumar

0 Kudos

Hi,

You can use MESSAGES INTO addition of the CALL TRANSACTION statement.

You can get the help on CALL TRANSACTION and look for the addition MESSAGES INTO.

Hope it helps.

Regards,

Shashank

0 Kudos

hi Nikhil,

WELCOME TO SDN

these are some of the differences between the two

The major differences between Session method and Call transaction are as follows:

<b>SESSION METHOD</b>

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

2. No sy-subrc is returned.

3.Error log is created for error records.

4.Updation in database table is always synchronous

<b>CALL TRANSACTION</b>

1. Immediate updation in database table.

2. Sy-subrc is returned.

3. Errors need to be handled explicitly

4. Updation in database table can be synchronous Or Asynchronous.

<b>Error Handling in CALL TRANSACTION</b>

When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:

<b>Steps for the error handling in CALL TRANSACTION</b>

1. Internal table for the data (structure similar to your local file)

2. BDCTAB like BDCDATA

3. Internal table BDCMSG like BDCMSGCOLL

4. Internal table similar to Ist internal table

(Third and fourth steps are for error handling)

5. UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)

6. Loop at itab.

Populate BDCTAB table.

Call transaction <tr.code> using <Bdctab>

Mode <A/N/E>

Update <S/A>

Messages <BDCMSG>.

Perform check.

Refresh BDCTAB.

Endloop.

7 Form check.

IF sy-subrc <> 0. (Call transaction returns the sy-subrc if updating is not successful).

Call function Format_message.

(This function is called to store the message given by system and to display it along with record)

Append itab2.

Display the record and message.

Regards,

Santosh

Former Member
0 Kudos

Call Transaction:

We can create a internal table like 'bsgmcgcoll'. All the messages will go to internal table. We can get errors in this internal table.

Below messages go to an internal table when you run the call transaction.

- Message type

- Message id

- Message Number

- Variable1

- Variable2

- Variable3

andreas_mann3
Active Contributor
0 Kudos

hi,

have a look here:

Andreas