<?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: Read Table itab using key .....with Binary Search? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587757#M264828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;For binary search, you basically sort the internal table first.&lt;/P&gt;&lt;P&gt;Then the internal logic for binary search is that program splits internal table into 2 parts and does match in first part. If required key is not found, then the other half is used for search so in short you are splitting the internal table for lookup. This increases the performance of search and lookup. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vikram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward for helpful replies!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Sep 2006 20:18:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-13T20:18:47Z</dc:date>
    <item>
      <title>Read Table itab using key .....with Binary Search?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587751#M264822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly does adding the "Binary Search" syntax do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 20:13:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587751#M264822</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T20:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab using key .....with Binary Search?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587752#M264823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically it uses the binary search logic to find the exact match. In short, it uses the binary search logic to find the exact record from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 20:14:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587752#M264823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T20:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab using key .....with Binary Search?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587753#M264824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The binary search algorithm helps faster search of a value in an internal table. It is advisable to sort the internal table before doing a binary search. Binary search repeatedly divides the search interval in half. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value to be searched is less than the item in the middle of the interval, the search is narrowed to the lower half, otherwise the search is narrowed to the upper half. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not Recommended&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Read table int_fligh with key airln = 'LF'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Recommended&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Read table int_fligh with key airln = 'LF' binary   search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 20:14:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587753#M264824</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2006-09-13T20:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab using key .....with Binary Search?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587754#M264825</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;  When you specify the binary search it uses this search technique with the fields given in the with key option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The fields that you specify in the with key option needs to be sorted in the order in which you specify..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 20:14:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587754#M264825</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T20:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab using key .....with Binary Search?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587755#M264826</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;WITH KEY = dobj [BINARY SEARCH] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect:,If the addition WITH KEY is followed by a single data object after an "equals" sign, the first line found in the internal table itab is read, whose whole content corresponds to the content of the data object dobj. It must be possible to convert the data object dobj to the line type of the internal table. If the data type of dobj does not correspond to the line type of the internal table, a conversion is performed for the comparison according to the conversion rules. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Azaz Ali.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 20:15:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587755#M264826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T20:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab using key .....with Binary Search?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587756#M264827</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;It can improve the peformance of READ TABLE statament because a "Binary" strategy is used to read the internal table, but to use this option the table has to be sorted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB by FIELD1 FIELD2 .... FIELDN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE ITAB WITH KEY FIELD1 =&lt;/P&gt;&lt;P&gt;                         FIELD2 =&lt;/P&gt;&lt;P&gt;.................................&lt;/P&gt;&lt;P&gt;                         FIELDN =&lt;/P&gt;&lt;P&gt;                         binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 20:15:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587756#M264827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T20:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab using key .....with Binary Search?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587757#M264828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;For binary search, you basically sort the internal table first.&lt;/P&gt;&lt;P&gt;Then the internal logic for binary search is that program splits internal table into 2 parts and does match in first part. If required key is not found, then the other half is used for search so in short you are splitting the internal table for lookup. This increases the performance of search and lookup. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vikram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward for helpful replies!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 20:18:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587757#M264828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T20:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab using key .....with Binary Search?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587758#M264829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) BINARY SEARCH clause with READ statement improves the performance.&lt;/P&gt;&lt;P&gt;2) You need to SORT the internal table with specific fields before using BINARY SEARCH clause with READ statement&lt;/P&gt;&lt;P&gt;3) Otherwise, it leads to improper results&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To know more about READ statement with BINARY SEARCH clause, browse this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/read_t01.htm" target="test_blank"&gt;http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/read_t01.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 20:25:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab-using-key-with-binary-search/m-p/1587758#M264829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T20:25:29Z</dc:date>
    </item>
  </channel>
</rss>

