2007 Feb 26 2:15 AM
Hi ,
Can any body tell me,
I have an internal table , which is having MsgID, MsgNR,msg-var1,msg-var2,msg-var3,msg-var4.
I need to get the message text from these fields. please give me suggession.
thanks in advance.
kp
2007 Feb 26 2:20 AM
Hi,
loop at itab where msgnr = 'XXX' and
msgid = 'zz'.
conacatenate itab-msg-var1 itab-msg-var1 itab-msg-var1 itab-msg-var1
into msg_text.
endloop.
regards,
keerthi
2007 Feb 26 2:22 AM
Use the function modules FORMAT_MESSAGE or MESSAGE_TEXT_BUILD.
~Suresh
2007 Feb 26 2:30 AM
Loop at itab into w_tab where msgid = v_id.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = w_itab-msgid
LANG = '-E'
NO = w_tab-msgnr
V1 = w_tab-msg-var2
V2 = w_tab-msg-var2
V3 = w_tab-msg-var3
V4 = w_tab-msg-var4
IMPORTING
MSG =
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2 .
endloop.
Regards,
Amit
Reward all helpful replies.
2007 Feb 26 2:51 AM
KP,
Pls. check the fM.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = MSG_LST-MSGID
LANG = SY-LANGU
NO = MSG_LST-MSGNO
V1 = MSG_LST-MSGV1
V2 = MSG_LST-MSGV2
V3 = MSG_LST-MSGV3
V4 = MSG_LST-MSGV4
IMPORTING
MSG = MSG_TEXT
EXCEPTIONS
NOT_FOUND = 01.
Pls. reward if useful
2007 Feb 26 3:26 AM
CHECK MSG-VAR1 TO VAR4 IN DEBUG MODE GENERALLY TEXTS ARE STORED IN THIS VAR1 AREA.
REGARDS
SGHIBA DUTTA
2007 Feb 26 3:26 AM
also try this..
CALL FUNCTION 'TB_MESSAGE_BUILD_TEXT'
EXPORTING
LANGU = SY-LANGU
MSGID = P_SY_MSGID
MSGNO = P_SY_MSGNO
MSGV1 = P_SY_MSGV1
MSGV2 = P_SY_MSGV2
MSGV3 = P_SY_MSGV3
MSGV4 = P_SY_MSGV4
IMPORTING
TEXT = P_L_ERR_MSG.
2007 Feb 26 3:29 AM
CHECK MSG-VAR1 TO VAR4 IN DEBUG MODE GENERALLY TEXTS ARE STORED IN THIS VAR1 AREA.
REGARDS
SGHIBA DUTTA
2007 Feb 26 3:50 AM
Hi,
Use FORMAT_MESSAGE to get the description of text for the message number.
Thanks
Hari.
Reward points for valuable answers.
2007 Feb 26 3:55 AM
hi
good
if you r having these fields in your internal table than debug the program what value they are storing and if you want to print then you can use the write statement to print those values in the output screen.
or you can pass these field values to any of your defined variable and you can display them using the write statement.
thanks
mrutyun^
2007 Feb 26 8:57 AM
Hi KP,
Use the following code to get the Message text for the MsgID, MsgNo, MsgV1-V4.
TABLES : T100 .
SELECT SINGLE * FROM T100 WHERE SPRSL = SY-LANGU AND
ARBGB = MSGID AND
MSGNR = MSGNO .
TEXT = T100-TEXT .
REPLACE '&1' WITH MSGV1 INTO TEXT . CONDENSE TEXT .
REPLACE '&2' WITH MSGV2 INTO TEXT . CONDENSE TEXT .
REPLACE '&3' WITH MSGV3 INTO TEXT . CONDENSE TEXT .
REPLACE '&4' WITH MSGV4 INTO TEXT . CONDENSE TEXT .
REPLACE '&' WITH MSGV1 INTO TEXT . CONDENSE TEXT .
REPLACE '&' WITH MSGV2 INTO TEXT . CONDENSE TEXT .
REPLACE '&' WITH MSGV3 INTO TEXT . CONDENSE TEXT .
REPLACE '&' WITH MSGV4 INTO TEXT . CONDENSE TEXT .
Hope it helps.
Regards,
Himanshu.