Application Development and Automation 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: 
Read only

how to handle errors in call transaction method?

Former Member
0 Likes
752

hello

plz clarify my doubt..

how should we handle the errors in call transaction method. how to use the sructure bdcmsgcoll in the program plzzzzzz. give me the sytax for that.

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
720

Dear Biju,

We can use session method logfile in call transaction.

> 1. We have to send error records in to one internal table.

> 2. Next for that itab we can use session method.

> 3. With this we will get session method log file in call transaction.

we can use funtion module WRITE_MESSAGES and FORMAT_MESSAGES to read the messeges in stead of BDCMSGC

Best Regards,

Rajesh,.

Please reward points if found helpful.

hello

plz clarify my doubt..

how should we handle the errors in call transaction method. how to use the sructure bdcmsgcoll in the program plzzzzzz. give me the sytax for that.

thanks

5 REPLIES 5
Read only

Former Member
0 Likes
720

Loop at the messages for type 'E', these are your error messages. Call function module FORMAT_MESSAGE within this loop and get the messages.

Read only

Former Member
0 Likes
720

HI,

We will use the BDCMSGCOLL structure in the call transaction syntax itself. Basically in this internal table all error records will be stored. If you pass this internal table to FORMAT_MESSAGES FM you will get complete error description

Reward points if found helpful....

Cheers,

Venkoji Babu.

Read only

Former Member
0 Likes
720

Hi,

Data: gt_messtab TYPE STANDARD TABLE OF bdcmsgcoll,

gt_error_tab TYPE STANDARD TABLE OF bdcmsgcoll.

CALL TRANSACTION <TCODE> USING itab_bdcdata MODE 'N' UPDATE 'L'

MESSAGES into gt_messtab.

Loop at gt_messtab into gs_messtab where MSGTYP = 'E'.

Append gs_messtab into gt_error_tab.

Endloop.

GT_ERROR_TAB will have all the records with Errors.

Lokesh

Read only

RoySayak
Active Participant
0 Likes
720

first declare an int tab type BDCMSGCOLL

then use it in call transaction extension MESSAGES INTO MSG_TAB.

if MSG_TAB-MSGTYP = 'E'.

then use the MESSAGE_PREPARE FM to get the text pass MSGV1, MSGV2, MSGV3, MSGV5, MSGNR, MSGID to the funchtion module . it'll return a text. write it or store it to an int tab.

Reward if useful.

Thanks

Sayak

Read only

Former Member
0 Likes
721

Dear Biju,

We can use session method logfile in call transaction.

> 1. We have to send error records in to one internal table.

> 2. Next for that itab we can use session method.

> 3. With this we will get session method log file in call transaction.

we can use funtion module WRITE_MESSAGES and FORMAT_MESSAGES to read the messeges in stead of BDCMSGC

Best Regards,

Rajesh,.

Please reward points if found helpful.