Application logging in SLG1..

Hello Gurus,
I want to know how can I insert message to application log through ABAP. In one of the programs following condition occurs. When this happens , I want the error message to be written to error log so that later it can be accessed by SLG1 T-code.
IF SY-SUBRC <> 0.
        lv_error_msg = 'User Workitem creation failed'.
  ENDIF.
Please help.
Regards,
Tushar.

Please refer to the below thread and look for Sandra Rossi's answer
Re: How to create info. bar/window which displays success and error messages

Similar Messages

  • How to use Application log (slg0 & slg1)

    Hi all,
    Can u please give me some hints to utilize Application log?
    Hope you will help me.
    Thanq in advance,
    Bye.

    hi John,
       Check these FM's out
    BAL_GLB_SEARCH_LOG            
    BAL_LOG_CREATE                
    BAL_LOG_EXC_ADD               
    BAL_LOG_HDR_CHANGE            
    BAL_LOG_HDR_READ              
    BAL_LOG_MSG_ADD               
    BAL_LOG_MSG_ADD_FREE_TEXT     
    BAL_LOG_MSG_CHANGE            
    BAL_LOG_MSG_CUMULATE          
    BAL_LOG_MSG_DELETE            
    BAL_LOG_MSG_DELETE_ALL        
    BAL_LOG_MSG_READ              
    BAL_LOG_REFRESH               
    SBAL_DETAIL                    Application Log: Display: Detail Screens                              
    BAL_DSP_LOG_PARAMETERS         Application Log: Display: Display log header parameter set            
    BAL_DSP_LOG_TECHNICAL_DATA     Application Log: Display: Display log header technical data                                                                               
    SBAL_DISPLAY                   Application Log: Display Log                                          
    BAL_DSP_LOG_DISPLAY            Application Log: Fullscreen log output                                
    BAL_DSP_LOG_PRINT              Application Log: Print log                                                                               
    SBAL_PROFILE                   Application Log: Display Profile                                      
    BAL_DSP_PROFILE_SINGLE_LOG_GET Application Log: Display profile: Standard profile (SLG1) for one log                                                                               
    SBAL_SERVICE                   Application Log: Service Functions                                    
    BAL_LOG_HDR_CHECK              Application Log: Log: Header data: Check                              
    BAL_LOG_MSG_CHECK              Application Log: Log: Message: Check                                                                               
    SBAL_TOOLBOX                   Application Log: Toolbox                                              
    BAL_DB_LOGNUMBER_GET           Application Log: Database: Get internal log number from number range  
    BAL_LOG_DELETE                 Application Log: Log: Delete log (from DB also at save)               
    BAL_LOG_EXIST                  Application Log: Log: Check existence (in memory)                     
    BAL_LOG_MSG_EXIST              Application Log: Log: Message: Check existence (in memory)            
    BAL_LOG_MSG_REPLACE            Application Log: Log: Message: Replace last                           
    BAL_STATISTICS_LOG_GET                                                                               
    BAL_STATISTICS_LOG_SET                                                                               
    Regards,
    Santosh
    Note: Reward Points if helpful

  • Application log ( Transaction slg1)

    Hi,
    This is suresh.
    I got a requirement in that i need to send input values to application log. Am able to send four parameters using function module bal_log_msg_add(msgv1,msgv2,..) successfully. But in my requirement i need to send five parameters to application log. How can i do this. For which prameter i need to send using function module bal_log_msg_add. please help me in this.

    Hi Suresh,
    See the Function Module Documentation, It will help you.
    Sets of logs can be created with the following methods.
    Function modules: [ Some Additional Function Modules ] :
    BAL_LOG_CREATE Create log with header data
    BAL_LOG_MSG_ADD Log a message
    BAL_LOG_MSG_CUMULATE Add a message cumulatively to the log
    BAL_LOG_MSG_REPLACE Replace the last message
    BAL_GLB_MSG_CURRENT_HANDLE_GET Get the current message handle
    BAL_LOG_MSG_DELETE Delete message
    BAL_LOG_MSG_CHANGE Change message
    BAL_GLB_MSG_DEFAULTS_GET Get message data defaults
    BAL_GLB_MSG_DEFAULTS_SET Set message data defaults
    Types :
    BAL_S_MDEF Message defaults
    Example program :
    Program SBAL_DEMO_02 simulates a flight check and outputs a check result log.
    ==>SBAL_DEMO_02 ==>SBAL_DEMO_02 coding
    Add message to log :
    This is the 'classical' way of logging messages with BAL_LOG_MSG_ADD.
    ==>Note
    The log handle is optional for function modules such as BAL_LOG_MSG_ADD, BAL_LOG_MSG_CUMULATE, BAL_LOG_MSG_ADD_FREE_TEXT, etc.
    If it is not specified, the default log, which can be set, with other default data, with BAL_GLB_MSG_DEFAULTS_SET is used. If no default log is defined, it is set automatically by BAL_LOG_CREATE (see here).
    Add message cumulatively :
    Functionality :
    A message is added to the log with ( log handle) I_LOG_HANDLE cumulatively.
    The message data is in the IMPORTING parameter I_S_MSG (structure BAL_S_MSG).
    A message handle E_S_MSG_HANDLE, which uniquely identifies this message, is returned.
    'Cumulative'
    Some messages are sent several times by a program, without providing new information each time. Such messages can be cumulated with BAL_LOG_MSG_CUMULATE to save memory. When the same message is repeated, no new message is added, the counter MSG_COUNT for the old message is incremented.
    You can specify when messages are the same in the function module interface. The T100 data must be identical, and you can specify that other data must also be the same:
    I_COMPARE_ATTRIBUTES = 'X'
    Message attributes (problem class PROBCLASS, level of detail DETLEVEL and sort field ALSORT) must be identical
    I_COMPARE_CONTEXT  = 'X'
    The context must be the same
    I_COMPARE_PARAMETERS  = 'X'
    The message parameters must be the same.
    To find identical messages quickly for cumulation, the Application Log constructs a small index table containing as unambiguous a signature of a message as possible, at runtime. This index is only constructed if cumulation is used.
    Thanks.

  • Configure CCMS alert to Analyze Application log

    Hi ,
    Please provide the prodecure to configure CCMS alert for Applications logs from SLG1 tcode.
    If any error log(prefarably Important logs ) is created then a alert should be triggered .
    Background : We are using Solution Manager 7.0 as Central monitor system for Satellite systems of verions ECC6.0.
    Thanks & Regards
    ganesh

    this answer is no longer needed

  • How to determine SLG1 Application Log Size

    Hi, Can anyone tell me how we might be able to determine the size of our SLG1 Application Logs on our BW System?
    We want to be sure they are not taking up too much space.  If they are we'll purge with SLG2, and if not then we will keep them around.
    Thanks!

    Hello,
    system does writes the application log in to the database.
    SAP_COLLECTOR_FOR_NONE_R3_STAT is designed to collect non ABAP Statistic Data in/for a central repository.
    look service.sap.com/notes and search for SAP_COLLECTOR_FOR_NONE_R3_STAT
    Hope it will hep you.
    Regards,

  • Calling SLG1 for Application log creation

    Hi All,
    I have a requirement for writing logs in SLG1 transaction. I embedded the logic for creating log in a method of a class. The method is getting called in CRM inbound proxy where I would need to make mutiple calls to this log. If I use a call more than one time, I am getting only the log for the first call. The second and the rest of the calls are not throwing any message in SLG1 but shown as greyed out. Could we not call the log SLG1 more than one time in the same application?
    Any ideas would be appreciated.
    Thanks
    Anand

    Hi,
    did you have a look at my weblog:
    /people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Function Module for Application Log(SLG1)

    HI SapAll.
    may i know what is the Function Module  to read the data for Applicaiton Log (tcode-SLG1).
    waiitng for your response.
    regards.
    Varma

    Hi Danish.
    running the program 'SBAL_DISPLAY' is similar to running the FM'APPL_LOG_DISPLAY' .However when i run any one of these i have to manually press the 'Execute button' to display the log(there is no option to save the log into spool or to get into some Internal table)
    i have tried running the program 'SBAL_DISPLAY'  by putting the Break point at the line (  CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
          EXPORTING
            i_t_log_handle      = l_t_log_handle)
    ,while debugging the values are as below:
    L_T_LOG_HANDLE : Sorted Table[1x1(44)]
    1      ZoDNJw4vg3BX0000h1GOdm.
    could you please help me in getting the log into spool wihtout having to press the execute button and without having to look at the Log.
    regards.
    Varma

  • Doubt in creating program to display application logs

    Hi,
    I have doubt in creating a program to display application logs.
    The standard transaction code SLG1 has been used to display Application logs till now by the user.
    They came up with the new requirement on this.
    <u>The requirements were:</u>
    1)New custom program shoud be created like SLG1 with limited selection fields( data from, date to, Program name and User)
    2) Detail list should be displyed immediately when this program is executed because SLG1 gives Basic list,Detailed list which is getting displayed when 'Detail view' is selected in the first list.
    I have created one program with limited selection fields as per the requirement using the below function modules .
    BAL_FILTER_CREATE
    BAL_DB_SEARCH
    BAL_DB_LOAD
    and BAL_DSP_LOG_DISPLAY
    <u>Issue :</u> still I am getting the firt list.
    both Basic and Detailled lists are getting triggered at the FM BAL_DSP_LOG_DISPLAY.
    Is it only the way to copy and modify this FM.
    Could you please suggest me?
    Thans in advace,
    babu.
    Message was edited by:
            babu v
    Message was edited by:
            babu v

    Hello All,
    Thanks for your valuable suggitions.
    I have seen most of the demo programs.
    I found one fm'BAL_DSP_PROFILE_NO_TREE_GET' which avoids the tree list which is getting listed above the profile list.
    I have been searching alot to omit the Profile list. I searched alot to find any function modules realted to that.
    The requirement was only the Detail list should only be listed.
    Could you please suggest me to avopid that profile list also?
    Thanks in advance,
    babu
    Message was edited by:
            babu v

  • How to write to application log at BBP_CREATE_BE_PO_NEW

    Dear all,
    I am running in a strange problem. I want to log to application log (SLG1) in BADI BBP_CREATE_BE_PO_NEW. As soon as I call a function from there I get an error at the shopping cart position. Changing values in the given data does work without any problems. In EBP 3.5 we used the BADI BBP_CREATE_PO_BACK and this worked with logging without any problems.
    Thanks for support.
    Regards
    Roman

    Hello , there is an example of application logging usage in report SBAL_DEMO_01.
    You need an application log instance to be created before you can add messages that will be displayed using tx SLG1. Maybe its because you dont have a logging object instance in your badi.
    Hope it helps.
    Regards, Luciano.

  • Issue regarding application log in standard program RPCLMSU0

    System Status: SAP ECC6, SP15.
    This probem has been observed after we have upgraded from 4.6C.
    In the include RPCLMSUF of the Report RPCLMSU0, there is an FM BAL_LOG_MSG_ADD, which adds messages to an application log.
    A structure is passed to the FM, of type bal_s_msg.
    The first 3 components of the structure are of type:
    sy-msgt, sy-msgid and sy-msgno.
    These should normally be filled in by values from the FM called just above it: BAL_LOG_CREATE.
    But this doesnu2019t happen.
    So, SAP has hardcoded values for these 3 as u2018Eu2019 (Message type), HRPAYNA_ALV (Message ID) and u2018998u2019 (Message no).
    These are the values that get printed when the program is tested. i.e. the hardcoded text is getting displayed.
    Output in the ALV : HRPAYNA_ALV:998 ***********No records found***********
    We have checked the documentation for the FMs, and even gone through a few sample programs that SAP has created like SBAL_DEMO_02. The output is perfect here.
    Since this is code that SAP has added (Entire form added "SL0K008292) by SAP to its standard code, they must believe that these hardcoded text will still not get printed. Can this error can be corrected by making some configuration changes in the system (SLG1?).
    The code of the suroutine where this FM is called is given below:
    FORM alv_appl_msg_add USING iv_text1 TYPE any
                                iv_text2 TYPE any
                                iv_text3 TYPE any
                                iv_text4 TYPE any.
    Constants delcation.....
      CONSTANTS: lc_msgid TYPE sy-msgid VALUE 'HRPAYNA_ALV', " Message ID
                 lc_msgty TYPE sy-msgty VALUE 'E'.  " Message Type
    Data declarations.....
      DATA  ls_msglog TYPE bal_s_msg.      " Structure for msg log
      ls_msglog-msgty     = lc_msgty.
      ls_msglog-msgid     = lc_msgid.
      ls_msglog-msgno     = gv_msgno.
      ls_msglog-msgv1     = iv_text1.
      ls_msglog-msgv2     = iv_text2.
      ls_msglog-msgv3     = iv_text3.
      ls_msglog-msgv4     = iv_text4.
    Function module is used to add the messages to message log
      CALL FUNCTION 'BAL_LOG_MSG_ADD'
        EXPORTING
          i_s_msg = ls_msglog
        EXCEPTIONS
          OTHERS  = 1.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.                               " IF sy-subrc <> 0
    ENDFORM.                               " alv_appl_msg_add

    Hi
    Pass IDoc Number, Date, Time from EDIDC table to FM-
    'APPL_LOG_READ_DB'.
    You'll get all log details of that IDoc.
    For only Message, check FM - 'IDOC_GET_MESSAGE_ATTRIBUTE'.
    Regards.

  • Application Log Issue

    Hello all,
    I need to get the application log data into an internal table.
    I have the following parameters with me: 1) OBJECT ID
                                                                      2) SUBOBJECT
                                                                      3) EXTERNAL ID
    When i enter the same in SLG1 i get the information.
    How do i get the entire message into an Internal table in my program.I n
    Regards,
    Arun

    Hello Arun,
    Using function module 'APPL_LOG_READ_DB' u can read the application log.
    DATA: P_NUMBER_OF_LOGS LIKE SY-TABIX.
    Log header data
    DATA: BEGIN OF P_HEADER_DATA_TAB OCCURS 0.
    INCLUDE STRUCTURE BALHDR.
    DATA: END OF P_HEADER_DATA_TAB.
    Log parameters
    DATA: BEGIN OF P_HEADER_PARA_TAB OCCURS 0.
    INCLUDE STRUCTURE BALHDRP.
    DATA: END OF P_HEADER_PARA_TAB.
    Log messages
    DATA: BEGIN OF P_MESSAGE_TAB OCCURS 0.
    INCLUDE STRUCTURE BALM.
    DATA: END OF P_MESSAGE_TAB.
    Message parameters
    DATA: BEGIN OF P_MESSAGE_PARA_TAB OCCURS 0.
    INCLUDE STRUCTURE BALMP.
    DATA: END OF P_MESSAGE_PARA_TAB.
    CALL FUNCTION 'APPL_LOG_READ_DB'
      EXPORTING
        OBJECT          = 'ZTEST'
        SUBOBJECT       = 'ZTEST01'
        EXTERNAL_NUMBER = 'Application Log Demo'
      IMPORTING
        NUMBER_OF_LOGS  = P_NUMBER_OF_LOGS
      TABLES
        HEADER_DATA        = P_HEADER_DATA_TAB
        HEADER_PARAMETERS  = P_HEADER_PARA_TAB
        MESSAGES           = P_MESSAGE_TAB
        MESSAGE_PARAMETERS = P_MESSAGE_PARA_TAB.
    Please let me know any help needed further.

  • Calling error/application logs in CRM inbound proxy

    Hi All,
    In inbound proxy of CRM, I have to call Error/Application logs (for eg:SLG1) whenever an integration process throws some error. Has anyone worked on this kind of scenario to call different application logs in CRM or R3 side inbound proxy.
    If so, please give some ideas on this.
    Thanks
    Deno

    Hi Deno,
    did you have a look at my blog in which I describe it ?
    /people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
    Regards,
    michal

  • SAP TABLE TO VIEW THE APPLICATION LOGS OF IDOCS

    Hi,
    Can you please suggest where I can see the table to view the application logs in idocs. We can see this individually in SLG1 or MM90. But I need to see it collectively to see all the error messages. Please suggest.

    Hi
    You can check tables:
    EDIDC- for control records
    EDID4-for Data Records
    EDIDS-for Status records
    You can also use T Code WE02 or WE05
    Thanks & Regards
    Sanil Bhandari

  • Transaction for application log

    Using IDOCS.  One has errored but cannot get into application log as pop up not appearing (memory issue or something) for me to double click the log number and go into the application log to view it.  Does anyone know the transaction or menu path to access the application log direct so I can see what the error is about?
    Many thanks
    Larissa

    Hi,
    USE SLG1 Transaction.
    Thanks,
    Naga

  • Error/Application Logs

    I have a scenario in which I have to display error logs when exception occurs.
    There is a transaction SLG1 where you can see all the application log for a particular process. Has anyone worked on calling these types of transactions to display error or application logs. If so, please throw some light on this.
    Thanks a lot
    Deno

    Hi Deno,
    If you want to see the error message in SLG1. Follow the following steps:
    1.  Use the FM BAL_LOG_CREATE to create the application log.
    2.  Use the FM BAL_LOG_MSG_ADD to add the message to the application log.
    3. Save the application log using FM BAL_DB_SAVE.
    Now you can see your error message in the SLG1 transaction.
    <b>Reward points if it helps.</b>

Maybe you are looking for