<?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: Select loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408837#M537138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;since you put the same program in select loop. you ll get the last output of the FM in last pass of the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so your approach shud be like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. make a select on table and populate the data in internal table&lt;/P&gt;&lt;P&gt;2. loop at itab into wa.&lt;/P&gt;&lt;P&gt;   use FM using WA&lt;/P&gt;&lt;P&gt;   Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jun 2007 12:28:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-22T12:28:59Z</dc:date>
    <item>
      <title>Select loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408830#M537131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;I try to download all the Reports to a file with the following code.&lt;/P&gt;&lt;P&gt;But it selects only 1 record and then it stops with a runtime error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  Z_DOWNLOAD_REPORTS                                          .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables trdir.&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;F(72) TYPE C,&lt;/P&gt;&lt;P&gt;END OF ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from trdir&lt;/P&gt;&lt;P&gt;where name like 'BA%'.&lt;/P&gt;&lt;P&gt;  READ REPORT trdir-name INTO ITAB.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;  FILENAME = 'C:\PRG.TXT'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;  DATA_TAB = ITAB.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for the help.&lt;/P&gt;&lt;P&gt;Joerg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 12:16:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408830#M537131</guid>
      <dc:creator>joerg_arndt</dc:creator>
      <dc:date>2007-06-22T12:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408831#M537132</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;Dont put any FM call between SELECT and ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do instead use SELECT INTO TABLE and then&lt;/P&gt;&lt;P&gt;data: it_trdir type table trdir.&lt;/P&gt;&lt;P&gt;SELECT * FROM TRDIR INTO TABLE it_trdir where name like 'BA%'.&lt;/P&gt;&lt;P&gt;call the FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = 'C:\PRG.TXT'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 12:19:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408831#M537132</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-06-22T12:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408832#M537133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try removing the select end select loop. Instead, take all programs in to another internal table and loop at that internal table to read the program and download.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if it helps&lt;/P&gt;&lt;P&gt;krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 12:20:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408832#M537133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T12:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Select loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408833#M537134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your GUI_DOWNLOAD statement is inside the select statement thats y , for each record it will excecute the GUI_DOWNLOAD  fm. thts y one record is coming, the error is because of callin the fm in side the select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 12:23:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408833#M537134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T12:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408834#M537135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your GUI_DOWNLOAD statement is inside the select statement thats y , for each record it will excecute the GUI_DOWNLOAD  fm. thts y one record is coming, the error is because of callin the fm in side the select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prabhu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if it is helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 12:23:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408834#M537135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T12:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408835#M537136</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;your code has 2 errors. First of all the GUI_DOWNLOAD probably performs a commit work or something which in turn crash your program. Second since you are giving the same file name your file will be overwriten.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of lt_name occurs 0,&lt;/P&gt;&lt;P&gt;          name like trdir-name,&lt;/P&gt;&lt;P&gt;          end of lt_name.&lt;/P&gt;&lt;P&gt;data: filename type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select name&lt;/P&gt;&lt;P&gt;from trdir into table lt_name&lt;/P&gt;&lt;P&gt;where name like 'BA%'.&lt;/P&gt;&lt;P&gt;loop at lt_name.&lt;/P&gt;&lt;P&gt;READ REPORT lt_name-name INTO ITAB.&lt;/P&gt;&lt;P&gt;filename = lt_name-name.&lt;/P&gt;&lt;P&gt;condense filename no-gaps.&lt;/P&gt;&lt;P&gt;concatenate ''C:\' filename '.txt' into filename.&lt;/P&gt;&lt;P&gt;condense filename no-gaps.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = filename&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = ITAB.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Kostas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Kostas Tsioubris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 12:24:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408835#M537136</guid>
      <dc:creator>kostas_tsioubris</dc:creator>
      <dc:date>2007-06-22T12:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408836#M537137</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;Remove the FM from Select... EndSelect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead use &lt;/P&gt;&lt;P&gt;REPORT Z_DOWNLOAD_REPORTS .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables trdir.&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;F(72) TYPE C,&lt;/P&gt;&lt;P&gt;END OF ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM TRDIR INTO TABLE ITAB&lt;/P&gt;&lt;P&gt;WHERE NAME LIKE 'BA%'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = 'C:\PRG.TXT'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 12:26:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408836#M537137</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T12:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408837#M537138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;since you put the same program in select loop. you ll get the last output of the FM in last pass of the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so your approach shud be like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. make a select on table and populate the data in internal table&lt;/P&gt;&lt;P&gt;2. loop at itab into wa.&lt;/P&gt;&lt;P&gt;   use FM using WA&lt;/P&gt;&lt;P&gt;   Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 12:28:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408837#M537138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T12:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408838#M537139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 13:06:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-loop/m-p/2408838#M537139</guid>
      <dc:creator>joerg_arndt</dc:creator>
      <dc:date>2007-06-22T13:06:30Z</dc:date>
    </item>
  </channel>
</rss>

