<?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: regarding empty file. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892226#M53587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about checking your LINE before you open your dataset?  Once you open the file, regardless of whether you have data, the file will be created. Are you using LINE as an internal table.  If so, maybe use the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHECK NOT LINE[] IS INITIAL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is no data in your table your file logic will be passed.  That is assuming that is the remainder of your code for that particular part of your program (FORM).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Terry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Apr 2005 13:10:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-04-26T13:10:55Z</dc:date>
    <item>
      <title>regarding empty file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892223#M53584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai,&lt;/P&gt;&lt;P&gt;Using open dataset statement i have created text file (refer code snippet)&lt;/P&gt;&lt;P&gt;problem here is,if line does not have value then i get&lt;/P&gt;&lt;P&gt;0 byte text file created.&lt;/P&gt;&lt;P&gt;i want to avoid this empty file. how to do this.&lt;/P&gt;&lt;P&gt;if textfile does not have value then it should not be created.&lt;/P&gt;&lt;P&gt;code snippet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset file.&lt;/P&gt;&lt;P&gt;Transfer line to file.&lt;/P&gt;&lt;P&gt;close dataset file.&lt;/P&gt;&lt;P&gt;ambichan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: ambi chan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2005 13:00:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892223#M53584</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-26T13:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: regarding empty file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892224#M53585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check whether file[] is initial before going into the code that creates the file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not file[] is initial.&lt;/P&gt;&lt;P&gt;  code to create file.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also do a describe on the table as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;James.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2005 13:04:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892224#M53585</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-26T13:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: regarding empty file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892225#M53586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check the content of &amp;lt;b&amp;gt;line&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not line[]/line is  initial.&lt;/P&gt;&lt;P&gt;open dataset file.&lt;/P&gt;&lt;P&gt;Transfer line to file.&lt;/P&gt;&lt;P&gt;close dataset file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2005 13:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892225#M53586</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2005-04-26T13:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: regarding empty file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892226#M53587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about checking your LINE before you open your dataset?  Once you open the file, regardless of whether you have data, the file will be created. Are you using LINE as an internal table.  If so, maybe use the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHECK NOT LINE[] IS INITIAL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is no data in your table your file logic will be passed.  That is assuming that is the remainder of your code for that particular part of your program (FORM).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Terry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2005 13:10:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892226#M53587</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-26T13:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: regarding empty file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892227#M53588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the number of line if you have an internal table ( describle table itab lines w_line.&lt;/P&gt;&lt;P&gt;check w_lines ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can check the line you transfer are not equal to 'space'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You seem to have only one line ( regarding your code ) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if line ne space&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  open dataset file.&lt;/P&gt;&lt;P&gt;    Transfer line to file.&lt;/P&gt;&lt;P&gt;  close dataset file.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2005 13:12:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892227#M53588</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-26T13:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: regarding empty file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892228#M53589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is what I would so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;for internal table approach (data is in a internal table)&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at itab.&lt;/P&gt;&lt;P&gt;at first.&lt;/P&gt;&lt;P&gt;open dataset file.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;move itab to line.&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;transfer line to file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at last.&lt;/P&gt;&lt;P&gt;close dataset file.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;endloop&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;no internal table&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;if not line is initial.&lt;/P&gt;&lt;P&gt;open dataset file.&lt;/P&gt;&lt;P&gt;Transfer line to file.&lt;/P&gt;&lt;P&gt;close dataset file.&lt;/P&gt;&lt;P&gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rishi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2005 18:51:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-empty-file/m-p/892228#M53589</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-26T18:51:54Z</dc:date>
    </item>
  </channel>
</rss>

