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 capture the errors ?

Former Member
0 Likes
559

HI,

how to capture the errors Call transaction method?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
539

HI,

IN CALL TRANSACTION TO CAPTURE THE ERRORS WE SHOULD PERFORM THE FOLLOWING.

FIRST ME MUST DECLARE AN INTERNAL TABLE WITH THE STRUCTURE OF BDCMSGCOLL TABLE.

THEN WHILE WRITING THE CALL TRANSACTION STATEMENT WE SHOULD PUT THE 'E' MODE FOR CAPTURING ALL THE ERRORS.

THEN FINALLY THE CAPTURED ERRORS MUST TO SENT TO THE INTERNAL TABLE WHICH WE DECLARED IN THE BEGINNING WITH BDCMSGCOLL BY USING THE FUNCTION MODULE "FORMAT_MESSAGE"

AND THUS THE ERROR MESSAGES WILL BE SENT TO THE INTERNAL TABLE WHICH WE DECLARED AT THE BEGINNI

Reward Points if found helpfull..

Cheers,

Chandra Sekhar.

4 REPLIES 4
Read only

Former Member
0 Likes
539

You can do it progr4amatically.

take one internal table as errormessages.

keep the structure similar as components inm message like

message,message no,id,etc.

whenever call transaction fials add the entry of error to errormessage table and finally display the internal table in alv/list.

please reward if useful.

Read only

Former Member
0 Likes
540

HI,

IN CALL TRANSACTION TO CAPTURE THE ERRORS WE SHOULD PERFORM THE FOLLOWING.

FIRST ME MUST DECLARE AN INTERNAL TABLE WITH THE STRUCTURE OF BDCMSGCOLL TABLE.

THEN WHILE WRITING THE CALL TRANSACTION STATEMENT WE SHOULD PUT THE 'E' MODE FOR CAPTURING ALL THE ERRORS.

THEN FINALLY THE CAPTURED ERRORS MUST TO SENT TO THE INTERNAL TABLE WHICH WE DECLARED IN THE BEGINNING WITH BDCMSGCOLL BY USING THE FUNCTION MODULE "FORMAT_MESSAGE"

AND THUS THE ERROR MESSAGES WILL BE SENT TO THE INTERNAL TABLE WHICH WE DECLARED AT THE BEGINNI

Reward Points if found helpfull..

Cheers,

Chandra Sekhar.

Read only

Former Member
0 Likes
539

In SESSION method errors are handled by session only. You error log in session method .

In CALL TRANSACTION method you need to handle errors explicitly.

See the code for error handling

DATA: BEGIN OF i_mess OCCURS 0,

l_mstring(480),

msgnr(5),

msgv1(15),

END OF i_mess.

DATA : messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

PERFORM mess.

FORM mess .

LOOP AT messtab.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

id = messtab-msgid

lang = messtab-msgspra

no = messtab-msgnr

v1 = messtab-msgv1

v2 = messtab-msgv2

v3 = messtab-msgv3

v4 = messtab-msgv4

IMPORTING

msg = l_mstring

EXCEPTIONS

not_found = 1

OTHERS = 2.

CONDENSE l_mstring.

i_mess-l_mstring = l_mstring(250).

i_mess-msgnr = messtab-msgnr.

i_mess-msgv1 = messtab-msgv1.

APPEND i_mess.

ENDLOOP.

ENDFORM.

This perform is used to handle eroor in Call transaction method.

Thx

Jagadeesh

Read only

0 Likes
539

U can also use funtion modules

message_text_build

Regards

Devanand