<?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 Nested FOR statement ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451566#M1999546</link>
    <description>&lt;P&gt;Hi Everyone.&lt;/P&gt;
  &lt;P&gt;I want to replace the below old style loop logic with new FOR statement.&lt;/P&gt;
  &lt;P&gt;The final table p_gt_sales_area should contain data merging 3 internal tables&lt;/P&gt;
  &lt;P&gt;Example::&lt;/P&gt;
  &lt;P&gt;so_vkorg is having values VK1&lt;/P&gt;
  &lt;P&gt;so_vtweg is having values VT1 , VT2 and VT3&lt;/P&gt;
  &lt;P&gt;so_spart is having values SP1 and SP2 &lt;/P&gt;
  &lt;P&gt;then the final table p_gt_sales_area should have below values&lt;/P&gt;
  &lt;P&gt;VK1 VT1 SP1&lt;/P&gt;
  &lt;P&gt;VK1 VT1 SP2&lt;/P&gt;
  &lt;P&gt;VK1 VT2 SP1&lt;/P&gt;
  &lt;P&gt;VK1 VT2 SP2&lt;/P&gt;
  &lt;P&gt;VK1 VT3 SP1&lt;/P&gt;
  &lt;P&gt;VK1 VT3 SP2&lt;/P&gt;
  &lt;P&gt;Old logic ::-&lt;/P&gt;
  &lt;P&gt; LOOP AT so_vkorg ASSIGNING FIELD-SYMBOL(&amp;lt;lfs_vkorg&amp;gt;).&lt;BR /&gt; CLEAR : ls_sales_area.&lt;BR /&gt; ls_sales_area-vkorg = &amp;lt;lfs_vkorg&amp;gt;-low. ""Sales Org&lt;BR /&gt;&lt;BR /&gt; LOOP AT so_vtweg ASSIGNING FIELD-SYMBOL(&amp;lt;lfs_vtweg&amp;gt;).&lt;BR /&gt; ls_sales_area-vtweg = &amp;lt;lfs_vtweg&amp;gt;-low. ""Dist Channel&lt;BR /&gt;&lt;BR /&gt; LOOP AT so_spart ASSIGNING FIELD-SYMBOL(&amp;lt;lfs_spart&amp;gt;).&lt;BR /&gt; ls_sales_area-spart = &amp;lt;lfs_spart&amp;gt;-low. ""Division&lt;BR /&gt;&lt;BR /&gt; APPEND ls_sales_area TO p_gt_sales_area.&lt;BR /&gt;&lt;BR /&gt; ENDLOOP.&lt;BR /&gt;&lt;BR /&gt; ENDLOOP.&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;ENDLOOP.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Aug 2021 13:32:05 GMT</pubDate>
    <dc:creator>amit_khedekar</dc:creator>
    <dc:date>2021-08-03T13:32:05Z</dc:date>
    <item>
      <title>Nested FOR statement ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451566#M1999546</link>
      <description>&lt;P&gt;Hi Everyone.&lt;/P&gt;
  &lt;P&gt;I want to replace the below old style loop logic with new FOR statement.&lt;/P&gt;
  &lt;P&gt;The final table p_gt_sales_area should contain data merging 3 internal tables&lt;/P&gt;
  &lt;P&gt;Example::&lt;/P&gt;
  &lt;P&gt;so_vkorg is having values VK1&lt;/P&gt;
  &lt;P&gt;so_vtweg is having values VT1 , VT2 and VT3&lt;/P&gt;
  &lt;P&gt;so_spart is having values SP1 and SP2 &lt;/P&gt;
  &lt;P&gt;then the final table p_gt_sales_area should have below values&lt;/P&gt;
  &lt;P&gt;VK1 VT1 SP1&lt;/P&gt;
  &lt;P&gt;VK1 VT1 SP2&lt;/P&gt;
  &lt;P&gt;VK1 VT2 SP1&lt;/P&gt;
  &lt;P&gt;VK1 VT2 SP2&lt;/P&gt;
  &lt;P&gt;VK1 VT3 SP1&lt;/P&gt;
  &lt;P&gt;VK1 VT3 SP2&lt;/P&gt;
  &lt;P&gt;Old logic ::-&lt;/P&gt;
  &lt;P&gt; LOOP AT so_vkorg ASSIGNING FIELD-SYMBOL(&amp;lt;lfs_vkorg&amp;gt;).&lt;BR /&gt; CLEAR : ls_sales_area.&lt;BR /&gt; ls_sales_area-vkorg = &amp;lt;lfs_vkorg&amp;gt;-low. ""Sales Org&lt;BR /&gt;&lt;BR /&gt; LOOP AT so_vtweg ASSIGNING FIELD-SYMBOL(&amp;lt;lfs_vtweg&amp;gt;).&lt;BR /&gt; ls_sales_area-vtweg = &amp;lt;lfs_vtweg&amp;gt;-low. ""Dist Channel&lt;BR /&gt;&lt;BR /&gt; LOOP AT so_spart ASSIGNING FIELD-SYMBOL(&amp;lt;lfs_spart&amp;gt;).&lt;BR /&gt; ls_sales_area-spart = &amp;lt;lfs_spart&amp;gt;-low. ""Division&lt;BR /&gt;&lt;BR /&gt; APPEND ls_sales_area TO p_gt_sales_area.&lt;BR /&gt;&lt;BR /&gt; ENDLOOP.&lt;BR /&gt;&lt;BR /&gt; ENDLOOP.&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;ENDLOOP.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 13:32:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451566#M1999546</guid>
      <dc:creator>amit_khedekar</dc:creator>
      <dc:date>2021-08-03T13:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Nested FOR statement ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451567#M1999547</link>
      <description>&lt;P&gt;Soooo can you show what you tried or are you really wanting someone to do the work for you?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 14:09:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451567#M1999547</guid>
      <dc:creator>ChrisSolomon</dc:creator>
      <dc:date>2021-08-03T14:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Nested FOR statement ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451568#M1999548</link>
      <description>&lt;P&gt;To help you, here is the starting point (replace ... with some contents):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;p_gt_sales_area = VALUE #(
    FOR ... 
    FOR ... 
    ...
    ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Aug 2021 15:54:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451568#M1999548</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-08-03T15:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Nested FOR statement ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451569#M1999549</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;christopher.solomon&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I was trying as below but its not working, it would be appreciating if you can assist&lt;/P&gt;&lt;P&gt;p_gt_sales_area = VALUE #(&lt;BR /&gt;                 BASE p_gt_sales_area&lt;BR /&gt;                 (&lt;BR /&gt;                     vkorg = REDUCE vkorg( INIT vkorg TYPE vkorg&lt;BR /&gt;                                                             FOR &amp;lt;lfs_vkorg&amp;gt; IN so_vkorg&lt;BR /&gt;                                                             NEXT vkorg = &amp;lt;lfs_vkorg&amp;gt;-low&lt;BR /&gt;&lt;BR /&gt;                                             vtweg = REDUCE vtweg( INIT vtweg TYPE vtweg&lt;BR /&gt;                                                                                     FOR &amp;lt;lfs_vtweg&amp;gt; IN so_vtweg&lt;BR /&gt;                                                                                     NEXT vtweg = &amp;lt;lfs_vtweg&amp;gt;-low&lt;BR /&gt;&lt;BR /&gt;                                                                    spart = REDUCE spart( INIT spart TYPE spart&lt;BR /&gt;                                                                                                FOR &amp;lt;lfs_spart&amp;gt; IN so_spart&lt;BR /&gt;                                                                                               NEXT spart = &amp;lt;lfs_spart&amp;gt;-low&lt;BR /&gt;                                                                                               )&lt;BR /&gt;&lt;BR /&gt;                                                                                       )&lt;BR /&gt;&lt;BR /&gt;                                                           )&lt;BR /&gt;                    )&lt;BR /&gt;                    ).&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 16:45:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451569#M1999549</guid>
      <dc:creator>amit_khedekar</dc:creator>
      <dc:date>2021-08-03T16:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Nested FOR statement ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451570#M1999550</link>
      <description>&lt;P&gt;You don't need reduce, all you need is VALUE #( FOR ... FOR ... FOR ... ( ... ) ).&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 16:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451570#M1999550</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-08-03T16:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Nested FOR statement ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451571#M1999551</link>
      <description>&lt;P&gt;Thanks Sandra for assistance. It helped me.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 17:47:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451571#M1999551</guid>
      <dc:creator>amit_khedekar</dc:creator>
      <dc:date>2021-08-03T17:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Nested FOR statement ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451572#M1999552</link>
      <description>&lt;P&gt;hello &lt;/P&gt;&lt;P&gt;pls post the final solution&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 19:11:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/nested-for-statement-abap/m-p/12451572#M1999552</guid>
      <dc:creator>former_member598787</dc:creator>
      <dc:date>2021-08-03T19:11:22Z</dc:date>
    </item>
  </channel>
</rss>

