07-19-2007 9:38 PM
Hi Experts,
Generally the error occured by the result of any statement or FM is shown like the following
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
So here this message is already stored from T100 table. this wll be displayed based on the message class. correct me if I am worng.
My question: Is there any table or transaction where you can see the log of these messages ? If this is not clear please let me know. Your help will be appreciated.
Thank you,
Surya
07-19-2007 9:41 PM
Hi,
You can generate the error message of sy-msgno etc...
perform f_prepare_message using SY-MSGID SY-MSGNO
SY-MSGV1
SY-MSGV2
SY-MSGV3
SY-MSGV4
changing v_text.
form f_prepare_message using p_msgid like t100-arbgb
p_msgnr like t100-msgnr
p_msgv1 like balm-msgv1
p_msgv2 like balm-msgv2
p_msgv3 like balm-msgv3
p_msgv4 like balm-msgv4
changing p_text.
* Creating message text
call function 'MESSAGE_PREPARE'
exporting
msg_id = p_msgid
msg_no = p_msgnr
msg_var1 = p_msgv1
msg_var2 = p_msgv2
msg_var3 = p_msgv3
msg_var4 = p_msgv4
importing
msg_text = p_text.
endform. " F_prepare_message
07-19-2007 9:47 PM
Hi Surya,
T100 will hold the message for all the message numbers...
What else you want to know... Please eloberate
Thanks
mahesh
07-19-2007 9:49 PM
Hi,
You can also use these FM to retrieve detail message.
FORMAT_MESSAGE
WRITE_MESSAGE
MESSAGE_TEXT_BUILD
Regards,
Ferry Lianto
07-19-2007 11:02 PM
Hi Surya,
starting some releases ago, if you insert a function call into your program, the code (please use CODE button above)
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
is inserted.
This works only if the developer of the function module used
<b>MESSAGE ... RAISING ...</b>
This will store the values in SY-MSGID SY-MSGTY SY-MSGNO SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4 so that the statement will issue this message.
If the program is executed as a background job, all messages will be part of the JOB LOG.
Online they get lost. Some programs create an application log. Use transaction SLG1 and search for application logs for a date period. This is one way of finding out what programs save the messages. Most do not.
Regards,
Clemens
07-19-2007 11:41 PM
Hi All,
All of you gave good responses, but Clemens Li's answer is close. But we created a module pool program , which is accessed from Portal also. For all the error messages we are maintainig a message class. But some function modules like calling smartfrom FM, If I use generic error message created in my own class will not help to track the error. Suppose if we use an error message "Smartform failed" in my message class, and which will be recorded in my log, does not tell us what really happend to fail. So I am looking to find if any place these messages are logged. I mean in a way all the messages any application. If this is possible based on my generic error date and time I can search this log to find the exact error. If this is not clear please let me know.
Thank you,
Surya
Clemens:
07-20-2007 9:53 PM
Hi All,
This issue is resolved by changing my thinking process. I decided to record system message when required, when it is not then use the generic messages created for this application.
You all gave very useful information to take my decision. I am awarding Very helpful answers for the hlpful anwsers.
Thank you,
Surya.
null