You are on page 1of 1

When you use the CALL Transaction you put the error messages into the structure of type

bdcmsgcoll e.g DATA: i_messages LIKE bdcmsgcoll OCCURS 0. CALL TRANSACTION tcode USING i_bdcdata MODE lws_mode UPDATE lws_update MESSAGES INTO i_messages. Here the error and success messages have come into the table i_messages Now this is not complete if you look at the table i_messages at runtime... Now to get the complete message you use the FORMAT_MESSAGE. LOOP AT i_messages INTO wa_messages WHERE msgtyp EQ 'E' OR msgtyp EQ 'A'. (This is to get only Error Messages) call function 'FORMAT_MESSAGE' exporting id = wa_messages-msgid lang = sy-langu no = wa_messages-msgnr v1 = wa_messages-msgv1 v2 = wa_messages-msgv2 v3 = wa_messages-msgv3 v4 = wa_messages-msgv4 importing msg = v_msg exceptions not_found = 1 others = 2. Here v_msg contains the full error message such that you would see on the screen. wa_error-message = v_msg. append wa_error to i_error. Here your table i_error will contain all the error messages which have come ENDLOOP.

You might also like