<?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: ABAP 7.4 - multiple FOR Vs Nested Loop operation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529233#M2005307</link>
    <description>&lt;P&gt;Thanks  @sandra rossi - for your help , I will mark it as close ... &lt;/P&gt;</description>
    <pubDate>Fri, 12 Nov 2021 02:01:21 GMT</pubDate>
    <dc:creator>KumarAakash</dc:creator>
    <dc:date>2021-11-12T02:01:21Z</dc:date>
    <item>
      <title>ABAP 7.4 - multiple FOR Vs Nested Loop operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529224#M2005298</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;DATA : it_review TYPE STANDARD TABLE OF z_review,&amp;lt;br&amp;gt;       it_roles TYPE STANDARD TABLE OF z_roles,&amp;lt;br&amp;gt;       it_count TYPE STANDARD TABLE OF z_count.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;select * FROM z_review INTO TABLE it_review.      "--&amp;gt; count =     22477 Rows&amp;lt;br&amp;gt;  select * FROM z_roles INTO TABLE it_roles.       "---&amp;gt; count  =  858035 ROws &amp;lt;br&amp;gt;    select * FROM z_count   INTO TABLE it_count.    "----&amp;gt;count  =  187458 Rows &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;*&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;br&amp;gt;data(gt_final) = VALUE lt_final( for lt_review in it_review&amp;lt;br&amp;gt;                          for ls_roles IN it_roles FROM line_index( it_roles[ AGR_NAME = lt_review-AGR_NAME  ] )&amp;lt;br&amp;gt;                          where ( AGR_NAME = lt_review-AGR_NAME )&amp;lt;br&amp;gt;                          for ls_count in it_count FROM line_index( it_count[ uname = lt_review-uname ] )&amp;lt;br&amp;gt;                          WHERE ( uname = lt_review-uname and tcode = ls_roles-tcode )&amp;lt;br&amp;gt;                          LET ls_final = VALUE ty_final(&amp;lt;br&amp;gt;                            uname = lt_review-uname&amp;lt;br&amp;gt;                           AGR_NAME = lt_review-AGR_NAME&amp;lt;br&amp;gt;                            tcode = ls_roles-tcode&amp;lt;br&amp;gt;                            count = ls_count-zcount )&amp;lt;br&amp;gt;                       IN ( CORRESPONDING #( BASE ( ls_final ) lt_review ) ) ).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;   LOOP AT it_review INTO DATA(wa_review).&amp;lt;br&amp;gt;**         check if user and tcode has count..&amp;lt;br&amp;gt;      LOOP AT it_roles INTO DATA(wa_roles) WHERE agr_name = wa_review-agr_name.&amp;lt;br&amp;gt;         TRY .&amp;lt;br&amp;gt;           data(wa_count) = it_count[ UNAME = wa_review-uname TCODE = wa_roles-tcode  ].&amp;lt;br&amp;gt;         CATCH cx_sy_itab_line_not_found..&amp;lt;br&amp;gt;           CONTINUE.&amp;lt;br&amp;gt;         ENDTRY.&amp;lt;br&amp;gt;         write :/10  wa_review-uname  ,20  wa_review-agr_name , 60 wa_roles-tcode , 75 wa_count-zcount.&amp;lt;br&amp;gt;         exit.&amp;lt;br&amp;gt;        endloop.&amp;lt;br&amp;gt;       ENDLOOP.&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I need help / suggestion i m trying my hands on 7.4 syntax on SQL 'FOR " multiple joins and trying to check if i replace the nested looped operation , but my Nested FOR never gave the result where as nested Loop did gave output..&lt;/P&gt;
  &lt;P&gt;can you all help me figure out , where I going completely wrong... &lt;/P&gt;
  &lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Ask here is &lt;/STRONG&gt;&lt;/U&gt;- if my FOR nested is wrong or right , how can design it such that it behaves as nested looped and i get final table appended with desired fields .. as i done in the above loop statments. &lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 19:42:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529224#M2005298</guid>
      <dc:creator>KumarAakash</dc:creator>
      <dc:date>2021-11-10T19:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 7.4 - multiple FOR Vs Nested Loop operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529225#M2005299</link>
      <description>&lt;P&gt;Edit your question and this time click on the "code" button in the question editor, and enter the code into a code box so that it's readable.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 20:24:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529225#M2005299</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-11-10T20:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 7.4 - multiple FOR Vs Nested Loop operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529226#M2005300</link>
      <description>&lt;P&gt;thanks Mathew !! did exactly as asked .&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 20:56:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529226#M2005300</guid>
      <dc:creator>KumarAakash</dc:creator>
      <dc:date>2021-11-10T20:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 7.4 - multiple FOR Vs Nested Loop operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529227#M2005301</link>
      <description>&lt;P&gt;I think it's a better practice to explain the problem &lt;STRONG&gt;before&lt;/STRONG&gt; the code.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 20:56:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529227#M2005301</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-11-10T20:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 7.4 - multiple FOR Vs Nested Loop operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529228#M2005302</link>
      <description>&lt;P&gt;Your "for" loops look completely different from the second block, I don't understand what you want to achieve.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 21:04:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529228#M2005302</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-11-10T21:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 7.4 - multiple FOR Vs Nested Loop operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529229#M2005303</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; - i did mention in the above question , let me know if i need to add more details .. happy to help !! &lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 21:04:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529229#M2005303</guid>
      <dc:creator>KumarAakash</dc:creator>
      <dc:date>2021-11-10T21:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 7.4 - multiple FOR Vs Nested Loop operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529230#M2005304</link>
      <description>&lt;P&gt;I don't understand how you came to have a so complex expression. Why not simplifying it:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data(gt_final) = VALUE lt_final( &lt;BR /&gt;    for wa_review in it_review
    for wa_roles IN it_roles
    where ( AGR_NAME = wa_review-AGR_NAME )
    ( uname    = wa_review-uname&lt;BR /&gt;      agr_name = wa_review-agr_name&lt;BR /&gt;      tcode    = wa_roles-tcode&lt;BR /&gt;      count    = VALUE #( it_count[ UNAME = wa_review-uname TCODE = wa_roles-tcode ] OPTIONAL ) ) ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Nov 2021 07:03:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529230#M2005304</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-11-11T07:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 7.4 - multiple FOR Vs Nested Loop operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529231#M2005305</link>
      <description>&lt;P&gt;Thanks  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; for the code , I need some more help if you can suggest would be great.&lt;/P&gt;&lt;P&gt;in above code you have mentioned &lt;U&gt;&lt;STRONG&gt;2 FOR &lt;/STRONG&gt;&lt;/U&gt;statement  together with where single clause , does that mean if both are met then only record gets inserted in the GT_FINAL...&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 14:42:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529231#M2005305</guid>
      <dc:creator>KumarAakash</dc:creator>
      <dc:date>2021-11-11T14:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 7.4 - multiple FOR Vs Nested Loop operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529232#M2005306</link>
      <description>&lt;P&gt;Yes. Not different from your &lt;STRONG&gt;&lt;U&gt;2 LOOP AT&lt;/U&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;   LOOP AT it_review INTO DATA(wa_review).
     LOOP AT it_roles INTO DATA(wa_roles) WHERE agr_name = wa_review-agr_name.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Nov 2021 15:56:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529232#M2005306</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-11-11T15:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP 7.4 - multiple FOR Vs Nested Loop operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529233#M2005307</link>
      <description>&lt;P&gt;Thanks  @sandra rossi - for your help , I will mark it as close ... &lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 02:01:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-7-4-multiple-for-vs-nested-loop-operation/m-p/12529233#M2005307</guid>
      <dc:creator>KumarAakash</dc:creator>
      <dc:date>2021-11-12T02:01:21Z</dc:date>
    </item>
  </channel>
</rss>

