<?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: Performance in Nested Loops in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074389#M1505071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; Parallel cursor is the best option for nested loop. It sho&lt;/P&gt;&lt;P&gt;incorrect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a sorted table as the inner table, this is the way to go!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise you must program the optimization with BINARY SEARCH by yourself, it is one of the most frequent recommendations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stay away from nested cursor, it is complicated and not worth the effort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use ASSIGNING for the LOOPs, this is a small improvement of top.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Jul 2010 11:28:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-15T11:28:48Z</dc:date>
    <item>
      <title>Performance in Nested Loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074384#M1505066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a strange problem on hand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have nested loops which contains a lot of records approx 50,000&lt;/P&gt;&lt;P&gt;I have used parallel cursor technique which uses to sort the tables beforehand. &lt;/P&gt;&lt;P&gt;When I use parallel cursor I get wrong results due to the fact I'm sorting tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which other techniques do I have to make this nested loop faster. &lt;/P&gt;&lt;P&gt;What about Field Symbols. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Varun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jul 2010 07:04:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074384#M1505066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-15T07:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in Nested Loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074385#M1505067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using READ Statememnt where ever possible&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jul 2010 07:06:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074385#M1505067</guid>
      <dc:creator>sv_v</dc:creator>
      <dc:date>2010-07-15T07:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in Nested Loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074386#M1505068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Try using READ Statememnt where ever possible&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are possibilities of having multiple entries in both the tables.&lt;/P&gt;&lt;P&gt;I don't think read would suffice though let me check.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jul 2010 07:10:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074386#M1505068</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-15T07:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in Nested Loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074387#M1505069</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;Define inner loop table as sorted table with non unique key and apply where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both table have same data or not ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind rgds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ravi Lanjewar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jul 2010 07:42:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074387#M1505069</guid>
      <dc:creator>ravi_lanjewar</dc:creator>
      <dc:date>2010-07-15T07:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in Nested Loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074388#M1505070</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;Parallel cursor is the best option for nested loop. It should work fine in all the cases. If you can post your code (Parallel cursor part) we could figure out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure, it is in the following way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  SORT gt_likp BY vbeln.
  SORT gt_lips BY vbeln.

  LOOP AT gt_likp INTO gwa_likp.

    LOOP AT gt_lips INTO gwa_lips FROM gv_index.
      IF gwa_likp-vbeln NE gwa_lips-vbeln.
        gv_index = sy-tabix.
        EXIT.
      ENDIF.
      " Inner loop Coding Here
    ENDLOOP.

  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field symbols do not help in your case.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jul 2010 08:32:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074388#M1505070</guid>
      <dc:creator>asik_shameem</dc:creator>
      <dc:date>2010-07-15T08:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in Nested Loops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074389#M1505071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; Parallel cursor is the best option for nested loop. It sho&lt;/P&gt;&lt;P&gt;incorrect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a sorted table as the inner table, this is the way to go!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise you must program the optimization with BINARY SEARCH by yourself, it is one of the most frequent recommendations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stay away from nested cursor, it is complicated and not worth the effort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use ASSIGNING for the LOOPs, this is a small improvement of top.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jul 2010 11:28:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-nested-loops/m-p/7074389#M1505071</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-15T11:28:48Z</dc:date>
    </item>
  </channel>
</rss>

