Skip to Content

Application log: SLG1 does not show additional (CONTEXT) fields


I amI creating application log and filling messages in my custom program. In order to provide more information to the user, I am using the CONTEXT field while calling the BAL_LOG_MSG_ADD function. After the main program finishes, the function BAL_DSP_LOG_DISPLAY displays the log as expected. However, the recording of the same app log which can be seen by calling tcode SLG1 does not show the additional fields, only messages. Is there a way to enable these additional data to be shown in SLG1?



Here is my sample program:

DATA: gs_log     TYPE bal_s_log,
      gs_msg     TYPE bal_s_msg,
      gt_handle  TYPE bal_t_logh,
      gs_handle  LIKE LINE OF gt_handle,
      gs_context TYPE bal_s_ex01,
    l_s_display_profile TYPE bal_s_prof,
    l_s_fcat            TYPE bal_s_fcat.

* create log entry
gs_log-extnumber = 'TEST_APPLOG'.                           "#EC NOTEXT
gs_log-aluser    = sy-uname.
gs_log-alprog    = sy-repid.
gs_log-object    = 'ALERT'.     "possible entries in BALSUB table, maint tcode SLG0
gs_log-subobject = 'ALERT_LCL'.

    i_s_log      = gs_log
    e_log_handle = gs_handle.
APPEND gs_handle TO gt_handle.

* add message 3 to log
CLEAR gs_msg.
gs_msg-msgty           = 'W'.
gs_msg-msgid           = 'OO'.
gs_msg-msgno           = '023'.
* add context
gs_context-carrid      = 'LH'.
gs_context-connid      = '0400'.
gs_context-fldate      = '20100101'.
gs_context-id          = '12'.
gs_msg-context-value   = gs_context.
gs_msg-context-tabname = 'BAL_S_EX01'.
    i_s_msg       = gs_msg
    i_log_handle  = gs_handle.

* save log to DB - display with tcode SLG1
    i_t_log_handle   = gt_handle.

* get standard display profile
            e_s_display_profile = l_s_display_profile.
* add passenger ID to message table  
  l_s_fcat-ref_table = 'BAL_S_EX01'.
  l_s_fcat-ref_field = 'ID'.
  l_s_fcat-col_pos   = 100.
  APPEND l_s_fcat TO l_s_display_profile-mess_fcat.

* display log (possible w/o saving)
    i_t_log_handle = gt_handle
    i_s_display_profile    = l_s_display_profile.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 27, 2012 at 01:42 PM

    hi igor,

    i found a reply to your question on another site:

    i found a way to view the parameters in SLG1:

    if i add the parameter name and value as message 2 and 3 i can view them in the display.

    hi prahbu,

    igor is right. i need this functionality for slg1. i don't even use the 'BAL_DSP_LOG_DISPLAY' function but if i use it i get the ok list in a z_transaction just not in SLG1.

    thanks for your help guys,

    best regards,


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 26, 2012 at 02:20 PM

    hi Igor,

    did you solve this error?

    can you share with me your solution?



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.