<?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: Creating a log file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572301#M258354</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are talking about downloading a file,with the error messages,then do,&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF IT_ERRORS OCCURS 0,&lt;/P&gt;&lt;P&gt;         LINE TYPE STRING,&lt;/P&gt;&lt;P&gt;       END OF IT_ERRORS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  IT_ERR0R-LINE = 'file not found'.&lt;/P&gt;&lt;P&gt;  append it_error.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like that you have to append all the errors to IT_ERROR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally based on the user option,use GUI_DOWNLOAD to download this IT_ERROR table to presentation server or USE OPEN DATASET,TRANSFER,CLOSE to download it to application server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Sep 2006 10:57:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-13T10:57:39Z</dc:date>
    <item>
      <title>Creating a log file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572298#M258351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;I have a requirement like to create a error log file.&lt;/P&gt;&lt;P&gt;In my ABAP program If a file does not conatin any data in application server or if the relavant file does not exist in the application server if any Fm gives sy-subrc &amp;lt;&amp;gt; 0 .i have to create a log file and display error messages.How can i create that type of log file in the ABAP program?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 10:45:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572298#M258351</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T10:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a log file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572299#M258352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check these Programs:&lt;/P&gt;&lt;P&gt;SBAL_DEMO_01                   Application Log: Demo program: Simple call&lt;/P&gt;&lt;P&gt;SBAL_DEMO_01_S                 Application Log: Doc: Display program&lt;/P&gt;&lt;P&gt;SBAL_DEMO_02                   Application Log: Demo program: Various ways of collecting message&lt;/P&gt;&lt;P&gt;SBAL_DEMO_02_S                 Application Log: Doc: Display program&lt;/P&gt;&lt;P&gt;SBAL_DEMO_03                   Application Log: Demo program: Get/read data in main memory&lt;/P&gt;&lt;P&gt;SBAL_DEMO_03_S                 Application Log: Doc: Display program&lt;/P&gt;&lt;P&gt;SBAL_DEMO_04                   Application Log: Demo program: Various log formats&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If useful reward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 10:49:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572299#M258352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T10:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a log file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572300#M258353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  declare one internal table with one field of type string&lt;/P&gt;&lt;P&gt;  then append all the errors to one internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; you can download that internal table with errors using GUI_DOWNLOAD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 10:50:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572300#M258353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T10:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a log file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572301#M258354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are talking about downloading a file,with the error messages,then do,&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF IT_ERRORS OCCURS 0,&lt;/P&gt;&lt;P&gt;         LINE TYPE STRING,&lt;/P&gt;&lt;P&gt;       END OF IT_ERRORS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  IT_ERR0R-LINE = 'file not found'.&lt;/P&gt;&lt;P&gt;  append it_error.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like that you have to append all the errors to IT_ERROR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally based on the user option,use GUI_DOWNLOAD to download this IT_ERROR table to presentation server or USE OPEN DATASET,TRANSFER,CLOSE to download it to application server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 10:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572301#M258354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T10:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a log file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572302#M258355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Thnaks. I will try that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 11:10:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572302#M258355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T11:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a log file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572303#M258356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;This post is follow up of previous post regarding creating error log file.&lt;/P&gt;&lt;P&gt;As you told if i create an internal table with one filed,&lt;/P&gt;&lt;P&gt;How can i upload somany errors and how can i seperate them.&lt;/P&gt;&lt;P&gt;For example...i have to raise this many errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.If error in opening file using open data set.&lt;/P&gt;&lt;P&gt;2.if error in reading file using read data set&lt;/P&gt;&lt;P&gt;3.if failed to upload data from file into SAP&lt;/P&gt;&lt;P&gt;So wheere ever i have to raise error i have to upload to that error table.&lt;/P&gt;&lt;P&gt;So all these errors how can identify?..Will they display line by line in itab?..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 09:51:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572303#M258356</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T09:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a log file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572304#M258357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;normally if we get an error we dont proceed with the processing.in this case your error NO 2 will not come if you get error 1. will you agree?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in general, &lt;/P&gt;&lt;P&gt;if you still have many records to be populated that internal table,and you want to distinguish them, &lt;/P&gt;&lt;P&gt;you can added up the FILE NAME along with that text like,(check the below in BOLD)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.If error in opening file using open data set &amp;lt;b&amp;gt;&amp;lt;FILENAME&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;2.if error in reading file using read data set &amp;lt;b&amp;gt;&amp;lt;FILENAME&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you can use CONCATENATE&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CONCATENATE 
'error in opening file using open data set'
  V_FILENAME
  INTO IT_ERROR-TEXT.
append it_error.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Srikanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srikanth Kidambi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 10:00:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572304#M258357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T10:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a log file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572305#M258358</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;Check this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want to capture errors while creating the file. check below code for this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of i_errmsg occurs 0,
        x_msg(100) type c,
       end of i_errmsg.

1.Creating a File

OPEN DATASET x_file FOR output 
                            MESSAGE l_msg
                       IN text MODE ENCODING DEFAULT.
  x_RCODE = sy-subrc. 
  IF x_RCODE &amp;lt;&amp;gt; 0.
    &amp;lt;b&amp;gt;i_errmsg-x_msg = l_msg.
    append i_errmsg.&amp;lt;/b&amp;gt;  
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.Reading the file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET x_file FOR input &lt;/P&gt;&lt;P&gt;                            MESSAGE l_msg&lt;/P&gt;&lt;P&gt;                       IN text MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;  x_RCODE = sy-subrc. &lt;/P&gt;&lt;P&gt;  IF x_RCODE &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    &amp;lt;b&amp;gt;i_errmsg-x_msg = l_msg.&lt;/P&gt;&lt;P&gt;    append i_errmsg.&amp;lt;/b&amp;gt;  &lt;/P&gt;&lt;P&gt;  endif.[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;internal table i_errmsg will contain the error message details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Appana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 10:07:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572305#M258358</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-09-15T10:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a log file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572306#M258359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best soln is to have two fields in your internal table one for ERRID and ERRMSG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code you can populate the ERRMSG with the error text while you can manipulate the ERRID field depending on the type of the error. Eg. Error while opening the file can be FILEOPEN type error. Something related to data can be DATA etc. It purely depends on your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last you can sort the table if you wish to display the error list on type or do not sort if you wish to display the log as in sequence.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 10:12:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-log-file/m-p/1572306#M258359</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T10:12:00Z</dc:date>
    </item>
  </channel>
</rss>

