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

Display only error messages

madhu_reddy22
Participant
0 Likes
840

Hi Guys,

What is the syntax for displaying only error messages for BAPIRET2_T

CALL FUNCTION 'xxxxxxxxx'

EXPORTING

..................

IMPORTING

ET_RETURN = itab_bapiret2_t.

LOOP AT itab_bapiret2_t

INTO wa_bapiret2_t.

WRITE 😕 gw_bapiret2-MESSAGE. "This displays all the messages

ENDLOOP.

Thanks in Advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
782

CALL FUNCTION 'xxxxxxxxx'

EXPORTING

..................

IMPORTING

ET_RETURN = itab_bapiret2_t.

LOOP AT itab_bapiret2_t

INTO wa_bapiret2_t where type eq 'E'.

WRITE 😕 gw_bapiret2-MESSAGE. "This displays Error Messages

ENDLOOP.

Hi Guys,

What is the syntax for displaying only error messages for BAPIRET2_T

CALL FUNCTION 'xxxxxxxxx'

EXPORTING

..................

IMPORTING

ET_RETURN = itab_bapiret2_t.

LOOP AT itab_bapiret2_t

INTO wa_bapiret2_t.

WRITE 😕 gw_bapiret2-MESSAGE. "This displays all the messages

ENDLOOP.

Thanks in Advance

4 REPLIES 4
Read only

Former Member
0 Likes
782

Hi Madhu,

Use the following

Read table itab_bapiret2_t into wa_bapiret2_t with key

TYPE = ' E '.

if sy-subrc EQ 0.

write:/ wa_bapiret2-Message.

Endif.

Reward points if helpful.

David.

Read only

0 Likes
782

If you are expecting multiple error messages then

LOOP AT itab_bapiret2_t

INTO wa_bapiret2_t where Type = ' E '.

WRITE 😕 gw_bapiret2-MESSAGE. "This displays all the messages

ENDLOOP.

Reward points if helpful.

David.

Read only

Former Member
0 Likes
782

Hi,

You have to filter by message type = 'E'.

Something like:

LOOP AT itab_bapiret2_t WHERE type = 'E'.
INTO wa_bapiret2_t.
WRITE :/ gw_bapiret2-MESSAGE. "This displays all the messages
ENDLOOP.

Hope it helps.

Regards,

Carlos Constantino

Read only

Former Member
0 Likes
783

CALL FUNCTION 'xxxxxxxxx'

EXPORTING

..................

IMPORTING

ET_RETURN = itab_bapiret2_t.

LOOP AT itab_bapiret2_t

INTO wa_bapiret2_t where type eq 'E'.

WRITE 😕 gw_bapiret2-MESSAGE. "This displays Error Messages

ENDLOOP.