<?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 using binary search in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562910#M1076994</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;   What are the fields that you are using in Read table WITH KEY, the internal table must be sorted with those KEY fields first. If you want to use multiple Read table statements and each time you need to read it by different keys, then make temporary tables of same type and pass the data to those new internal tables then sort those with keys and use those tables in the loop statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Bujji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Sep 2008 08:22:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-22T08:22:51Z</dc:date>
    <item>
      <title>Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562904#M1076988</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 an internal table itab on which I am using READ inside a loop. The READ on itab is being used multiple times inside the loop with different keys.&lt;/P&gt;&lt;P&gt;I have sorted itab with 3 keys before the loop. In one of the READs I am using all the 3 keys but in another READ I am using first 2 keys only. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So is the code fine with BINARY SEARCH on these READs cos I have sorted with 3 keys but Reading with 2 keys in some places.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know your suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:11:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562904#M1076988</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T08:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562905#M1076989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Always use READ statement with Binary Search to avoid performance issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sudharshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:13:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562905#M1076989</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T08:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562906#M1076990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Please let me know your suggestions.&lt;/P&gt;&lt;P&gt;&amp;gt; Abhishek&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What Suggestions you need?&lt;/P&gt;&lt;P&gt;I don't think you asked anything in your question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:16:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562906#M1076990</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T08:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562907#M1076991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;binary search is pre requisit for read.&lt;/P&gt;&lt;P&gt;check this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb373d358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb373d358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Anirban&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:17:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562907#M1076991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T08:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562908#M1076992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to know that if I sort an internal table with 3 keys but in the READ I use the first 2 keys then is it fine to BINARY SEARCH in this READ or not as I dont have the full keys in READ as in the SORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562908#M1076992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T08:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562909#M1076993</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;This is because when you have sorted the table with 3 keys and using binary search reading with two fields...it might show abnormal results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus before reading the table with two keys ..sort the table with same two keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Parul.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:19:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562909#M1076993</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T08:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562910#M1076994</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;   What are the fields that you are using in Read table WITH KEY, the internal table must be sorted with those KEY fields first. If you want to use multiple Read table statements and each time you need to read it by different keys, then make temporary tables of same type and pass the data to those new internal tables then sort those with keys and use those tables in the loop statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Bujji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:22:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562910#M1076994</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T08:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562911#M1076995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need to add BINARY SEARCH to your READ statement when working with a sorted table and read WITH TABLE KEY. It's always an implicit binary search.&lt;/P&gt;&lt;P&gt;If you use the &lt;U&gt;first two fields&lt;/U&gt; of a three field table key, performance should be OK. You might not get a unique entry though with READ, so maybe a LOOP AT ... WHERE would be better here?&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:25:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562911#M1076995</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-22T08:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562912#M1076996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it will work if you have exactly don what you have said. it will not work if you READ with 2nd and 3rd key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:30:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562912#M1076996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T08:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562913#M1076997</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;For the binary search, the table must be sorted by the specified search key in ascending order. Otherwise the search will not find the correct row.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:32:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562913#M1076997</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T08:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562914#M1076998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know whu i couldn't edit my previous post...so I'am posting again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to visualize the binary search algorithm then it will be clear to you that this will work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 08:53:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562914#M1076998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T08:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562915#M1076999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Abishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorting with three fields and reading with first two fields using binary search will work very much fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Farzan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2008 04:46:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562915#M1076999</guid>
      <dc:creator>former_member137336</dc:creator>
      <dc:date>2008-09-24T04:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562916#M1077000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,  &lt;/P&gt;&lt;P&gt;   Remember always use the same keys in sorting whenever you are using binary search else reduce performance &amp;amp; data may erronous.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Krishna...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2008 04:59:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562916#M1077000</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-24T04:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Read using binary search</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562917#M1077001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no problem searching with 2 keys. you will only get 1 record where there is the possibility that more records meet your search-values. But that is also possible with 3 keys if they do not uniquely identify each record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Guido&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2008 10:06:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-using-binary-search/m-p/4562917#M1077001</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-24T10:06:29Z</dc:date>
    </item>
  </channel>
</rss>

