<?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 about mest loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-mest-loop/m-p/2322884#M510154</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi forks,&lt;/P&gt;&lt;P&gt;   i have some doubts about the nest loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i write the code in this type &lt;/P&gt;&lt;P&gt;  loop at itab1 into lfc_itab1.&lt;/P&gt;&lt;P&gt;     loop at itab2 into lfc_itab2 where k1 = lfc_itab1-k1.&lt;/P&gt;&lt;P&gt;         ......&lt;/P&gt;&lt;P&gt;     endloop.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;but my leader told me to write in this way&lt;/P&gt;&lt;P&gt;sort itab2 by k1 ascending.&lt;/P&gt;&lt;P&gt;loop at itab1 into lfc_itab1.&lt;/P&gt;&lt;P&gt;  read table itab2 with key k1 = lfc_itab1-k1 binary seach.&lt;/P&gt;&lt;P&gt;  li_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;  loop at itab2 form  li_tabix.&lt;/P&gt;&lt;P&gt;    if lfc_itab1-k1 = lfc_itab2-k1.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;i also agree with what he said,but i write test code&lt;/P&gt;&lt;P&gt;it return the opposite result .i use record (100&lt;STRONG&gt;100,1000&lt;/STRONG&gt;1000,10000*10000)&lt;/P&gt;&lt;P&gt;dose anyone tell which will be better&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jun 2007 07:08:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-11T07:08:38Z</dc:date>
    <item>
      <title>about mest loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-mest-loop/m-p/2322884#M510154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi forks,&lt;/P&gt;&lt;P&gt;   i have some doubts about the nest loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i write the code in this type &lt;/P&gt;&lt;P&gt;  loop at itab1 into lfc_itab1.&lt;/P&gt;&lt;P&gt;     loop at itab2 into lfc_itab2 where k1 = lfc_itab1-k1.&lt;/P&gt;&lt;P&gt;         ......&lt;/P&gt;&lt;P&gt;     endloop.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;but my leader told me to write in this way&lt;/P&gt;&lt;P&gt;sort itab2 by k1 ascending.&lt;/P&gt;&lt;P&gt;loop at itab1 into lfc_itab1.&lt;/P&gt;&lt;P&gt;  read table itab2 with key k1 = lfc_itab1-k1 binary seach.&lt;/P&gt;&lt;P&gt;  li_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;  loop at itab2 form  li_tabix.&lt;/P&gt;&lt;P&gt;    if lfc_itab1-k1 = lfc_itab2-k1.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;i also agree with what he said,but i write test code&lt;/P&gt;&lt;P&gt;it return the opposite result .i use record (100&lt;STRONG&gt;100,1000&lt;/STRONG&gt;1000,10000*10000)&lt;/P&gt;&lt;P&gt;dose anyone tell which will be better&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 07:08:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-mest-loop/m-p/2322884#M510154</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T07:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: about mest loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-mest-loop/m-p/2322885#M510155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can u send me the full code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 logic is better than 1st logic&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 07:39:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-mest-loop/m-p/2322885#M510155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T07:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: about mest loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-mest-loop/m-p/2322886#M510156</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;In ur case second logic is better , first one is call as LINEAR SEARCH and asecond one is called as BINARY SEARCH. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in LINEAR search ALL entries of itab are processed where as in Binary search entries processaed are logrihtm in no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Binary serach is like getting desired page in a book using index, say if u want to search 41st page in 100 page book so in binary seach, if u opeend first time at 50 then it will search first half only, in second pas if u opened 30 page then it iwll search second half and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 11:46:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-mest-loop/m-p/2322886#M510156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T11:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: about mest loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-mest-loop/m-p/2322887#M510157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The second logic is better, but still has problems. Check:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to exit the inner loop if the keys are not equal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 13:43:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-mest-loop/m-p/2322887#M510157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T13:43:19Z</dc:date>
    </item>
  </channel>
</rss>

