‎2008 Mar 11 12:54 AM
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.
‎2008 Mar 11 1:12 AM
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
‎2008 Mar 11 2:15 AM
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!
‎2008 Mar 11 1:13 AM
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,