<?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 single vs. read table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044597#M1701362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Option b is better. That way all the records are retrieved from the db in an internal table and then further processing is done .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Oct 2012 09:32:40 GMT</pubDate>
    <dc:creator>Azeemquadri</dc:creator>
    <dc:date>2012-10-02T09:32:40Z</dc:date>
    <item>
      <title>select single vs. read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044596#M1701361</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;is there a specific number of loop cycles where you prefer using READ TABLE instead of SELECT SINGLE (inside the LOOP).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example I have an internal table (itab1) with 200.000 rows and loop this internal table.&lt;/P&gt;&lt;P&gt;What do you suggest?&lt;/P&gt;&lt;P&gt;a) 200.000 SELECT SINGLEs on the database&lt;/P&gt;&lt;P&gt;b) Before LOOP: SELECT all entries from the database into another internal table (itab2) where one row of the internal table (itab1) is equal the key of the database table. And then in the LOOP i perform a READ TABLE on the other internal table (itab2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 09:25:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044596#M1701361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-10-02T09:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: select single vs. read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044597#M1701362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Option b is better. That way all the records are retrieved from the db in an internal table and then further processing is done .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 09:32:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044597#M1701362</guid>
      <dc:creator>Azeemquadri</dc:creator>
      <dc:date>2012-10-02T09:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: select single vs. read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044598#M1701363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Better option is option b and while reading internal table use binary search. Binary search should give better performance over linear search.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 09:38:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044598#M1701363</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-10-02T09:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: select single vs. read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044599#M1701364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this option always better or only if there is a specific number of loop cycles?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 09:38:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044599#M1701364</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-10-02T09:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: select single vs. read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044600#M1701365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Getting all the records in one shot is better most of the times.&lt;/P&gt;&lt;P&gt;Even if you have 30 -40 records better to select them in an internal table first and then do the processing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 09:43:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044600#M1701365</guid>
      <dc:creator>Azeemquadri</dc:creator>
      <dc:date>2012-10-02T09:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: select single vs. read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044601#M1701366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I understood well your problem. I'm not sure that option b) it's always valid because maybe you will have some issues with the memory (like not having enough and ending in a short-dump).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I this case with big amounts of data I sugest also to take a look at "OPEN CURSOR" and "FETCH" commands to work with smaller amount of data and avoid killing the memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Valentin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 10:26:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044601#M1701366</guid>
      <dc:creator>valentin_catalin2</dc:creator>
      <dc:date>2012-10-02T10:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: select single vs. read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044602#M1701367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usually I use option b, but not always&lt;/P&gt;&lt;P&gt;- if the secondary table is buffered, why perform a second buffer&lt;/P&gt;&lt;P&gt;- if the secondary table is too big to be stored, memory problems, &lt;/P&gt;&lt;P&gt;- sometimes I use a main SELECT ... PACKAGE SIZE, and in the SELECT/ENDSELECT I perform the select of the secondary table for the records of the package.&lt;/P&gt;&lt;P&gt;- sometime a JOIN in first select performs better than a or b options&lt;/P&gt;&lt;P&gt;- I often write two versions of the program or add a "switch" parameter in the program (if not in a hurry) and perform some stress performance test (in a quality/sandbox system with enough data) (SAT/SE30 and ST05)&lt;/P&gt;&lt;P&gt;- This kind of question would be better posted in sub-space &lt;A _jive_internal="true" href="https://answers.sap.com/community/abap/testing-and-troubleshooting"&gt;ABAP Testing and Troubleshooting&lt;/A&gt; where there are already many threads/documents/questions, start with &lt;A _jive_internal="true" href="https://answers.sap.com/docs/DOC-29218"&gt;FAQ's, intros and memorable discussions in the ABAP Testing and Troubleshooting Space&lt;/A&gt;. (former name was "&lt;SPAN style="font-size: 10pt; font-family: Arial,sans-serif; background-color: #ffffff; color: black;"&gt;ABAP Performance and Tuning" in the good old time of sdn)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 11:27:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044602#M1701367</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2012-10-02T11:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: select single vs. read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044603#M1701368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your helpful answers &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1023/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 13:06:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-table/m-p/9044603#M1701368</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-10-02T13:06:47Z</dc:date>
    </item>
  </channel>
</rss>

