<?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 Itab binary search not working. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-itab-binary-search-not-working/m-p/7477517#M1555838</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I remember in one of the thread Thomas Zloch saying that binary search must be sorted in ascending order.&lt;/P&gt;&lt;P&gt; Its correct the binary search algorithm divides the data into segements and searched from left to right. If its in descending order your binary search will fail in the first rule itself. ( Remember the traversal is always left to tight )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Dec 2010 06:51:56 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2010-12-06T06:51:56Z</dc:date>
    <item>
      <title>Read Itab binary search not working.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-itab-binary-search-not-working/m-p/7477516#M1555837</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;I have the following issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From a table, I am picking up 5 fields into an internal table (in the correct sequence):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A B C D E.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I am sorting the above internal table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by A B C descnding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I am writing the read stmt as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab into wa_itab with key&lt;/P&gt;&lt;P&gt;                              A = var1&lt;/P&gt;&lt;P&gt;                              B = var2&lt;/P&gt;&lt;P&gt;                              C = car3 &lt;/P&gt;&lt;P&gt;                             Binary Search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, the read fails in most of the cases even though the exact values exist in the itab. It does not fail always, but fails for majority of the cases, though the exact matches are present in the itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I remove the Binary Search option, it works fine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know if I am missing out on anything here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if any more information is needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Anjana Banerjee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Dec 2010 16:20:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-itab-binary-search-not-working/m-p/7477516#M1555837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-05T16:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Read Itab binary search not working.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-itab-binary-search-not-working/m-p/7477517#M1555838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I remember in one of the thread Thomas Zloch saying that binary search must be sorted in ascending order.&lt;/P&gt;&lt;P&gt; Its correct the binary search algorithm divides the data into segements and searched from left to right. If its in descending order your binary search will fail in the first rule itself. ( Remember the traversal is always left to tight )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 06:51:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-itab-binary-search-not-working/m-p/7477517#M1555838</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-12-06T06:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Read Itab binary search not working.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-itab-binary-search-not-working/m-p/7477518#M1555839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sort in Descending order does not give the correct results when using read with binary search. You need to sort it in the ASCENDING order to use binary search.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 07:14:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-itab-binary-search-not-working/m-p/7477518#M1555839</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-06T07:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Read Itab binary search not working.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-itab-binary-search-not-working/m-p/7477519#M1555840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi anjana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please do not ask questions before reading the online help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;["The standard table must be sorted in ascending order by the specified search key. "|http://help.sap.com/saphelp_nw73/helpdata/en/fc/eb373d358411d1829f0000e829fbfe/frameset.htm]&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 07:59:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-itab-binary-search-not-working/m-p/7477519#M1555840</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-12-06T07:59:15Z</dc:date>
    </item>
  </channel>
</rss>

