<?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/4159489#M994435</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii,.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DESCRIBE TABLE w_cdpos LINES wf_lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If wf_lines GT 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT w_cdpos BY changenr ASCENDING .&lt;/P&gt;&lt;P&gt;CLEAR w_result .&lt;/P&gt;&lt;P&gt;w_result-lifnr = w_lfa1-lifnr .&lt;/P&gt;&lt;P&gt;w_result-fname = 'BANK' .&lt;/P&gt;&lt;P&gt;w_result-ddtext = text-001 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOOP AT w_cdpos.&lt;/STRONG&gt;(giv me alternate solution)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ws_cdpos = w_cdpos .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW changenr .&lt;/P&gt;&lt;P&gt;IF w_result-value_old IS INITIAL .&lt;/P&gt;&lt;P&gt;w_result-value_old = ws_cdpos-tabkey+13(57) .&lt;/P&gt;&lt;P&gt;ELSE .&lt;/P&gt;&lt;P&gt;w_result-value_new = ws_cdpos-tabkey+13(57) .&lt;/P&gt;&lt;P&gt;ENDIF .&lt;/P&gt;&lt;P&gt;ENDAT .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT END OF changenr .&lt;/P&gt;&lt;P&gt;IF w_result-value_old IS NOT INITIAL&lt;/P&gt;&lt;P&gt;AND w_result-value_new IS NOT INITIAL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_result-value_old = w_result-value_new .&lt;/P&gt;&lt;P&gt;CLEAR w_result-value_new .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF .&lt;/P&gt;&lt;P&gt;ENDAT .&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING ws_cdpos TO w_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND w_result .&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;Endif.&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;Sachin M M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sachin Mathapati on Jul 21, 2008 2:31 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Jul 2008 08:58:38 GMT</pubDate>
    <dc:creator>sachin_mathapati</dc:creator>
    <dc:date>2008-07-21T08:58:38Z</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/4159488#M994434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;            i hav used loop(w_cdpos) inside the same loop, so it is showing error, is there any alternate solution for this. pls send me hard code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT   * FROM cdhdr INTO TABLE w_cdhdr&lt;/P&gt;&lt;P&gt;                           WHERE objectclas = 'KRED'&lt;/P&gt;&lt;P&gt;                          AND objectid    = w_lfa1-lifnr&lt;/P&gt;&lt;P&gt;                          AND udate IN c_date&lt;/P&gt;&lt;P&gt;                           AND change_ind = 'I'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT  * FROM cdpos INTO TABLE w_cdpos&lt;/P&gt;&lt;P&gt;    FOR ALL ENTRIES IN w_cdhdr&lt;/P&gt;&lt;P&gt;          WHERE objectclas = 'KRED'&lt;/P&gt;&lt;P&gt;                        AND objectid    = w_lfa1-lifnr&lt;/P&gt;&lt;P&gt;                         AND tabname = 'LFBK'&lt;/P&gt;&lt;P&gt;                         AND changenr = w_cdhdr-changenr .&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop at w_cdpos.&lt;/STRONG&gt; (giv me alternate solution)&lt;/P&gt;&lt;P&gt;    IF sy-dbcnt GT 1 .&lt;/P&gt;&lt;P&gt;      SORT w_cdpos BY changenr ASCENDING .&lt;/P&gt;&lt;P&gt;      CLEAR w_result .&lt;/P&gt;&lt;P&gt;      w_result-lifnr =  w_lfa1-lifnr .&lt;/P&gt;&lt;P&gt;      w_result-fname = 'BANK' .&lt;/P&gt;&lt;P&gt;      w_result-ddtext = text-001 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;LOOP AT w_cdpos.&lt;/STRONG&gt;(giv me alternate solution)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ws_cdpos = w_cdpos .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        AT NEW  changenr  .&lt;/P&gt;&lt;P&gt;          IF w_result-value_old IS INITIAL .&lt;/P&gt;&lt;P&gt;            w_result-value_old = ws_cdpos-tabkey+13(57) .&lt;/P&gt;&lt;P&gt;          ELSE .&lt;/P&gt;&lt;P&gt;            w_result-value_new = ws_cdpos-tabkey+13(57) .&lt;/P&gt;&lt;P&gt;          ENDIF .&lt;/P&gt;&lt;P&gt;        ENDAT .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        AT END OF changenr  .&lt;/P&gt;&lt;P&gt;          IF    w_result-value_old IS NOT INITIAL&lt;/P&gt;&lt;P&gt;            AND w_result-value_new IS NOT INITIAL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            w_result-value_old = w_result-value_new .&lt;/P&gt;&lt;P&gt;            CLEAR w_result-value_new  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          ENDIF .&lt;/P&gt;&lt;P&gt;        ENDAT .&lt;/P&gt;&lt;P&gt;         MOVE-CORRESPONDING ws_cdpos TO  w_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        APPEND  w_result .&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;   ENDIF .&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 08:50:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/4159488#M994434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T08:50:23Z</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/4159489#M994435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii,.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DESCRIBE TABLE w_cdpos LINES wf_lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If wf_lines GT 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT w_cdpos BY changenr ASCENDING .&lt;/P&gt;&lt;P&gt;CLEAR w_result .&lt;/P&gt;&lt;P&gt;w_result-lifnr = w_lfa1-lifnr .&lt;/P&gt;&lt;P&gt;w_result-fname = 'BANK' .&lt;/P&gt;&lt;P&gt;w_result-ddtext = text-001 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOOP AT w_cdpos.&lt;/STRONG&gt;(giv me alternate solution)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ws_cdpos = w_cdpos .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW changenr .&lt;/P&gt;&lt;P&gt;IF w_result-value_old IS INITIAL .&lt;/P&gt;&lt;P&gt;w_result-value_old = ws_cdpos-tabkey+13(57) .&lt;/P&gt;&lt;P&gt;ELSE .&lt;/P&gt;&lt;P&gt;w_result-value_new = ws_cdpos-tabkey+13(57) .&lt;/P&gt;&lt;P&gt;ENDIF .&lt;/P&gt;&lt;P&gt;ENDAT .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT END OF changenr .&lt;/P&gt;&lt;P&gt;IF w_result-value_old IS NOT INITIAL&lt;/P&gt;&lt;P&gt;AND w_result-value_new IS NOT INITIAL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_result-value_old = w_result-value_new .&lt;/P&gt;&lt;P&gt;CLEAR w_result-value_new .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF .&lt;/P&gt;&lt;P&gt;ENDAT .&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING ws_cdpos TO w_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND w_result .&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;Endif.&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;Sachin M M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sachin Mathapati on Jul 21, 2008 2:31 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 08:58:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/4159489#M994435</guid>
      <dc:creator>sachin_mathapati</dc:creator>
      <dc:date>2008-07-21T08:58:38Z</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/4159490#M994436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check this links:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/performance" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/performance&lt;/A&gt;&lt;EM&gt;Tuning&lt;/EM&gt;using&lt;EM&gt;Parallel&lt;/EM&gt;Cursor&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechnical.com/Tutorials/ABAP/ParallelCursor.htm" target="test_blank"&gt;http://www.saptechnical.com/Tutorials/ABAP/ParallelCursor.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>Mon, 21 Jul 2008 08:58:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/4159490#M994436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T08:58:53Z</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/4159491#M994437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   You will use 2 loops only if u want to get the desired o/p like for one row  of first loop you want to &lt;/P&gt;&lt;P&gt;execute the second loop for all entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I feel if u don't want to do that then you can get the desired o/p using one loop only.Don't forget to sort the table when u r using AT NEW of AT END OF w_cdpos by changenr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh Akarte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 09:00:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/4159491#M994437</guid>
      <dc:creator>rajesh_akarte2</dc:creator>
      <dc:date>2008-07-21T09:00:23Z</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/4159492#M994438</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 a look at this SDN blog:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_blogpost" href="https://community.sap.com/" __jive_macro_name="blogpost" modifiedtitle="true" __default_attr="43649"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 09:03:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/4159492#M994438</guid>
      <dc:creator>former_member182371</dc:creator>
      <dc:date>2008-07-21T09:03:05Z</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/4159493#M994439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;before starting the loop, you need to use DESCRIBE statement to check the number of records in that internal table.&lt;/P&gt;&lt;P&gt;if records found ...then sort the internal table.&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;venkat n&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2008 09:55:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-inside-a-loop/m-p/4159493#M994439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-21T09:55:33Z</dc:date>
    </item>
  </channel>
</rss>

