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: 

Handle Errors in BDC table control.

Former Member
0 Kudos

Pls let me know . that . how to handle errors that occured in BDC Table control .. for both call and session methods..

2) If first 4 records r good and 5th is error . then wat does it update for both call and session methods?????

3)how do the system shows if u have 1000 records in a table control in a screen of short size ???????

4) how to handle errors in normal bdc.. if u r using Call and sesion methods ?????

plz answer these questions ...

thanks in advance.........

1 REPLY 1

Former Member
0 Kudos

Error handling in Call transaction can be done by defining an internal table of type BDCMSGCOL where the error messages will get populated for a transaction, then we can make use of the message number.. get the error message from t100 table and display it..

sample code for error handling in call transaction

CALL TRANSACTION 'LT01' USING bdc_data MODE bdc_mode MESSAGES INTO messtab.

*Fetching Error and Success Messages

LOOP AT messtab.

CLEAR t_text1.

CLEAR t_text2.

IF messtab-msgtyp = 'E' OR messtab-msgtyp = 'A' .

v_messtype = 'ERROR :'.

PERFORM fetch_message TABLES t_text1.

ELSEIF messtab-msgtyp = 'S'.

v_messtype = 'SUCCESS :'.

PERFORM fetch_message TABLES t_text2.

ENDIF.

ENDLOOP.

ENDLOOP.

FORM fetch_message TABLES p_itab STRUCTURE t_text.

SELECT SINGLE * FROM t100 INTO text WHERE sprsl = messtab-msgspra

AND arbgb = messtab-msgid

AND msgnr = messtab-msgnr.

IF sy-subrc = 0.

l_mstring = 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.

Endform.

In Batch input session.. the error are handled automatically. where u can see the error in log in the sm35 transaction where u process the batch input session.

In the case of table contol,

the best solution would be batch input session and while processing we can take the option of default screen size while processing the batch input session.. so that standard screen resolution will be used and data will be uploaded..

rewards points if useful

regards

hemanth