<?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: Binary search option with Read statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285349#M785823</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SANDY , &lt;/P&gt;&lt;P&gt;  The order of sorting does not matter .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check out how the Binary search technique works , so that you can understand it better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jan 2008 05:30:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-10T05:30:17Z</dc:date>
    <item>
      <title>Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285341#M785815</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;There are any chances that the &lt;STRONG&gt;Read&lt;/STRONG&gt; statement with &lt;STRONG&gt;Binary search&lt;/STRONG&gt; option to fail, even though the key exists??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the itab is sorted in descending order. and then some duplicates are removed using the &lt;STRONG&gt;delete adjacent&lt;/STRONG&gt; statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sandhip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 04:58:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285341#M785815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T04:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285342#M785816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;No it cannot fail unless there is no matching record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check ones again the record exist in both the tables( loop table and Read table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;revrt back if any issues&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:05:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285342#M785816</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T05:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285343#M785817</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;And make sure the table is sorted by the same key which is used in the binary Search.. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sonal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:08:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285343#M785817</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T05:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285344#M785818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sandy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are no chances that a read statement fails because of binary search&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem may come with With Key ... binary search is used to increase the searching process&lt;/P&gt;&lt;P&gt;Before using Binary search first sort your internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Donot forgot to reward points if helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:10:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285344#M785818</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T05:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285345#M785819</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 the following program:&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;COL1 TYPE I,&lt;/P&gt;&lt;P&gt;COL2 TYPE I,&lt;/P&gt;&lt;P&gt;END OF LINE.&lt;/P&gt;&lt;P&gt;DATA ITAB LIKE STANDARD TABLE OF LINE.&lt;/P&gt;&lt;P&gt;DO 4 TIMES.&lt;/P&gt;&lt;P&gt;LINE-COL1 = SY-INDEX.&lt;/P&gt;&lt;P&gt;LINE-COL2 = SY-INDEX ** 2.&lt;/P&gt;&lt;P&gt;APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;SORT ITAB BY COL2.&lt;/P&gt;&lt;P&gt;READ TABLE ITAB WITH KEY COL2 = 20 INTO LINE BINARY SEARCH.&lt;/P&gt;&lt;P&gt;WRITE: 'SY-SUBRC =', SY-SUBRC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program fills a standard table with a list of square numbers and sorts them into ascending order by field COL2. The READ statement uses a binary search to look for and find the line in the table where COL2 has the value 20. The sy-subrc is 8 because its fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285345#M785819</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T05:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285346#M785820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table should be sorted in Ascending order&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also make sure Key for sort and binary search should be same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mohaiyuddin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:12:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285346#M785820</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T05:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285347#M785821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naveen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more clarification.. the order of sorting matters or not??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sandhip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:28:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285347#M785821</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T05:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285348#M785822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort table by the same key with which the table is read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;kushagra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:30:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285348#M785822</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T05:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285349#M785823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SANDY , &lt;/P&gt;&lt;P&gt;  The order of sorting does not matter .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check out how the Binary search technique works , so that you can understand it better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:30:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285349#M785823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T05:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285350#M785824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When u Binary Search with a Key make sure you have first sorted your internal table with the same Key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sonal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:31:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285350#M785824</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T05:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285351#M785825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No matter of sorting for Binary Search. If U sort ascending and ur value is in first half, the search moves to the top half of the records and if u sort in descending order, search moves to the last half and proceeds further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;awrd points if helpful&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bhupal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:32:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285351#M785825</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T05:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285352#M785826</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;Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab1 by a b c.&lt;/P&gt;&lt;P&gt;loop at itab2 into wa_itab2.&lt;/P&gt;&lt;P&gt;  read table itab1 into wa_itab1&lt;/P&gt;&lt;P&gt;                   with key a = wa_itab2-a&lt;/P&gt;&lt;P&gt;                            b = wa_itab2-b&lt;/P&gt;&lt;P&gt; 			    c = wa_itab2-c&lt;/P&gt;&lt;P&gt; 			        binary search.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    wa_output-a = wa_itab1-a.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another alternative is to use sorted tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. Please award points if it helps...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 05:34:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285352#M785826</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2008-01-10T05:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Binary search option with Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285353#M785827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sanddy,&lt;/P&gt;&lt;P&gt;In binary search the table entreis are divided into two equal parts and it will search for data in only one half depending on comparision of the middle value with value you entered.so for this searching type table must be sorted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for any doubt plz reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 06:06:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/binary-search-option-with-read-statement/m-p/3285353#M785827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T06:06:18Z</dc:date>
    </item>
  </channel>
</rss>

