<?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 Loop index..... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-index/m-p/6864818#M1476277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ram, Thank  you for your replay..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;but here the itab2 should repeat multiple times until the cond is satisfied.  if i use Read stat it cant repeat right...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if wa_header-load_qt &amp;gt; 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop AT itab2 into wa_itab2 where field2 = wa_header-field2.  &lt;STRONG&gt;( should repeat multiple times)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;here processing logic........ &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;delete itab2 from wa_itab2. ( or) del the specific record from ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify itab1 from wa_itab1 TRANSPORTING FIELD3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: sudhasumathi on May 15, 2010 8:43 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 May 2010 06:41:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-05-15T06:41:39Z</dc:date>
    <item>
      <title>Problem with Loop index.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-index/m-p/6864815#M1476274</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;  i have a problem with Loop index, bcoz i am using Loop inside Loop, i know we cant use loop under loop, but as per my requirement i need to use loop under loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; my code is like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Loop AT itab1 into wa_itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      read table table it_header into wa_header with key field1 = wa_itab1-field1.&lt;/P&gt;&lt;P&gt;     if sy-subrc = '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           Loop AT itab2 into wa_itab2 where field2 = wa_header-field2.&lt;/P&gt;&lt;P&gt;               &lt;/P&gt;&lt;P&gt;                    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;here processing logic........       &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                 delete itab2 from wa_itab2. ( or) del the specific record from ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             Modify itab1 from wa_itab1 TRANSPORTING FIELD3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           endloop.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;endllop.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here my requirement is from ITAB1 allways i need to loop first, since i am modifying or delete the records from ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from ITAB1  in second loop also i neeed to pic first record, But here prob is 2nd time SY-TABIX becoming 2,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so How to make SY-TABIX should be 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have checked like Loop AT itab1 into wa_itab1 FROM '1'.    ( also not working).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; can anyone give me the logic.....&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;Sudha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 May 2010 04:05:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-index/m-p/6864815#M1476274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-15T04:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Loop index.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-index/m-p/6864816#M1476275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As per my understanding u have to delete/ modify  the specific index of ITAB1, &lt;/P&gt;&lt;P&gt;For this you have to declare one variable of type SY-tabix, then u have to assign the current index to it &lt;/P&gt;&lt;P&gt;and at the specified condition u can perform ur operation &lt;/P&gt;&lt;P&gt;using: &lt;/P&gt;&lt;P&gt;delete itab1 index .................. &lt;/P&gt;&lt;P&gt;modify itab1 index ... transporting...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 May 2010 05:04:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-index/m-p/6864816#M1476275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-15T05:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Loop index.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-index/m-p/6864817#M1476276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Sudha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : tabix type sy-tabix. " add this one
Loop AT itab1 into wa_itab1.

read table table it_header into wa_header with key field1 = wa_itab1-field1.
if sy-subrc = '0'.

*Loop AT itab2 into wa_itab2 where field2 = wa_header-field2." avoid this loop with read table
read table itab2 into wa_itab2 with key  field2 = wa_header-field2.
if sy-subrc = 0.
* here processing logic........ 
delete itab2 index sy-tabix." ( or) del the specific record from ITAB1.
DELETE ITAB2 WHERE FIELD2 = WA_HEADER-FIELD2 " Incase you want to delete multiple records
endif,
*endloop." Avoid this one
endif.
" Unless you modify WA_ITAB1 you dont required this modify statement
" Since you are not changing FIELD3 of WA_ITAB1 you dont need to modify this ITAB1
Modify itab1 from wa_itab1 TRANSPORTING FIELD3. " This should be in First LOOP only
endllop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Cheerz&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 May 2010 05:13:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-index/m-p/6864817#M1476276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-15T05:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Loop index.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-index/m-p/6864818#M1476277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ram, Thank  you for your replay..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;but here the itab2 should repeat multiple times until the cond is satisfied.  if i use Read stat it cant repeat right...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if wa_header-load_qt &amp;gt; 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop AT itab2 into wa_itab2 where field2 = wa_header-field2.  &lt;STRONG&gt;( should repeat multiple times)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;here processing logic........ &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;delete itab2 from wa_itab2. ( or) del the specific record from ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify itab1 from wa_itab1 TRANSPORTING FIELD3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: sudhasumathi on May 15, 2010 8:43 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 May 2010 06:41:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-index/m-p/6864818#M1476277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-15T06:41:39Z</dc:date>
    </item>
  </channel>
</rss>

