<?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: Sort before Read with Binary in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183609#M126411</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, it's odd that it just showed up after a hardware upgrade. I suppose that it's possible, that before the upgrade, the records were sorted correctly by some default routine that is not running now. The bottom line is that you're going to have to make sure the table is sorted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jan 2006 02:02:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-01-24T02:02:09Z</dc:date>
    <item>
      <title>Sort before Read with Binary</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183605#M126407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have just updated our hardware to 64 bit. Now all of our programs that do a read with Binary search are failing that DON'T have a sort on them. Is anyone aware of any issues with this, and , should there always be a sort done before a read with Binary search?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2006 22:30:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183605#M126407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-23T22:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sort before Read with Binary</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183606#M126408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it just assumes the data is sorted correctly. If not it should just give a non-zero return code. What sort of failure are you getting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And what release?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rob Burbank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2006 22:35:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183606#M126408</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-23T22:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sort before Read with Binary</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183607#M126409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting a sy-subrc = 4. The record I am trying to read is in the internal table, in debug,  if I view the internal table it looks sorted. But it fails the read. When I put a sort statement in front of the read, sorting by the key I am reading, the program works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2006 00:54:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183607#M126409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-24T00:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sort before Read with Binary</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183608#M126410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PL sort the itab with key you are searching on ie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT &amp;lt;itab&amp;gt; BY &amp;lt;fld&amp;gt;.&lt;/P&gt;&lt;P&gt;READ TABLe &amp;lt;itab&amp;gt; with Key &amp;lt;fld&amp;gt; BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 4 means the required value was not found.&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;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2006 01:03:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183608#M126410</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-01-24T01:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sort before Read with Binary</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183609#M126411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, it's odd that it just showed up after a hardware upgrade. I suppose that it's possible, that before the upgrade, the records were sorted correctly by some default routine that is not running now. The bottom line is that you're going to have to make sure the table is sorted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2006 02:02:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183609#M126411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-24T02:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sort before Read with Binary</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183610#M126412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when you say 'looks sorted' what do you mean? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the structure of your table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For binary seacrh to 'work' the base table must be in the corect order but it doesn't actually have to have achieved this orderly state via a 'sort' command. It could, for example, have got that way from a select with an order by clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How are you populating your table? maybe the old release always happened to fill it in sequence but for some reason no longer does.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2006 02:13:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183610#M126412</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-01-24T02:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sort before Read with Binary</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183611#M126413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;A Binary search is to be used only when the table is already sorted. When you read the SAP documentation, you will find out that the binary search simply assumes that the table you provide is already sorted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is not sorted, like in your case, the search will not dump or anything. Only, it could fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you change the program to have the sort statement before the read statement. Or the other option is you can use a sorted table, so the contents will always be sorted based on the key you specify.&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;Rgds,&lt;/P&gt;&lt;P&gt;Prabhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2006 04:04:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-before-read-with-binary/m-p/1183611#M126413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-24T04:04:03Z</dc:date>
    </item>
  </channel>
</rss>

