<?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: Avoid Nested Loops for non-unique internal tables (using ABAP 7.4) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784167#M2023960</link>
    <description>&lt;P&gt;Note that there's no reason to avoid nested loops for the reason that the internal tables have non-unique key.&lt;/P&gt;&lt;P&gt;Also, the "parallel cursor technique" is based on using nested loops, so it's difficult to do the technique and avoid nested loops. Reminder (pseudo code of one possible variant):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT itab_1 BY key_1.
SORT itab_2 BY key_2.
index_2 = 0.
LOOP AT itab_1 INTO line_1.
  WHILE index_2 &amp;lt; lines( itab_2 )
      AND ( index_2 = 0 
         OR line_2-key_2 &amp;lt; line_1-key_1 ).
    index_2 = index_2 + 1.
    line_2 = itab_2[ index_2 ].
  ENDWHILE.
  IF line_1-key_1 = line_2-key_2.
    " Processing
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Nov 2023 07:55:08 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2023-11-02T07:55:08Z</dc:date>
    <item>
      <title>Avoid Nested Loops for non-unique internal tables (using ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784164#M2023957</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I am working on Updating Material Text using MATMAS interface.&lt;/P&gt;
  &lt;P&gt;In that, there are multiple Sales area segments, considered as one internal table and multiple long Text segments, considered as another internal table. Both doesn't have any unique value but all the texts (Material master texts) must be mapped / extended to all the Sales area. &lt;/P&gt;
  &lt;P&gt;For ex: Sales area segment records would be 8 entries and the Material long text entries would be 5. &lt;/P&gt;
  &lt;P&gt;Since there is no unique key to validate or match the entries between the two, using the parallel cursor technique to avoid nested loops cannot be achieved (as per my understanding).&lt;/P&gt;
  &lt;P&gt;Please help me out with your valuable solution using ABAP 7.4 or avoid a performance issue.&lt;/P&gt;
  &lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 16:46:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784164#M2023957</guid>
      <dc:creator>sankar1781</dc:creator>
      <dc:date>2023-10-23T16:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid Nested Loops for non-unique internal tables (using ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784165#M2023958</link>
      <description>&lt;P&gt;Why do you want to change your code? Is there any performance issue?&lt;/P&gt;&lt;P&gt;FYI, Constructor Expressions are not faster than classic ABAP (note sure where this myth comes from...)&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 18:34:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784165#M2023958</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-10-23T18:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid Nested Loops for non-unique internal tables (using ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784166#M2023959</link>
      <description>&lt;P&gt;Please use the COMMENT button for comments, asking for complements, adding details, replying to a comment or a proposed solution or to the OP question, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area. &lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 07:45:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784166#M2023959</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-02T07:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid Nested Loops for non-unique internal tables (using ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784167#M2023960</link>
      <description>&lt;P&gt;Note that there's no reason to avoid nested loops for the reason that the internal tables have non-unique key.&lt;/P&gt;&lt;P&gt;Also, the "parallel cursor technique" is based on using nested loops, so it's difficult to do the technique and avoid nested loops. Reminder (pseudo code of one possible variant):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT itab_1 BY key_1.
SORT itab_2 BY key_2.
index_2 = 0.
LOOP AT itab_1 INTO line_1.
  WHILE index_2 &amp;lt; lines( itab_2 )
      AND ( index_2 = 0 
         OR line_2-key_2 &amp;lt; line_1-key_1 ).
    index_2 = index_2 + 1.
    line_2 = itab_2[ index_2 ].
  ENDWHILE.
  IF line_1-key_1 = line_2-key_2.
    " Processing
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Nov 2023 07:55:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784167#M2023960</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-02T07:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid Nested Loops for non-unique internal tables (using ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784168#M2023961</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for your solution. This answered to my question. &lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 09:41:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784168#M2023961</guid>
      <dc:creator>sankar1781</dc:creator>
      <dc:date>2023-11-02T09:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid Nested Loops for non-unique internal tables (using ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784169#M2023962</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thanks again for your prompt response.&lt;/P&gt;&lt;P&gt;The problem here is parallel cursor cannot be used and directly to use two loops as nested loops, since both doesn't have any unique key to validate.&lt;/P&gt;&lt;P&gt;I can't change the data declaration to have an indicator because the two segment entry counts doesn't match as well.&lt;/P&gt;&lt;P&gt;For ex: Sales area segment may have 10 entries but the Text segment could be 1 or 2.&lt;/P&gt;&lt;P&gt;So why I asked a question here.&lt;/P&gt;&lt;P&gt;Thanks again for clearing my myth as well.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 09:24:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784169#M2023962</guid>
      <dc:creator>sankar1781</dc:creator>
      <dc:date>2023-11-09T09:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid Nested Loops for non-unique internal tables (using ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784170#M2023963</link>
      <description>&lt;P&gt;SORT itab_1 BY key_1.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT itab_2 BY key_2.
index_2 = 0.
LOOP AT itab_1 INTO line_1.
  WHILE index_2 &amp;lt; lines( itab_2 )
      AND ( index_2 = 0 
         OR line_2-key_2 &amp;lt; line_1-key_1 ).
    index_2 = index_2 + 1.
    line_2 = itab_2[ index_2 ].
  ENDWHILE.
  IF line_1-key_1 = line_2-key_2.
    " Processing
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Nov 2023 09:25:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoid-nested-loops-for-non-unique-internal-tables-using-abap-7-4/m-p/12784170#M2023963</guid>
      <dc:creator>sankar1781</dc:creator>
      <dc:date>2023-11-09T09:25:07Z</dc:date>
    </item>
  </channel>
</rss>

