2009 Oct 22 2:25 PM
Hi,
I would like to extract the long text from a message class. However, the long text has 4 parameters and I have to retrieve them after they have been replaced by the actual parameters. Is there any Function Module/Class that would help me in doing this operation?
Thanks and regards,
Ritesh
2009 Oct 24 5:22 PM
function module FORMAT_MESSAGE should not be used anymore as an ABAP statement exists (since a very long time now):
MESSAGE ... WITH <parameters> INTO variable.
Hi,
I would like to extract the long text from a message class. However, the long text has 4 parameters and I have to retrieve them after they have been replaced by the actual parameters. Is there any Function Module/Class that would help me in doing this operation?
Thanks and regards,
Ritesh
2009 Oct 24 7:13 AM
Hi,
data : wa_msgtab TYPE bdcmsgcoll,
ist_msgtab TYPE table of bdcmsgcoll.
you need to capture these message in CALL TRANSACTION statement of BDC
loop at ist_msgtab into wa_msgtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = wa_msgtab-msgid
lang = sy-langu
no = wa_msgtab-msgnr
v1 = wa_msgtab-msgv1
v2 = wa_msgtab-msgv2
v3 = wa_msgtab-msgv3
v4 = wa_msgtab-msgv4
IMPORTING
msg = g_errmsg
EXCEPTIONS
not_found = 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.
endloop.
The above FM returns all the values required , now you can concatenate all these values into a String and pass them to WebDynpro Component by using SET_ATTRIBUTE method of WD_CONTEXT
For more info go throught the Interface referring to WD_CONTEXT
Cheers
Ram
Edited by: Ramchander Krishnamraju on Oct 26, 2009 5:54 AM
2009 Oct 24 5:22 PM
function module FORMAT_MESSAGE should not be used anymore as an ABAP statement exists (since a very long time now):
MESSAGE ... WITH <parameters> INTO variable.
2009 Oct 26 4:50 AM
Hi,
I cannot use MESSAGE statement as I have to display the long text within a WebDynPro component.
Thanks and regards,
Ritesh
2009 Oct 26 10:03 AM
Sorry, I reacted to the previous message, which did not answer to your question (note also that MESSAGE ... INTO variable do not send message to dynpro, but store SHORT message text into a variable, so you could use it if you wanted to retrieve the SHORT text).
For the LONG text (your question), search the forum (BAPI_MESSAGE_GETDETAIL, RPY_MESSAGE_COMPOSE, etc.)
2009 Oct 26 10:44 AM
2009 Oct 26 10:53 AM
Ritesh,
althought question is already marked as answered, I would like to make an additional remark. In WebDynpro, one should use the message manager for issueing messages.
2009 Oct 26 11:25 AM
Hi,
Yes, I do use the message manager. However, I still have to extract the Long text from the message class to use it within the message manager.
Thanks and regards,
Ritesh
2009 Oct 26 11:41 AM
Maybe it's just me, but I don't really understand. There is a method called: REPORT_T100_MESSAGE. In here you only have to pass the message class, number, type and placeholders and the message will be formatted and issued for you. I guess you are using another method, but not sure why.
2009 Oct 27 4:37 AM
Hi Micky,
I believe T100 is only for the short text and not for the long texts. Please correct me if I am wrong.
Thanks and regards,
Ritesh
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |