<?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: LOOP Vs READ TABLE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-vs-read-table/m-p/4585101#M1081579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can you should use sorted tables, because you get automatically the BINARY SEARCH fast and always correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Runtime of READ with key (full table key or only first fields) will be similar to LOOP WHERE (same fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if the key is non-unique or you have only a part of the key it is also o.k.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stanard table with BINARY SEARCH is slightly faster, but we are talking about microseconds, so forgetr the difference.&lt;/P&gt;&lt;P&gt;There you must take about the sorting, either you do it too often and waste a lot of time or to rarely with incorrect results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; If possible, then you should always use sorted tables!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Sep 2008 13:22:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-29T13:22:43Z</dc:date>
    <item>
      <title>LOOP Vs READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-vs-read-table/m-p/4585098#M1081576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When there is a Sorted Internal Table, is Looping and Fetching a single record is better or to use a READ TABLE with BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Kasi Raaman.R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 13:06:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-vs-read-table/m-p/4585098#M1081576</guid>
      <dc:creator>former_member362012</dc:creator>
      <dc:date>2008-09-29T13:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP Vs READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-vs-read-table/m-p/4585099#M1081577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For single records -&amp;gt; READ TABLE.&lt;/P&gt;&lt;P&gt;BINARY SEARCH is not necessary for sorted tables (declared as such!), it is already implicit when using addition WITH TABLE KEY.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 13:09:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-vs-read-table/m-p/4585099#M1081577</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-29T13:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP Vs READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-vs-read-table/m-p/4585100#M1081578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read table with the Binary Key will be better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try this in SE30. Create two small programs and run the performance test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 13:10:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-vs-read-table/m-p/4585100#M1081578</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2008-09-29T13:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP Vs READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-vs-read-table/m-p/4585101#M1081579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can you should use sorted tables, because you get automatically the BINARY SEARCH fast and always correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Runtime of READ with key (full table key or only first fields) will be similar to LOOP WHERE (same fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if the key is non-unique or you have only a part of the key it is also o.k.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stanard table with BINARY SEARCH is slightly faster, but we are talking about microseconds, so forgetr the difference.&lt;/P&gt;&lt;P&gt;There you must take about the sorting, either you do it too often and waste a lot of time or to rarely with incorrect results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; If possible, then you should always use sorted tables!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 13:22:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-vs-read-table/m-p/4585101#M1081579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-29T13:22:43Z</dc:date>
    </item>
  </channel>
</rss>

