<?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 question. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375285#M184046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes...if you replace into with appending there is no need to use endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Jun 2006 23:25:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-12T23:25:37Z</dc:date>
    <item>
      <title>SELECT question.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375279#M184040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi people, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have more choice to take out the selects from this loop. Now the question is if I insert the data of a select in a internal table when the loop is running like this: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT t_regup INTO wa_regup .

    SELECT  usnam cpudt belnr stblg
     FROM bkpf INTO CORRESPONDING FIELDS OF table t_bkpf1
        WHERE belnr = wa_regup-belnr
        AND   bukrs = wa_regup-bukrs.

     SELECT znme1 lifnr laufd laufi zbukr hbkid   
                 waers zaldt
                 hktid vblnr chect zland rzawe uzawe voidr
      FROM payr INTO CORRESPONDING FIELDS OF table t_payr1
           WHERE  hbkid = wa_regup-hbkid
             AND  hktid = wa_regup-hktid
             AND  zbukr = wa_regup-zbukr
             AND  voidr = ''.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the lines are inserted line by line, so I don't need to use an append?, because I try to not use the 'ENDSELECT.' statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2006 23:15:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375279#M184040</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-12T23:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT question.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375280#M184041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Replace INTO with APPENDING in both the SELECT Statements. Otherwise, the itabs might be overwritten with each loop pass.&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;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2006 23:21:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375280#M184041</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-06-12T23:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT question.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375281#M184042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi structure ur SELECT as follows for better performance..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT t_regup IS INITIAL.&lt;/P&gt;&lt;P&gt;SELECT  usnam cpudt belnr stblg     FROM bkpf INTO CORRESPONDING FIELDS OF table t_bkpf1        &lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_regup &lt;/P&gt;&lt;P&gt;WHERE belnr = t_regup -belnr        AND   &lt;/P&gt;&lt;P&gt;bukrs = t_regup -bukrs.     &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT t_regup IS INITIAL.&lt;/P&gt;&lt;P&gt;SELECT znme1 lifnr laufd laufi zbukr hbkid                    waers zaldt                 hktid vblnr chect zland rzawe uzawe voidr      FROM payr INTO CORRESPONDING FIELDS OF table t_payr1           &lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_regup &lt;/P&gt;&lt;P&gt;WHERE  hbkid = t_regup -hbkid             AND  &lt;/P&gt;&lt;P&gt;hktid = t_regup -hktid             AND  &lt;/P&gt;&lt;P&gt;zbukr = t_regup -zbukr             AND  voidr = ''.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Abdul Hakim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2006 23:23:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375281#M184042</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2006-06-12T23:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT question.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375282#M184043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no need to use an APPEND in your case. As you are populating an internal table in your select. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT....ENDSELECT is like a loop and you have to use APPEND to add record to an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is what you have asked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2006 23:24:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375282#M184043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-12T23:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT question.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375283#M184044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, if I replace the into by the append I don't need to use ENDSELECT statement right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2006 23:24:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375283#M184044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-12T23:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT question.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375284#M184045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2006 23:25:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375284#M184045</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-06-12T23:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT question.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375285#M184046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes...if you replace into with appending there is no need to use endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2006 23:25:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375285#M184046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-12T23:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT question.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375286#M184047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;you could use my above logic to fetch the data from the tables in one shot and keep it in two internal tables and later you can loop thru the two tables based on the key fields and append it to the final table.this will improve ur performance a lot.if you place SELECT query in between LOOP and ENDLOOP it will affect your performance.&lt;/P&gt;&lt;P&gt;Plz check the performance tuning of ABAP programs under the knowledge pool portal &lt;A href="http://help.sap.com" target="test_blank"&gt;http://help.sap.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Abdul Hakim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2006 23:27:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375286#M184047</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2006-06-12T23:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT question.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375287#M184048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before you make any changes, we should know your requirements. The code snippet you have shwon us will overwrite your internal table for each loop pass. That may be what you want if you are processing each line of t_regup individually; however, if you want to get all of your data up front and process it outside of the loop, then you need to do the FOR ALL ENTRIES as suggested by Abdul.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rob Burbank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2006 03:17:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-question/m-p/1375287#M184048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-13T03:17:39Z</dc:date>
    </item>
  </channel>
</rss>

