<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: slg1 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/slg1/m-p/4756016#M1115450</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please use this code if possible....since BAL is much more flexible den APP...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First go to SLG0 and create an Object and sub-object in customer name space. Then write the following code in your programu2026..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: w_loghead TYPE bal_s_log,&lt;/P&gt;&lt;P&gt;             w_logmsg  TYPE bal_s_msg..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_loghead-object     = 'OBJECT NAME'.&lt;/P&gt;&lt;P&gt;w_loghead-subobject  = 'SUBOBJECT NAME'.&lt;/P&gt;&lt;P&gt;w_loghead-aldate_del = sy-datum + 90.                     "expires in 90 days&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Creating LOG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAL_LOG_CREATE'&lt;/P&gt;&lt;P&gt;  EXPORTING        i_s_log      = w_loghead&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING        e_log_handle = &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    OTHERS       = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    w_logmsg-msgty = sy-msgty.&lt;/P&gt;&lt;P&gt;    w_logmsg-msgid = u2018Message class nameu2019.&lt;/P&gt;&lt;P&gt;    w_logmsg-msgno = 'Message number'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  w_logmsg-msgv1 = msg_v1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  w_logmsg-msgv2 = msg_v2.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  w_logmsg-msgv3 = msg_v3.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  w_logmsg-msgv4 = msg_v4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   Adding Log&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAL_LOG_MSG_ADD'&lt;/P&gt;&lt;P&gt;      EXPORTING "i_log_handle =&lt;/P&gt;&lt;P&gt;        i_s_msg = w_logmsg&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        OTHERS  = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Saving Log&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAL_DB_SAVE'&lt;/P&gt;&lt;P&gt;      EXPORTING "i_t_log_handle =&lt;/P&gt;&lt;P&gt;        I_SAVE_ALL = 'X'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        OTHERS     = 1.&lt;/P&gt;&lt;P&gt;    COMMIT WORK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Nov 2008 10:21:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-20T10:21:14Z</dc:date>
    <item>
      <title>slg1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slg1/m-p/4756015#M1115449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to use slg1 to display log.Currently using this but not getting anything on output screen.I am using session method.Please tell if this code is fine and we need to write after bdc insert this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF p_prot_mess OCCURS 0.&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE balMI.&lt;/P&gt;&lt;P&gt;DATA: END OF p_prot_mess.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: prot_obj LIKE balhdr-object VALUE 'ZBUDGET_UPLOAD',&lt;/P&gt;&lt;P&gt;sub_obj LIKE balhdr-object VALUE 'ZBUDGET_UPLOAD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF prot_nr OCCURS 0.&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE balnri.&lt;/P&gt;&lt;P&gt;DATA: END OF prot_nr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF prot_head.&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE balhdri.&lt;/P&gt;&lt;P&gt;DATA: END OF prot_head.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: client_role TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'TR_SYS_PARAMS'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;system_client_role = client_role.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'APPL_LOG_INIT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;object = prot_obj&lt;/P&gt;&lt;P&gt;subobject = sub_obj&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prot_head-object = prot_obj.&lt;/P&gt;&lt;P&gt;prot_head-subobject = sub_obj.&lt;/P&gt;&lt;P&gt;prot_head-aldate = syst-datum.&lt;/P&gt;&lt;P&gt;prot_head-altime = syst-uzeit.&lt;/P&gt;&lt;P&gt;prot_head-aluser = syst-uname.&lt;/P&gt;&lt;P&gt;prot_head-altcode = syst-tcode.&lt;/P&gt;&lt;P&gt;prot_head-alprog = syst-repid.&lt;/P&gt;&lt;P&gt;prot_head-aldate_del = syst-datum + 100.&lt;/P&gt;&lt;P&gt;prot_head-del_before = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'APPL_LOG_WRITE_HEADER'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;header = PROT_HEAD&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'APPL_LOG_WRITE_MESSAGES'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;messages = P_PROT_MESS&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;object_not_found = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'APPL_LOG_WRITE_DB'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;object_with_lognumber = PROT_NR&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Nov 2008 16:30:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slg1/m-p/4756015#M1115449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-17T16:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: slg1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slg1/m-p/4756016#M1115450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please use this code if possible....since BAL is much more flexible den APP...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First go to SLG0 and create an Object and sub-object in customer name space. Then write the following code in your programu2026..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: w_loghead TYPE bal_s_log,&lt;/P&gt;&lt;P&gt;             w_logmsg  TYPE bal_s_msg..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_loghead-object     = 'OBJECT NAME'.&lt;/P&gt;&lt;P&gt;w_loghead-subobject  = 'SUBOBJECT NAME'.&lt;/P&gt;&lt;P&gt;w_loghead-aldate_del = sy-datum + 90.                     "expires in 90 days&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Creating LOG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAL_LOG_CREATE'&lt;/P&gt;&lt;P&gt;  EXPORTING        i_s_log      = w_loghead&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING        e_log_handle = &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    OTHERS       = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    w_logmsg-msgty = sy-msgty.&lt;/P&gt;&lt;P&gt;    w_logmsg-msgid = u2018Message class nameu2019.&lt;/P&gt;&lt;P&gt;    w_logmsg-msgno = 'Message number'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  w_logmsg-msgv1 = msg_v1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  w_logmsg-msgv2 = msg_v2.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  w_logmsg-msgv3 = msg_v3.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  w_logmsg-msgv4 = msg_v4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   Adding Log&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAL_LOG_MSG_ADD'&lt;/P&gt;&lt;P&gt;      EXPORTING "i_log_handle =&lt;/P&gt;&lt;P&gt;        i_s_msg = w_logmsg&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        OTHERS  = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Saving Log&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAL_DB_SAVE'&lt;/P&gt;&lt;P&gt;      EXPORTING "i_t_log_handle =&lt;/P&gt;&lt;P&gt;        I_SAVE_ALL = 'X'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        OTHERS     = 1.&lt;/P&gt;&lt;P&gt;    COMMIT WORK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2008 10:21:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slg1/m-p/4756016#M1115450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T10:21:14Z</dc:date>
    </item>
  </channel>
</rss>

