01-29-2009 8:25 AM
Hi,
In my program, I am using BDC. All the messages generated during BDC are stored in the MESS_INFO which is of the structure BDCMSGCOLL.
During any error or warnings in the process of BDC execution, I am getting the MSGID and MSG but i want to get the exact short message corresponding to that MSG.
Please help in how to get the 'Short Message' corresponding to the MSGID and MSG. Is there any Function Module, using which i can get the Short Message by passing MSGID and MSG.
Ex: MSGID = PO
MSG = 378.
Thanks,
Shan
01-29-2009 8:27 AM
Hello,
You have to use the FM FORMAT_MESSAGE for this purpose. In the put you pass MSGID & MSGNO and in return you get short text in the IMPORTING param MSG.
For further inputs search in SDN.
BR,
Suhas
Edited by: Suhas Saha on Jan 29, 2009 1:57 PM
01-29-2009 8:28 AM
Messages are stored in table T100, you can get the short text from there.
01-29-2009 8:29 AM
hi
check out this documentation
http://help.sap.com/saphelp_nw04/helpdata/en/dd/4da23fa34ffb47e10000000a114084/frameset.htm
hope this helps
regards
Aakash Banga
01-29-2009 8:31 AM
01-29-2009 8:52 AM
Use FM 'MESSAGE_PREPARE' to retrieve the message text using MSGID and MSGNO
DATA: lv_msg_id LIKE t100-arbgb, " Message Id
lv_msg_no LIKE t100-msgnr, " Message No
lv_msg_var1 LIKE balm-msgv1, " Message Var1
lv_msg_var2 LIKE balm-msgv2, " Message Var2
lv_msg_var3 LIKE balm-msgv3, " Message Var3
lv_msg_var4 LIKE balm-msgv4. " Message Var4
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
language = sy-langu
msg_id = lv_msg_id
msg_no = lv_msg_no
msg_var1 = lv_msg_var1
msg_var2 = lv_msg_var2
msg_var3 = lv_msg_var3
msg_var4 = lv_msg_var4
IMPORTING
msg_text = lv_msg
EXCEPTIONS
function_not_completed = 1
message_not_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE i995 WITH text-002. " Unable to prepare message
LEAVE LIST-PROCESSING.
ENDIF.