<?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 Creating log files in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-log-files/m-p/2013684#M411276</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;   I want  the success and error messages returned by bapi to be recorded and viewed as a log file.Can anyone help me on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Mar 2007 13:10:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-07T13:10:09Z</dc:date>
    <item>
      <title>Creating log files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-log-files/m-p/2013684#M411276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;   I want  the success and error messages returned by bapi to be recorded and viewed as a log file.Can anyone help me on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2007 13:10:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-log-files/m-p/2013684#M411276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-07T13:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Creating log files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-log-files/m-p/2013685#M411277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Jayanth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please populate a internal table with the log entries,  write a small program to write to the list using ALV if you like or download to the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2007 13:16:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-log-files/m-p/2013685#M411277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-07T13:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating log files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-log-files/m-p/2013686#M411278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jeyanth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can do like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
        DATA: G_S_LOG TYPE BAL_S_LOG,
              G_LOG_HANDLE TYPE BALLOGHNDL,
              G_DUMMY TYPE C.
        DATA: L_S_MSG TYPE BAL_S_MSG,
              LOGNUMBER TYPE BAL_T_LGNM,
              WA_LOGNUMBER LIKE BAL_S_LGNM,
              LT_BALLOGHNDL TYPE BAL_T_LOGH. "Log handle internal table
        DATA: LV_EXT LIKE G_S_LOG-EXTNUMBER.
* Define header data of this log
        CONCATENATE LT_EKPO-EBELN '/' LT_EKPO-EBELP SY-MSGID SY-MSGNO
        SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
        INTO LV_EXT SEPARATED BY SPACE.
        G_S_LOG-EXTNUMBER = LV_EXT.
        G_S_LOG-OBJECT = 'Z48MMIGO'.
        G_S_LOG-SUBOBJECT = 'ZKB11N'.
        G_S_LOG-ALDATE = SY-DATUM.
        G_S_LOG-ALTIME = SY-UZEIT.
        G_S_LOG-ALUSER = SY-UNAME.
        G_S_LOG-ALPROG = SY-REPID.
* Create a log
        CALL FUNCTION 'BAL_LOG_CREATE'
             EXPORTING
                  I_S_LOG      = G_S_LOG
             IMPORTING
                  E_LOG_HANDLE = G_LOG_HANDLE
             EXCEPTIONS
                  OTHERS       = 1.
        IF SY-SUBRC NE 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.

        CALL FUNCTION 'BAL_DB_SAVE'
             EXPORTING
                  I_CLIENT         = SY-MANDT
                  I_SAVE_ALL       = 'X'
                  I_T_LOG_HANDLE   = LT_BALLOGHNDL
             IMPORTING
                  E_NEW_LOGNUMBERS = LOGNUMBER
             EXCEPTIONS
                  LOG_NOT_FOUND    = 1
                  SAVE_NOT_ALLOWED = 2
                  NUMBERING_ERROR  = 3
                  OTHERS           = 4.

      ENDIF.
    ENDIF.

BUt for this u need to create a OBJECT &amp;amp; SUBOBJECT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If useful reward.&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2007 13:18:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-log-files/m-p/2013686#M411278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-07T13:18:55Z</dc:date>
    </item>
  </channel>
</rss>

