Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Short Message from MSGID and MSG.

Former Member
0 Kudos

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

5 REPLIES 5

SuhaSaha
Advisor
Advisor
0 Kudos

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

JozsefSzikszai
Active Contributor

Messages are stored in table T100, you can get the short text from there.

Former Member
0 Kudos

hi

check out this documentation

http://help.sap.com/saphelp_nw04/helpdata/en/dd/4da23fa34ffb47e10000000a114084/frameset.htm

hope this helps

regards

Aakash Banga

Former Member
0 Kudos

Use function MESSAGE_PREPARE

Former Member
0 Kudos

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.