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 - error logs

Former Member
0 Kudos

Hello friends........can any one help me....how 2 find out the errors occured during batch input method , call transaction method and direct input method.

for example..when uploading 100 records of data.... the error occured in the 60 th record...whr the error will be stored? ....what happens to the process?........n how to rectify it?

Regds,

Ariff

9 REPLIES 9

former_member214131
Active Contributor
0 Kudos

Hello,

You can reprocess the Session in ERROR Mode. You can rectify the data once the screen pops up in Error mode.

hope this helps you.

Regds, Murugesh AS

Former Member
0 Kudos

Hi,

If your BI sessions were run with the option for keeping a log, you can use transaction SM35 to reprocess the session.

Regards

andreas_mann3
Active Contributor
0 Kudos

Hi Ariff

- SM35 -> analysis (or F2)

-> log (F7)

regards Andreas

Former Member
0 Kudos

Hi Ariff,

If it is a 'Call transaction' method, then you have to pass the messages to an internal table with structure 'bdcmsgcoll'. Once you do this, you can read the various messages with the Message type and process this internal table and decide what whether to print or list or do any subsequent processings with the messages. You also get the message descriptions in this internal table. The syntax with an example is

CALL TRANSACTION 'ME21' USING BDCDATA MODE 'N'

MESSAGES INTO ITAB.

If it is 'session method' that you are using, the provision for tracking, viewing and further processing of meesages and errors are there within transaction sm35.

Hope things are clear and please award points if you find this info useful.

regards,

Madhavan

Former Member
0 Kudos

hello friends thanx for your replie........but if my batch input program runs in the background ...........how would i trap the errors?

thnx

Ariff

0 Kudos

Hi,

If you have marked the flag for KEEP='X' to retain the session, then you can still see them in SM35.

Regards

0 Kudos

Hi,

If you are using the Call transaction method in the background, then simply use the 'write' statement to write the messages and it appears in the log in sm37.

If it is the session method, the log will anyway be there in sm35 provided the parameter KEEP = 'X' in function module 'BDC_OPEN_GROUP'.

regards,

Madhavan

Former Member
0 Kudos

Try this code for error log in bdc it will get u all errors while loading a file . But the problem is if its a flat file thn u should validate it while downloading it to the SAP system. I mean validating the entries in the internal table before you actually call the transaction.That is effective for performance.

To get the SAP generated messages which are generated while the transaction here's the code.

DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

LOOP AT MESSTAB.

SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA

AND ARBGB = MESSTAB-MSGID

AND MSGNR = MESSTAB-MSGNR.

IF SY-SUBRC = 0.

L_MSTRING = T100-TEXT.

IF L_MSTRING CS '&1'.

REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.

REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.

REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.

REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.

ELSE.

REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.

REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.

REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.

REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.

ENDIF.

CONDENSE L_MSTRING.

GV_MSG = L_MSTRING.

IF T100-ARBGB NE 'M3' AND

T100-MSGNR NE '800'.

ELSE.

ENDIF.

ENDLOOP.

REFRESH MESSTAB.

Former Member
0 Kudos

kindly rate the answer if it was of any help

Thanx

Varun