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:Β 

Display only error messages

madhu_reddy22
Participant
0 Kudos

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

Former Member
0 Kudos

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.

4 REPLIES 4

Former Member
0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.