<?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 inside a Loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425887#M541901</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;May be this way.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at i_mara.
  do.
    read table i_mara_characteristics wuth key matnr = i_mara-matnr.
    if sy-subrc eq 0.
       &amp;lt;&amp;lt;&amp;lt; whatever you want to do &amp;gt;&amp;gt;&amp;gt;
       delete i_mara_characteristics index sy-tabix.
    else.
       exit.
    endif.
  enddo.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jun 2007 22:56:50 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2007-06-22T22:56:50Z</dc:date>
    <item>
      <title>Loop inside a Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425879#M541893</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;Can I know that is there any other way, to avoid using Loop inside a Loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 22:12:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425879#M541893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T22:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inside a Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425880#M541894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can use the read statement instead of multiple loops... thats the one good solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 22:14:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425880#M541894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T22:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inside a Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425881#M541895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The second table has more than one similar record so I cant use a READ inside the first Loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any way I can avoid using Loop inside the Loop ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 22:19:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425881#M541895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T22:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inside a Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425882#M541896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the read statement and give the condition what differentiates one similar record from the other&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 22:21:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425882#M541896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T22:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inside a Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425883#M541897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok,,let me explain a bit more..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say my first internal table as coulmns as material number and plant&lt;/P&gt;&lt;P&gt;And my second internal table as materail numbers and it corresponding characteristics ie. one material number has more than one characteristics.&lt;/P&gt;&lt;P&gt;So I cant read on second internal table with key only as material number (which is known to me) ie, In this case I need to do a Loop inside a Loop to check for every characteristic for a material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I want to avoid doing that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I am clear to you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 22:32:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425883#M541897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T22:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inside a Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425884#M541898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think there's no other option rather than using LOOP inside LOOP here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make it more effective you can use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB2 WHERE MATNR = ITAB1-MATNR.&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;Second option would be to join these 2 tables on Material Number and get data into single internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * INTO ITAB&lt;/P&gt;&lt;P&gt;FROM TABLE1 INNER JOIN TABLE 2&lt;/P&gt;&lt;P&gt;ON TABLE1&lt;SUB&gt;MATNR = TABLE2&lt;/SUB&gt;MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 22:34:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425884#M541898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T22:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inside a Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425885#M541899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that case u have to use the loop inside the loop two loops does not make that much difference in performance if u have more than two loops that makes the difference i guess....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 22:39:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425885#M541899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T22:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inside a Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425886#M541900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What if there are more than 2 loops,,how can we handle it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I need to do that also later in my  program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 22:44:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425886#M541900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-22T22:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inside a Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425887#M541901</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;May be this way.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at i_mara.
  do.
    read table i_mara_characteristics wuth key matnr = i_mara-matnr.
    if sy-subrc eq 0.
       &amp;lt;&amp;lt;&amp;lt; whatever you want to do &amp;gt;&amp;gt;&amp;gt;
       delete i_mara_characteristics index sy-tabix.
    else.
       exit.
    endif.
  enddo.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 22:56:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425887#M541901</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-06-22T22:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Loop inside a Loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425888#M541902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Dec 2010 14:19:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/2425888#M541902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-31T14:19:48Z</dc:date>
    </item>
  </channel>
</rss>

