<?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: quick table seacrh... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713250#M311910</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to add to Michael's solution, add the words BINARY SEARCH to the READ statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;read table itab_2 with key field1 = itab_1-field1
                           field2 = itab_1-field2
                                 &amp;lt;b&amp;gt; BINARY SEARCH&amp;lt;/b&amp;gt;.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Nov 2006 15:08:59 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-11-07T15:08:59Z</dc:date>
    <item>
      <title>quick table seacrh...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713247#M311907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all. I'm looping over itab_1 into wa_itab_1. I want to select a single row of data from itab_2 based on a value in wa_itab_1. I don't need to llop over both tables do I? Isn't there a more terse way of selecting the record from itab_2?&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;Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 15:05:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713247#M311907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T15:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: quick table seacrh...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713248#M311908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
read table itab_2 with key field1 = wa_itab_1-field1
                           field2 = wa_itab_1-field2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your table is sorted by field1 and field2, you can add the BINARY SEARCH option to speed up the read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
read table itab_2 with key field1 = wa_itab_1-field1
                           field2 = wa_itab_1-field2
                           binary search.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Michael Malvey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 15:07:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713248#M311908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T15:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: quick table seacrh...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713249#M311909</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;loop at tb1 into struct&lt;/P&gt;&lt;P&gt;read tab2 into struct2with key keyparam = struct-value.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;row found&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;grtz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Koen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 15:08:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713249#M311909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T15:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: quick table seacrh...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713250#M311910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to add to Michael's solution, add the words BINARY SEARCH to the READ statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;read table itab_2 with key field1 = itab_1-field1
                           field2 = itab_1-field2
                                 &amp;lt;b&amp;gt; BINARY SEARCH&amp;lt;/b&amp;gt;.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 15:08:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713250#M311910</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-07T15:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: quick table seacrh...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713251#M311911</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;You can use the read statement to get the corresponding single record of the second table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab_2 into wa_itab_2 with key field1 = wa_itab_1-field1&lt;/P&gt;&lt;P&gt;                                          ...&lt;/P&gt;&lt;P&gt;                                          binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you are using binary search make sure you are sorting the internal table by the order of the fields which are used in the read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using binary search is the quicker than the nomal read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satya,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 15:12:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quick-table-seacrh/m-p/1713251#M311911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T15:12:53Z</dc:date>
    </item>
  </channel>
</rss>

