<?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: How to avoid nested loop? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692972#M2017768</link>
    <description>&lt;P&gt;I stopped answering several months ago when it was obvious that the only thing that would continue was the flow of questions.&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2023 16:32:15 GMT</pubDate>
    <dc:creator>Ryan-Crosby</dc:creator>
    <dc:date>2023-05-22T16:32:15Z</dc:date>
    <item>
      <title>How to avoid nested loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692966#M2017762</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Here is my current situation: &lt;BR /&gt;DATA: T_FCAT1 TYPE slis_fieldcat_alv,&lt;BR /&gt;&lt;CODE&gt;      t_fcat TYPE kkblo_t_fieldcat.&lt;/CODE&gt;&lt;BR /&gt;LOOP AT T_FCAT1 INTO LX_FCAT1.&lt;BR /&gt;    LOOP AT LT_FCATALOG INTO LX_FCATALOG.&lt;BR /&gt;    IF LX_FCAT1-FIELDNAME = LX_FCATALOG-FIELDNAME.&lt;BR /&gt;         LX_FCAT1-COL_POS = LX_FCATALOG-COL_POS.&lt;BR /&gt;         APPEND LX_FCAT1 TO T_FCAT1.&lt;BR /&gt;         CLEAR LX_FCAT1.&lt;BR /&gt;    ENDIF.&lt;BR /&gt;    ENDLOOP.&lt;BR /&gt;ENDLOOP.&lt;BR /&gt;&lt;BR /&gt;It is possible to eliminate the nested loop here?&lt;BR /&gt;My goal is to overwrite the COL_POS from LX_FCATALOG to T_FCAT1 or LX_FCAT1&lt;BR /&gt;but the pre-requisite is to map it into correct field.&lt;BR /&gt;example:

T_FCAT1 OR LX_FCAT1.
FIELDNAME   COL_POS&lt;BR /&gt;EBELN          0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;LT_FCATALOG OR LX_FCATALOG.
FIELDNAME    COL_POS
EBELN          23 &amp;lt;-----I want this to overwrite to T_FCAT1 OR LX_FCAT1.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 May 2023 12:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692966#M2017762</guid>
      <dc:creator>walkerist79</dc:creator>
      <dc:date>2023-05-22T12:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid nested loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692967#M2017763</link>
      <description>&lt;P&gt;Looks to me like you've an endless loop (except where there are no shared FIELDNAME between the two internal tables), since you're looping through &lt;STRONG&gt;t_fcat1&lt;/STRONG&gt; you're adding new records into it.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 13:16:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692967#M2017763</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2023-05-22T13:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid nested loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692968#M2017764</link>
      <description>&lt;P&gt;Seems no need of nested loop here. You can loop once T_FCAT1 assigning field symbol, as you want modify COL_POS, read table LT_FCATALOG per field and just set &amp;lt;fs_fcat1&amp;gt;-COL_POS = ls_fcatalog-COL_POS. &lt;/P&gt;&lt;P&gt;BTW: You have many questions unclosed, are it really without valid answers to be closed ?&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2168120-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 14:27:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692968#M2017764</guid>
      <dc:creator>fedaros</dc:creator>
      <dc:date>2023-05-22T14:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid nested loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692969#M2017765</link>
      <description>&lt;P&gt;@All two fieldcatalogs have different types.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 14:40:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692969#M2017765</guid>
      <dc:creator>walkerist79</dc:creator>
      <dc:date>2023-05-22T14:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid nested loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692970#M2017766</link>
      <description>&lt;P&gt;Try at least something such as &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT T_FCAT1 ASSIGNING &amp;lt;old&amp;gt;.
  READ TABLE T_FCATALOG WITH KEY FIELDNAME = &amp;lt;old&amp;gt;-FIELDNAME ASSIGNING &amp;lt;new&amp;gt;.     
  IF &amp;lt;new&amp;gt; IS ASSIGNED.
     &amp;lt;old&amp;gt;-COL_POS = &amp;lt;new&amp;gt;-COL_POS.
  ENDIF.
ENDLOOP.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What's your version?&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 15:39:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692970#M2017766</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2023-05-22T15:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid nested loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692971#M2017767</link>
      <description>&lt;P&gt;I guess experience says there's no need to close the questions as people keep answering...&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 15:51:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692971#M2017767</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-05-22T15:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid nested loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692972#M2017768</link>
      <description>&lt;P&gt;I stopped answering several months ago when it was obvious that the only thing that would continue was the flow of questions.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 16:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-avoid-nested-loop/m-p/12692972#M2017768</guid>
      <dc:creator>Ryan-Crosby</dc:creator>
      <dc:date>2023-05-22T16:32:15Z</dc:date>
    </item>
  </channel>
</rss>

