<?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: Problem with nested loops with huge data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305931#M1534873</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's take the example of the previous post:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: itab2 TYPE HASHED TABLE OF desc WITH UNIQUE KEY key.   
  LOOP AT itab1.
    READ TABLE itab2
      WITH TABLE KEY key = itab1-field.
    CHECK sy-subrc = 0.
    LOOP AT itab2 FROM sy-tabix.
      IF itab2-key NE itab1-field.
        EXIT.
      ENDIF.
        "process data from itab2 here
    ENDLOOP.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, whenever you're doing a lookup, and you've got a unique key, use a HASHED table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Sep 2010 09:06:15 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2010-09-21T09:06:15Z</dc:date>
    <item>
      <title>Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305914#M1534856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Developing experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I have a problem with nested loops, hopefully I will get a solutin for it here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My situation is as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

LOOP AT ........ITAB1 &amp;lt;------------- with 2000 records

    LOOP AT ........ITAB2 &amp;lt;------------- with 600 records

      LOOP AT ........ITAB3 &amp;lt;------------- with 1,60,000 records

       LOOP AT ........ITAB4 &amp;lt;------------- with 30,000 records

       ENDLOOP.

     ENDLOOP.

   ENDLOOP.

ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting one dump afetr executing this.&lt;/P&gt;&lt;P&gt;" No more storage space available for extending an internal table"&lt;/P&gt;&lt;P&gt;This is my dump. Please suggest me how can I manage this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G.S.Naidu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 05:34:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305914#M1534856</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T05:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305915#M1534857</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;Put where condition for the loops which are inside the loops.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 05:37:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305915#M1534857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T05:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305916#M1534858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naidu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Definitely this is a HUGE problem ..... that too Nesting Level is 4 &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt; &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Possible Solution&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Do Parallel Cursor on 2 - 2 internal tables and consolidate in another internal tables Xand Y ......  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and finally do another parallel cursor between X and Y .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Like .....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sort itabA by f1 f2..&lt;/P&gt;&lt;P&gt;Sort itabB by f2 f3. &lt;/P&gt;&lt;P&gt;Sort itabC by f1 f2..&lt;/P&gt;&lt;P&gt;Sort itabD by f2 f3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itabA.&lt;/P&gt;&lt;P&gt;read table itabB into wa_b with key f1 = itabA-f1.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;loop at itabB.&lt;/P&gt;&lt;P&gt;&amp;lt;logic&amp;gt;&lt;/P&gt;&lt;P&gt;Consolidate into itabX&lt;/P&gt;&lt;P&gt;&amp;lt;If Exit Condition&amp;gt;&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&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;&lt;/P&gt;&lt;P&gt;Loop at itabC.&lt;/P&gt;&lt;P&gt;read table itabD into wa_b with key f1 = itabC-f1.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;loop at itabB.&lt;/P&gt;&lt;P&gt;&amp;lt;logic&amp;gt;&lt;/P&gt;&lt;P&gt;Consolidate into itabY&lt;/P&gt;&lt;P&gt;&amp;lt;If Exit Condition&amp;gt;&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&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;&lt;/P&gt;&lt;P&gt;Loop at itabX.&lt;/P&gt;&lt;P&gt;read table itabY into wa_b with key f1 = itabX-f1.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;loop at itabB.&lt;/P&gt;&lt;P&gt;&amp;lt;logic&amp;gt;&lt;/P&gt;&lt;P&gt;Consolidate into itabY&lt;/P&gt;&lt;P&gt;&amp;lt;If Exit Condition&amp;gt;&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&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;Hope this helps u ......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Kripa Rangachari...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 05:39:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305916#M1534858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T05:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305917#M1534859</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;Use READ with BINARY SEARCH statement instead of multiple loops. This will reduce the execution time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 05:41:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305917#M1534859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T05:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305918#M1534860</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;First sort all the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   first use the loop for inernal table 1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; read table itab2 with binary search&lt;/P&gt;&lt;P&gt;rad table 3 itab3 with binary search,&lt;/P&gt;&lt;P&gt;read table itab4 with binary search,&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 05:51:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305918#M1534860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T05:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305919#M1534861</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;Use the loopings separately.&lt;/P&gt;&lt;P&gt;First sort all the internal tables with binary search,&lt;/P&gt;&lt;P&gt;After that use first 2 loops get the data into a internal table then the next internal table in the same way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rohith.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 06:01:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305919#M1534861</guid>
      <dc:creator>rohit_kaikala</dc:creator>
      <dc:date>2010-09-21T06:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305920#M1534862</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;At any situation do not use more then 2 level of nesting of loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just try with AT NEW , AT END etc or READ TABLE statments this will solve your problem &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bikas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 06:02:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305920#M1534862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T06:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305921#M1534863</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 addition to the WHERE clause for inner tables, sort the inner tables accordingly and apply BINARY search for every inner table to reach the index of first record statisfying WHERE clause. Use that INDEX as starting point while looping through the inner tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;V Joshi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 06:31:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305921#M1534863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T06:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305922#M1534864</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;Use Parallel Cursor Technique..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for better understanding plaese go through the beloe link.&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiki.sdn.sap.com/wiki/display/Community/Alternatives" target="test_blank"&gt;http://wiki.sdn.sap.com/wiki/display/Community/Alternatives&lt;/A&gt;&lt;EM&gt;for&lt;/EM&gt;Nested+Loops&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this will help you..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 06:32:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305922#M1534864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T06:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305923#M1534865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kripa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanki you for the immediate response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the parallel cursur method. But still I am getting the same dump but with in less time its going in to the dump and saying the same error. "No more storage space available for extending an internal table."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since It is a problem of internal table memory can we increase the ITAB memory in any way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G.S.Naidu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 06:38:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305923#M1534865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T06:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305924#M1534866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Naidu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; We have to opt the solution of memory and other harware stuffs at the end only when we are sure that we dont have any other optimization techniques....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess the Nesting levels should be avoided and usage of binary search, index, where clause and parallel cursor between 2 loops! ... will increase the perfocmance ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may be i STRONGLY suggest  to first opt for code optimization and then we can have a look into other possiblie solutions ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Kripa Rangachari...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 06:54:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305924#M1534866</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T06:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305925#M1534867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kripa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you are right. But there is no other option for us. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per the select query in the ITAB there are 1,60,000 records and in other ITAB 30,000 records are there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we can't reduce these records and can't change the select query as its mandatory requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I have used parallel cursur method and read statements and binary searches my performance got increased but to insert the data in to the ITAB there is no space afterwords . Thats why with less time I am getting dump. But before I was getting dump afetr 10minutes. Now after using all these performance increasing formulas I made the dump to come with in 2minutes.. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I strongly believe that we have to increate the ITAB's memory only. Please suggest in this area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G.S.Naidu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 07:06:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305925#M1534867</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T07:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305926#M1534868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is indeed a memory problem and not a performance problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can't process the data in separate blocks (per block select less data) then the only solution is increasing memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 07:19:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305926#M1534868</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T07:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305927#M1534869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naidu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your main problem is storage space of a internal table ." " No more storage space available for extending an internal table"&lt;/P&gt;&lt;P&gt;For this one parallel cursor is not helpful. it is help to make the processing fast. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per my understanding from four ITAB you are building one final internal table. In your final table if you have any duplicate logic or you know that for some fields table data will be unique, then you can make table as hash table. Here instead of append you need to do insert. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is no such logic or any other way to make table size low, you can go for the application server file or custom table.  Insert the records to the temporary app server file or to custom table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Subhankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 07:23:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305927#M1534869</guid>
      <dc:creator>Subhankar</dc:creator>
      <dc:date>2010-09-21T07:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305928#M1534870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You've got four internal tables with data already... so where is the amount of data increasing? What are you doing inside the loops? This is the information we need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Incidentally - I just changed an old program from using BINARY SEARCH to SORTED and HASHED tables and achieved a 60x performance improvement. I frankly find it depressing that BINARY SEARCH is still being promoted as the solution to all performance issues. &lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;BINARY SEARCH is old technology&lt;/SPAN&gt;&lt;/STRONG&gt; Let's move on from the 1990s, people!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 07:39:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305928#M1534870</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2010-09-21T07:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305929#M1534871</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; Incidentally - I just changed an old program from using BINARY SEARCH to SORTED and HASHED tables and achieved a 60x performance improvement.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hey Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;60X performance improvement is pretty cool !! I'm into the habit of using SORTED tables but still don't think HASHED tables are my cup of tea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you could share any specific reason why you used HASHED tables ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 07:46:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305929#M1534871</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-09-21T07:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305930#M1534872</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;Removing a LOOP AT ... WHERE statement is pretty simple, you have to do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  SORT itab2 BY key.   "sorting before LOOP is very important
  LOOP AT itab1.
    READ TABLE itab2
      WITH KEY key = itab1-field
      BINARY SEARCH.
    IF sy-subrc = 0.
      LOOP AT itab2 FROM sy-tabix.
        IF itab2-key = itab1-field.
          "process data from itab2 here
        ELSE.
          EXIT.
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a very useful and pretty quick solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 07:58:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305930#M1534872</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-21T07:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305931#M1534873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's take the example of the previous post:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: itab2 TYPE HASHED TABLE OF desc WITH UNIQUE KEY key.   
  LOOP AT itab1.
    READ TABLE itab2
      WITH TABLE KEY key = itab1-field.
    CHECK sy-subrc = 0.
    LOOP AT itab2 FROM sy-tabix.
      IF itab2-key NE itab1-field.
        EXIT.
      ENDIF.
        "process data from itab2 here
    ENDLOOP.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, whenever you're doing a lookup, and you've got a unique key, use a HASHED table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 09:06:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305931#M1534873</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2010-09-21T09:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305932#M1534874</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;Have you tried to use ABAP statement FREE itabx?&lt;/P&gt;&lt;P&gt;It will not only clear/refresh the internal table but also release the memory&lt;/P&gt;&lt;P&gt;occupied by it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 11:38:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305932#M1534874</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-22T11:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with nested loops with huge data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305933#M1534875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have where condition in your inner loops then use sorted tables with key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data itab1 TYPE sorted TABLE OF &amp;lt;structure&amp;gt; with unique key KEY1 KEY2.&lt;/P&gt;&lt;P&gt;data itab2 TYPE sorted TABLE OF &amp;lt;structure&amp;gt; with unique key KEY1 KEY2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 assigning &amp;lt;fs1&amp;gt;.  "use field symbol instead of work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2 assigning &amp;lt;fs2&amp;gt; where &amp;lt;fs2&amp;gt;-key1 = &amp;lt;fs1&amp;gt;-key1.&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;&lt;/P&gt;&lt;P&gt;this will improve performance by a big margin if you have similar scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vishal Kapoor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 12:27:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-nested-loops-with-huge-data/m-p/7305933#M1534875</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-22T12:27:42Z</dc:date>
    </item>
  </channel>
</rss>

