<?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: Nested LOOP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950560#M1154358</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so how was the interview??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Dec 2008 07:56:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-24T07:56:27Z</dc:date>
    <item>
      <title>Nested LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950559#M1154357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)  Are Nested LOOPS acceptable in coding? if Yes, How much extent ?&lt;/P&gt;&lt;P&gt;2) in LOOP...ENDLOOP,  Can we use Select Single Statements?&lt;/P&gt;&lt;P&gt;3) If we can use appox. 6 nested loops how much performance was affected?&lt;/P&gt;&lt;P&gt;4) In LOOP..ENDLOOP.... Can we use MOVE-CORRESPONDING statements&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 07:55:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950559#M1154357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-24T07:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Nested LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950560#M1154358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so how was the interview??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 07:56:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950560#M1154358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-24T07:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Nested LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950561#M1154359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Krishna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not in interview questions..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to done Code walk through for program. He developed the program in that fashion.. Now i need to give the report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 08:01:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950561#M1154359</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-24T08:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Nested LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950562#M1154360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siva,&lt;/P&gt;&lt;P&gt;Here are the replies.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
1) Nested loops are not accepted in the coding by if you are not able to get hte solution then you need to put one loop inside other but this is also a bad coding.

2) Yes you can use select single inside loop endloop. but the good practice is fetch all the data from the tables and use the Read statement instead of Select single.

3) Dude performance will be degraded in 2 nested loops . and you are using 6 nested loops then the system will go down with the performance.

4) MOVE-CORRESPONDING  is not a good practice instead of this you can directly assign the field name value.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chidanand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 08:14:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950562#M1154360</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-24T08:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Nested LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950563#M1154361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siva,&lt;/P&gt;&lt;P&gt;All that you have written are usually best avioded in any report which can have loads of data to process.&lt;/P&gt;&lt;P&gt;But even then at times it may be unavoidab;e to use such loops.&lt;/P&gt;&lt;P&gt;My personal experience has been that at times loads of read table cost more than select singles.&lt;/P&gt;&lt;P&gt;Try and run the report in SE30 and you will have a fairly good idea to suggest changes if need be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 08:15:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950563#M1154361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-24T08:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Nested LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950564#M1154362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Are Nested LOOPS acceptable in coding? if Yes, How much extent&lt;/P&gt;&lt;P&gt;ans yes but performance point of view in decrease performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) in LOOP...ENDLOOP, Can we use Select Single Statements?&lt;/P&gt;&lt;P&gt;Ans Genelly we not use select statement within the loop. it increas the time of execution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) If we can use appox. 6 nested loops how much performance was affected?&lt;/P&gt;&lt;P&gt;yes: but it decrease the performance of program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) In LOOP..ENDLOOP.... Can we use MOVE-CORRESPONDING statements&lt;/P&gt;&lt;P&gt;ans yes but move is better than move-correspondoin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 08:23:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950564#M1154362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-24T08:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Nested LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950565#M1154363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Nested loops are not accepted in the coding by if you are not able to get hte solution then you need   to put one loop inside other but this is also a bad coding. You can use but performance point of view in decrease performance&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;2) Yes you can use select single inside loop endloop. but the good practice is retrieve all the data from the database tables and use the Read statement instead of Select single.&lt;/P&gt;&lt;P&gt; Genelly we not use select statement within the loop. it increase the time of execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) If you use 2 nested loops, it will decrease the performance and you are using 6 nested loops then the system will go down with the performance.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;4) MOVE-CORRESPONDING  is not a good practice instead of this you can directly assign the field name value or but move is better than move-correspondoing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 08:50:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950565#M1154363</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-24T08:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Nested LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950566#M1154364</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;If you use Nested loops you will face performance issues.  But no restriction.&lt;/P&gt;&lt;P&gt;Use read statement in loops inted of select single.&lt;/P&gt;&lt;P&gt;Declare filed symbols and use intend of MOVE-CORRESPONDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Durga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 10:08:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950566#M1154364</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-24T10:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Nested LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950567#M1154365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;1) Nested loops are not acceptable in coding.&lt;/P&gt;&lt;P&gt;But use that only if you have no other option but to use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) In loop and endloop you can use select statement.&lt;/P&gt;&lt;P&gt;But this degrades the performance in a great way.&lt;/P&gt;&lt;P&gt;Try to fetch data in advance in an internal table and then read that internal table inside of the loop statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)Only 2 loop statement is enough for performance degradation. 6 loops are a big deal.&lt;/P&gt;&lt;P&gt;The rate of performance degradation depends upon the amount of selected data.&lt;/P&gt;&lt;P&gt;If in the first statement it is looping for 50 times and in second for 60 times,&lt;/P&gt;&lt;P&gt;then total looping will be forr 50*60 = 3000 times.&lt;/P&gt;&lt;P&gt;So you can think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4)In lopp-endloop move corresponding can be used, but better is to avoid them.&lt;/P&gt;&lt;P&gt;Try to assign directly and then append to an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt; Jayati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 10:08:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950567#M1154365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-24T10:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Nested LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950568#M1154366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks All&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2008 10:19:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-loop/m-p/4950568#M1154366</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-24T10:19:37Z</dc:date>
    </item>
  </channel>
</rss>

