‎2008 Apr 02 4:41 PM
Hi,
i am calling a FM in my custom prog.
After execution of the FM some auto generated errors is getting displayed.
I want to pass this error to an internal table.
Please tell me how to do this?
CALL FUNCTION 'FORMAT_CHECK'
EXPORTING
i_checkrule = t005-prbkn
i_checkfield = it_ven-bankn
i_checklength = t005-lnbkn
i_checkmask = space
i_fname = fname
EXCEPTIONS
not_valid = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
I want to catch this particular error message in the itab.
Thanks,
SAM.
‎2008 Apr 02 4:43 PM
use message xxxx into gv_message.
gv_message type char200 (or alike).
example:
data: msgtext type char200.
MESSAGE E004 WITH 'bla bla bla' INTO msgtext.
Edited by: Micky Oestreich on Apr 2, 2008 5:44 PM
‎2008 Apr 02 4:50 PM
‎2008 Apr 02 5:06 PM
Even we can create an internal table nad move the messages to it.
DATA : BEGIN OF L_ERR OCCURS 0,
SNO LIKE SY-tabix, "serial no
MSGTY LIKE SY-MSGTY, "message type
MSGNO LIKE SY-MSGNO, "message no
ERR_TEXT LIKE T100-TEXT, "message text
END OF L_ERR.
IF SY-SUBRC <> 0.
L_ERR-SNO = SY-TABIX.
L_ERR-MSGTY = SY-MSGTY.
L_ERR-MSGNO = SY-MSGNO.
L_ERR-ERR_TEXT = TEXT-015. "Problem encounterd in uploading data.
APPEND L_ERR.
clear L_ERR.
ENDIF.