<?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: loop in loop performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226787#M1718057</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Parallel cursor method is obsolete? Are you comparing 4.7 and ECC6? I had used it in 4.7 and it worked.&lt;/P&gt;&lt;P&gt;I had more than 1000 entries in both tables and parallel cursor method was the only thing that worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has this issue been addressed in ECC6? I doubt. I had faced the same issue while working on ECC6 as well.&lt;/P&gt;&lt;P&gt;Yes for table entries ranging from 100 to 500, it does not improve performance.&lt;/P&gt;&lt;P&gt;Also, you are sorting on the key fields I guess. I think it works in case you have more fields in table structure and a where clause on non-key fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 22 Dec 2012 03:32:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-12-22T03:32:18Z</dc:date>
    <item>
      <title>loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226781#M1718051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;I have to make loop inside a loop ı am looking fastest way to do&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;my internal tables likes these (not excatly but similiar)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;data begin of itabex&lt;/P&gt;&lt;P&gt;&amp;nbsp; matnr like mara-matnr&lt;/P&gt;&lt;P&gt;&amp;nbsp; lgort like mspr-lgort&lt;/P&gt;&lt;P&gt;&amp;nbsp; charg like mspr-charg&lt;/P&gt;&lt;P&gt;data end of itabex&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data begin of itabin&lt;/P&gt;&lt;P&gt;&amp;nbsp; matnr like mara-matnr&lt;/P&gt;&lt;P&gt;&amp;nbsp; lgort like mspr-lgort&lt;/P&gt;&lt;P&gt;&amp;nbsp; charg like mspr-charg&lt;/P&gt;&lt;P&gt;data end of itabin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itabex &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loop at itabin where matnr eq itabex-matnr &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and lgort eq itabex-lgort&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endloop&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;or&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itabin by matnr lgort.&lt;/P&gt;&lt;P&gt;loop at itabex.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; read table itabin with key matnr = itabex-matnr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lgort = itabex-lgort binary search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loop&amp;nbsp;&amp;nbsp;&amp;nbsp; at itabin from lv_tabix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&amp;nbsp;&amp;nbsp;&amp;nbsp; itabin-matnr ne itabex-matnr or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itabin-lgort ne&amp;nbsp;&amp;nbsp;&amp;nbsp; itabex-lgort.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endif.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endloop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endif.&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;or better way to do&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 14:59:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226781#M1718051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-20T14:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226782#M1718052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you already have an answer. Second method is better.&lt;/P&gt;&lt;P&gt;It is called parallel cursor method.&amp;nbsp; You can search forum for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your question exactly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 17:38:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226782#M1718052</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-20T17:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226783#M1718053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please dont post duplicate threads.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://answers.sap.com/thread/3283423" title="http://scn.sap.com/thread/3283423"&gt;http://scn.sap.com/thread/3283423&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 17:39:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226783#M1718053</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-20T17:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226784#M1718054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sory for double posting ı forgot &lt;/P&gt;&lt;P&gt;thanks by the way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 07:07:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226784#M1718054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-21T07:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226785#M1718055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Parallel cursor method is largely obsolete since you can declare your internal tables as SORTED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your similar but not exact example, you should declare ITABIN TYPE SORTED TABLE OF ... WITH ... KEY MATNR LGORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read ABAP documentation for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 13:56:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226785#M1718055</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2012-12-21T13:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226786#M1718056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;User the sorted table for inner loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the defination of internal table&amp;nbsp; as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: itabin type sorted table of ty_itabin with non-unique key matnr lgort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below given logic will give the better performance over the parallel cursor method. Parallel cursor method is old and obsolate way of handling the loop within loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also used the fields symbol insted of work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itabin where matnr eq itabex-matnr &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and lgort eq itabex-lgort&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endloop&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more details plz search on scn for key word "Sorted table" &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 19:24:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226786#M1718056</guid>
      <dc:creator>ravi_lanjewar</dc:creator>
      <dc:date>2012-12-21T19:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226787#M1718057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Parallel cursor method is obsolete? Are you comparing 4.7 and ECC6? I had used it in 4.7 and it worked.&lt;/P&gt;&lt;P&gt;I had more than 1000 entries in both tables and parallel cursor method was the only thing that worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has this issue been addressed in ECC6? I doubt. I had faced the same issue while working on ECC6 as well.&lt;/P&gt;&lt;P&gt;Yes for table entries ranging from 100 to 500, it does not improve performance.&lt;/P&gt;&lt;P&gt;Also, you are sorting on the key fields I guess. I think it works in case you have more fields in table structure and a where clause on non-key fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Dec 2012 03:32:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226787#M1718057</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-22T03:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226788#M1718058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;okey thanks ı have a great deal of data ı will test both technique I think it will show me the differance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Dec 2012 08:30:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226788#M1718058</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-22T08:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226789#M1718059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's obsolete in a sense that it is unnecessarily complex, by using sorted tables (declared as TYPE SORTED) for the inner loop you achieve similar performance but have more straightforward code. KISS principle. From 702 you can even declare secondary keys for internal tables, in case several access paths are required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Dec 2012 15:13:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226789#M1718059</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2012-12-22T15:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226790#M1718060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using Loop inside loop .&lt;/P&gt;&lt;P&gt;You can use join query to get data from two different table and create single internal table.&lt;BR /&gt;This will get executed fast as compare to loop inside loop.&lt;/P&gt;&lt;P&gt;this is what i think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2012 10:53:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226790#M1718060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-27T10:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: loop in loop performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226791#M1718061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorted table is the fastest method ı tried it &lt;/P&gt;&lt;P&gt;thanks folks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2012 11:29:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-in-loop-performance/m-p/9226791#M1718061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-27T11:29:26Z</dc:date>
    </item>
  </channel>
</rss>

