<?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: How do i empty a temporary table? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-empty-a-temporary-table/m-p/516614#M18348</link>
    <description>&lt;P&gt;Have you tried REFRESH IOUT?&lt;/P&gt;</description>
    <pubDate>Mon, 13 Nov 2017 09:01:52 GMT</pubDate>
    <dc:creator>former_member201275</dc:creator>
    <dc:date>2017-11-13T09:01:52Z</dc:date>
    <item>
      <title>How do i empty a temporary table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-empty-a-temporary-table/m-p/516613#M18347</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I am exporting information from Z-table about employee work hours to separate files on the server. The first file it creates is perfect. The second contains both the first lines i exported + the new lines, the 3rd file contains export 1+2+the new.&lt;/P&gt;
  &lt;P&gt;The problem seams to be that the temp file is not empty when it starts each export - it add up the lines all the time. &lt;/P&gt;
  &lt;P&gt;How can i empty the file ("iout") between each export? &lt;/P&gt;
  &lt;P&gt;(i have checked the "iout" and can see that it adds up the lines for each loop)&lt;/P&gt;
  &lt;P&gt;In short the code is like this:&lt;/P&gt;
  &lt;P&gt;Data: i_emplo type standard table of zemplo with header line,&lt;/P&gt;
  &lt;P&gt; i_hours type standard table of zhours with header line,&lt;/P&gt;
  &lt;P&gt;iout type table of string WITH HEADER LINE,&lt;BR /&gt; xout type string,&lt;BR /&gt; xhea type string,&lt;BR /&gt; zfil type string.&lt;/P&gt;
  &lt;P&gt;*&lt;/P&gt;
  &lt;P&gt;SELECT * FROM ZEMPL INTO TABLE I_EMPLO*&lt;/P&gt;
  &lt;P&gt; LOOP AT I_EMPLO&lt;/P&gt;
  &lt;P&gt; FIELD-SYMBOLS: &amp;lt;fs&amp;gt;.&lt;/P&gt;
  &lt;P&gt; CLEAR IOUT.&lt;/P&gt;
  &lt;P&gt; SELECT * FROM ZHOURS INTO TABLE I_HOURS &lt;/P&gt;
  &lt;P&gt; WHERE EMPNO = I_EMPLO-EMPNO.&lt;/P&gt;
  &lt;P&gt; LOOP AT I_HOURS.&lt;/P&gt;
  &lt;P&gt; CLEAR xout.&lt;/P&gt;
  &lt;P&gt; DO.ASSIGN COMPONENT sy-index OF STRUCTURE I_HOURS TO &amp;lt;fs&amp;gt;.&lt;/P&gt;
  &lt;P&gt; IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;
  &lt;P&gt; EXIT.&lt;/P&gt;
  &lt;P&gt; ENDIF.&lt;/P&gt;
  &lt;P&gt; IF sy-index = 1.&lt;BR /&gt; xout = &amp;lt;fs&amp;gt;.&lt;/P&gt;
  &lt;P&gt; ELSE.&lt;/P&gt;
  &lt;P&gt; xout = I_HOURS-TEKST.&lt;/P&gt;
  &lt;P&gt; ENDIF.&lt;/P&gt;
  &lt;P&gt; ENDDO.&lt;/P&gt;
  &lt;P&gt; APPEND xout TO iout.&lt;/P&gt;
  &lt;P&gt; ENDLOOP. &lt;/P&gt;
  &lt;P&gt; CONCATENATE '\\server-name\' I_EMPLO-EMPNO '.txt' INTO ZFIL. &lt;/P&gt;
  &lt;P&gt; OPEN DATASET ZFIL FOR OUTPUT IN TEXT MODE encoding default. &lt;/P&gt;
  &lt;P&gt; LOOP AT IOUT.&lt;/P&gt;
  &lt;P&gt; TRANSFER iout TO ZFIL. &lt;/P&gt;
  &lt;P&gt; ENDLOOP. &lt;/P&gt;
  &lt;P&gt; CLOSE DATASET ZFIL.&lt;/P&gt;
  &lt;P&gt;ENDLOOP.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 08:42:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-empty-a-temporary-table/m-p/516613#M18347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-11-13T08:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do i empty a temporary table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-empty-a-temporary-table/m-p/516614#M18348</link>
      <description>&lt;P&gt;Have you tried REFRESH IOUT?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 09:01:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-empty-a-temporary-table/m-p/516614#M18348</guid>
      <dc:creator>former_member201275</dc:creator>
      <dc:date>2017-11-13T09:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do i empty a temporary table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-empty-a-temporary-table/m-p/516615#M18349</link>
      <description>&lt;P&gt;THANK YOU VERY MUCH:-) I knew it was just a detail;-)&lt;/P&gt;
  &lt;P&gt;Very much appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 09:34:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-empty-a-temporary-table/m-p/516615#M18349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-11-13T09:34:41Z</dc:date>
    </item>
  </channel>
</rss>

