<?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: hello, everybody, regarding a  BINARY SEARCH. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565670#M858092</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;check this link,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4697475"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Mar 2008 08:06:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-27T08:06:43Z</dc:date>
    <item>
      <title>hello, everybody, regarding a  BINARY SEARCH.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565669#M858091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts: &lt;/P&gt;&lt;P&gt;Thank you in advance for all your replies. &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;     READ TABLE VALUE WITH KEY KONPKEY BINARY SEARCH.&lt;/P&gt;&lt;P&gt;     how does this statement work? would you please explain it with an example?  cheers &lt;/P&gt;&lt;P&gt; couldn't thank you more. &lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2008 08:03:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565669#M858091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-27T08:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: hello, everybody, regarding a  BINARY SEARCH.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565670#M858092</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;check this link,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4697475"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2008 08:06:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565670#M858092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-27T08:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: hello, everybody, regarding a  BINARY SEARCH.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565671#M858093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Make sure that the internal table that is used for READ statement should be sorted(either manually using SORT statement or using a SORTED internal table declaration)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Suppose there are values in internal table itab like &lt;/P&gt;&lt;P&gt; 1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;Here When u use READ TABLE itab WITH KEY (fieldname) = ' value ' BINARY SERACH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It finds out which is the lowest and highest value ie low = 1 and high = 7.&lt;/P&gt;&lt;P&gt;Now it finds the middle value low + high / 2         ie 1 + 7 / 2 = 4&lt;/P&gt;&lt;P&gt;Then it checks IF mid &amp;gt; value &lt;/P&gt;&lt;P&gt;                        then it returns values 1 2 3 (hope u got it)&lt;/P&gt;&lt;P&gt;                     elseif   mid &amp;lt; value.&lt;/P&gt;&lt;P&gt;                        then it returns values 5 6 7&lt;/P&gt;&lt;P&gt;                     elseif mid = value.&lt;/P&gt;&lt;P&gt;                        then it returns 4&lt;/P&gt;&lt;P&gt;                     endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works as the same n required times&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neeraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2008 08:15:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565671#M858093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-27T08:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: hello, everybody, regarding a  BINARY SEARCH.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565672#M858094</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 example in your internal table you have 100 records.You want to Read  80th record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE ITAB WITH KEY num = '80' BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of searching till 80th record,First  system will divide the reocrds half .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;means 1- 50       and 51-100.  Now system will compare the records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;80 will be in between the 51-100.Again sytem wil divide the records half. 51-75    and 76-100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again system will divide the records again half  76-88  and 89 to 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like that it will check with the number(80) .So searchnig will be fast.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE. For correct result  you have sort the internal table .Othewise you will get wrong result&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2008 08:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565672#M858094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-27T08:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: hello, everybody, regarding a  BINARY SEARCH.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565673#M858095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the command binary search will work if the no of records is very huge ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it will read the value  with the key value ...if it had 1000000 records if it is binary search in the first hit it checks in the first 50000 and if it is not available again it will search in the next 25000 records if it is not available in the next hit it will search in the next 12500 it is not available it will search in the next 6250 ..like this ..with in the 10 hits or just more it will catch the cxact record...it will improve the performance time of the program..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2008 08:17:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hello-everybody-regarding-a-binary-search/m-p/3565673#M858095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-27T08:17:07Z</dc:date>
    </item>
  </channel>
</rss>

