‎2010 Feb 15 6:47 AM
Hi experts,
I am trying to populate my database table with the error message.
The error message as comming form standard code in an ITAB.
I am getting the error class and message number.
Can any body please tell me any function module to read the error.
Or is there any way to populate the database table with the error message.
Regards,
Sandipan.
‎2010 Feb 15 7:08 AM
Hi,
You can use the Function module mentioned below.
call transaction 'VA42' using bdcdata mode w_mode
update w_synch
messages into it_mesgtab.
loop at it_mesgtab into wa_mesgtab where msgtyp ca 'EA'.
endloop.
if sy-subrc <> 0.
read table it_mesgtab into wa_mesgtab index 1.
endif.
call function 'MESSAGE_TEXT_BUILD'
exporting
msgid = wa_mesgtab-msgid "Messg class
msgnr = wa_mesgtab-msgnr "Messg No.
msgv1 = wa_mesgtab-msgv1
msgv2 = wa_mesgtab-msgv2
msgv3 = wa_mesgtab-msgv3
msgv4 = wa_mesgtab-msgv4
importing
message_text_output = it_err-sapmessage.
Append it_err.
Regards,
Srinivas
‎2010 Feb 15 6:51 AM
HI,
You can use the FM MESSAGE_TEXT_BUILD. You need to pass the place holders also(msgv1/2/3/4 for getting complete text)
Alternatively you can use table T100 for reading the messages.
Thanks,
Vinod.
‎2010 Feb 15 6:53 AM
Hi,
Please search for basics before posting threads.
Here use the FM "BALW_BAPIRETURN_GET2"?
The import parameters for this FM are
TYPE - Message Type (can be error/success.info etc)
CL - Message Class
NUMBER - Message No
PAR1 - Message Place Holder1, if any exists
PAR2 - Message Place Holder2, if any exists
PAR3 - Message Place Holder3, if any exists
PAR4 - Message Place Holder4, if any exists
You will get the message text information directly from the export parameter RETURN-MESSAGE.
Regards,
Ganga
‎2010 Feb 15 6:54 AM
Hi Saneeepan,
If you just want to read the message then you can use
FM - BALW_BAPIRETURN_GET2
And pass the values - mes class and no and you will get message
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = LS_MESSTAB-MSGTYP
cl = LS_MESSTAB-MSGID
number = L_NUMBER
IMPORTING
return = EV_MESSAGE.
Regards,
Murali
‎2010 Feb 15 6:55 AM
‎2010 Feb 15 7:08 AM
Hi,
You can use the Function module mentioned below.
call transaction 'VA42' using bdcdata mode w_mode
update w_synch
messages into it_mesgtab.
loop at it_mesgtab into wa_mesgtab where msgtyp ca 'EA'.
endloop.
if sy-subrc <> 0.
read table it_mesgtab into wa_mesgtab index 1.
endif.
call function 'MESSAGE_TEXT_BUILD'
exporting
msgid = wa_mesgtab-msgid "Messg class
msgnr = wa_mesgtab-msgnr "Messg No.
msgv1 = wa_mesgtab-msgv1
msgv2 = wa_mesgtab-msgv2
msgv3 = wa_mesgtab-msgv3
msgv4 = wa_mesgtab-msgv4
importing
message_text_output = it_err-sapmessage.
Append it_err.
Regards,
Srinivas
‎2010 Feb 15 7:14 AM
Gentlemen,
SAP has provided a statement to pass the message short text into a variable. (MESSAGE ... INTO ) who needs a FM to do the same ?
Please read this: [http://help.sap.com/abapdocu_70/en/ABAPMESSAGE_OPTIONS.htm#!ABAP_ADDITION_3@3@|http://help.sap.com/abapdocu_70/en/ABAPMESSAGE_OPTIONS.htm#!ABAP_ADDITION_3@3@]
BR,
Suhas