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

Showing the Error message problem

Former Member
0 Likes
777

Hi,

How am i going to show the message in the i_messages? I just need its first entry... but Im not sure which field of bapiret2 contains the error message. Thanks a lot!

i_messages like bapiret2.

CALL FUNCTION 'BAPI_PROCORDCONF_CREATE_HDR'

IMPORTING

return = i_messages

TABLES

athdrlevels = i_header.

READ TABLE i_messages WITH KEY type = c_error.

IF sy-subrc EQ 0.

LOOP AT i_messages WHERE type = c_error.

  • Show errors generated from i_messages

ENDLOOP.

MESSAGE i006 WITH v_orderno.

LEAVE TO SCREEN 0.

ENDIF.

3 REPLIES 3
Read only

Former Member
0 Likes
543

Hi,

The field MESSAGE of the structure bapiret2 should contain the message.

If it does not contain as is in few circumstances, then you have to call the FM 'FORMAT_MESSAGE' and pass the message ID,language and other paramters that are returned in the BAPIRET2 structure to get the message.

Hope this helps you.

Thanks,

Avanish Joshi

Read only

0 Likes
543

Thanks guys...

In my message class... I'll just put & to the message short text.

Would that be fine? will it now show the whole message text in field message of bapiret2? Thanks a lot!

Read only

Former Member
0 Likes
543

Hi Mark,

First, it is not BAPIRET2 but BAPIRET1.

There is a filed Type at BAPIRET1. This field contain Message type, like S for Success, E for Error, W for Warning, I for Info and A for Abort.

If you just want to show the error message, just display message where BAPIRET1-Type = 'E'.

Regards,