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: 

Question regarding Errors

Former Member
0 Kudos

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

6 REPLIES 6

former_member194669
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Surya,

T100 will hold the message for all the message numbers...

What else you want to know... Please eloberate

Thanks

mahesh

ferry_lianto
Active Contributor
0 Kudos

Hi,

You can also use these FM to retrieve detail message.

FORMAT_MESSAGE

WRITE_MESSAGE

MESSAGE_TEXT_BUILD

Regards,

Ferry Lianto

Clemenss
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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:

Former Member
0 Kudos

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