<?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: PERFORME in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performe/m-p/3498192#M841435</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you read entries from standard tables using a key other than the default key, you can use a binary search instead of the normal linear search. To do this, include the addition BINARY SEARCH in the corresponding READ statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;itab&amp;gt; WITH KEY &amp;lt;k1&amp;gt; = &amp;lt;f1&amp;gt;... &amp;lt;kn&amp;gt; = &amp;lt;fn&amp;gt; &amp;lt;result&amp;gt; &lt;/P&gt;&lt;P&gt;                                                       BINARY SEARCH.&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. The BINARY SEARCH addition means that you can access an entry in a standard table by its key as quickly as you would be able to in a sorted table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_int_tables_read_index_bin.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;DATA itab LIKE STANDARD TABLE OF line.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;SORT itab BY col2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE itab WITH KEY col2 = 16 INTO line BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'SY-SUBRC =', sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC =    0&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 16. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Mar 2008 20:02:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-13T20:02:54Z</dc:date>
    <item>
      <title>PERFORME</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performe/m-p/3498191#M841434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PLS GIVE ME ONE EXAMPLE USING BINARY SEARCH PROGRAM CODE? MEANS EXPLAIN ME HOW IT WORKS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 19:56:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performe/m-p/3498191#M841434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T19:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: PERFORME</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performe/m-p/3498192#M841435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you read entries from standard tables using a key other than the default key, you can use a binary search instead of the normal linear search. To do this, include the addition BINARY SEARCH in the corresponding READ statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;itab&amp;gt; WITH KEY &amp;lt;k1&amp;gt; = &amp;lt;f1&amp;gt;... &amp;lt;kn&amp;gt; = &amp;lt;fn&amp;gt; &amp;lt;result&amp;gt; &lt;/P&gt;&lt;P&gt;                                                       BINARY SEARCH.&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. The BINARY SEARCH addition means that you can access an entry in a standard table by its key as quickly as you would be able to in a sorted table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_int_tables_read_index_bin.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;DATA itab LIKE STANDARD TABLE OF line.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;SORT itab BY col2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE itab WITH KEY col2 = 16 INTO line BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'SY-SUBRC =', sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC =    0&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 16. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 20:02:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performe/m-p/3498192#M841435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T20:02:54Z</dc:date>
    </item>
  </channel>
</rss>

