<?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: looping mechanism in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198682#M1003495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   since you are using table within a table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab1.
    LOOP AT itab2 WHERE &amp;lt;cond&amp;gt;.
    ENDLOOP.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhijeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2008 05:11:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-23T05:11:57Z</dc:date>
    <item>
      <title>looping mechanism</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198675#M1003488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if an internal table(ex : itab) contains another internal table (ex : jtab),&lt;/P&gt;&lt;P&gt;which will be the correcct mechanism to loop.&lt;/P&gt;&lt;P&gt;ie first loop jtab then read each row of itab based on criteria&lt;/P&gt;&lt;P&gt;or first loop itab then read each row of jtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 05:01:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198675#M1003488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T05:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: looping mechanism</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198676#M1003489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;First loop itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Nested Internal Tables:&lt;/P&gt;&lt;P&gt;Check this links:&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9eaa35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9eaa35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Adil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 05:04:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198676#M1003489</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T05:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: looping mechanism</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198677#M1003490</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;PRE&gt;&lt;CODE&gt;Loop at itab.

loop at jtab where field1 = itab-field1.
STATEMENTS.
endloop.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shailaja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 05:06:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198677#M1003490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T05:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: looping mechanism</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198678#M1003491</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 loop Itab then read the row of jtab for each row value of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mechnism:&lt;/P&gt;&lt;P&gt;The internal table of these kind are called Nested table. The inner table have a set of row for every row in the outer table. so, we need nested loop to access data. The mechanism is similar to any other programming language like C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example code , check the link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9eaa35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9eaa35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;under the heading&lt;/P&gt;&lt;P&gt;"Formatting Data Using Nested Internal Tables"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anirban&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 05:06:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198678#M1003491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T05:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: looping mechanism</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198679#M1003492</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;Here you have nested internal tables. &lt;/P&gt;&lt;P&gt;It is always better to LOOP from the top and then LOOP on the inner internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab.
loop at jtab &amp;lt;condition&amp;gt;.
&amp;lt;program&amp;gt;.
endloop.
endloop&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sumit Agarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 05:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198679#M1003492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T05:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: looping mechanism</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198680#M1003493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will explain with example :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose we have two tables &lt;STRONG&gt;SPFLI&lt;/STRONG&gt; and &lt;STRONG&gt;SFLIGHT&lt;/STRONG&gt;. &lt;/P&gt;&lt;P&gt;Now if we have to retrieve the fields &lt;STRONG&gt;CARRID, CONNID, CITYFROM &amp;amp; CITYTO&lt;/STRONG&gt; from Table &lt;STRONG&gt;SPFLI.&lt;/STRONG&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the fields &lt;STRONG&gt;FLDATE PRICE SEATSMAX &amp;amp; SEATSOCC&lt;/STRONG&gt; from &lt;STRONG&gt;SFLIGHT&lt;/STRONG&gt; on the condition that &lt;STRONG&gt;SPFLI-CARRID = SFLIGHT-CARRID &amp;amp; SPFLI-CONNID = SFLIGHT-CONNID&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the &lt;STRONG&gt;LOOP.....ENDLOOP&lt;/STRONG&gt;  will be like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at t_spfli into fs_spfli.

    write :/ fs_spfli-carrid,
              fs_spfli-connid.

    Loop at t_sflight into fs_sflight where carrid = fs_spfli-carrid
                                                   and connid = fs_spfli-connid.
       write :/ fs_sflight-fldate,
                  fs_sflight-price,
                  fs_sflight-seatsocc,
                  fs_sflight-seatsmax.
     Endloop.

Endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will fetch all the records from sflight depending upon the condition. This solves the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Swapna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 05:10:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198680#M1003493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T05:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: looping mechanism</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198681#M1003494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  the way will always be...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  LOOP AT JTAB.&lt;/P&gt;&lt;P&gt; ...........&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;  refer to the link for sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.ittoolbox.com/groups/technical-functional/sap-dev/call-function-read_text-173330" target="test_blank"&gt;http://sap.ittoolbox.com/groups/technical-functional/sap-dev/call-function-read_text-173330&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WIth luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 05:11:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198681#M1003494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T05:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: looping mechanism</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198682#M1003495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   since you are using table within a table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab1.
    LOOP AT itab2 WHERE &amp;lt;cond&amp;gt;.
    ENDLOOP.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhijeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 05:11:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looping-mechanism/m-p/4198682#M1003495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T05:11:57Z</dc:date>
    </item>
  </channel>
</rss>

