<?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: Dynamic programming using FOR Expressions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699269#M31707</link>
    <description>&lt;P&gt;Edit: I enhanced the answer.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Aug 2018 07:37:12 GMT</pubDate>
    <dc:creator>retired_member</dc:creator>
    <dc:date>2018-08-27T07:37:12Z</dc:date>
    <item>
      <title>Dynamic programming using FOR Expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699265#M31703</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/storage/attachments/205355-dynamic-programming.png"&gt;dynamic-programming.png&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Hello Team, &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I read somewhere all LOOP statement can be tweaked to form FOR statement. But I wasn't able to achieve it. &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I am trying to achieve a dynamic looping using FOR statement. Is FOR supports such a requirement by somehow? &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;In my case, iteration is dependent on certain values. So can I have such a flexibility using FOR statement. These values are not possible to pass in WHERE conditions. &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;"&amp;lt;lt_change_log&amp;gt; is dynamic internal table
LOOP AT &amp;lt;lt_change_log&amp;gt; ASSIGNING FIELD-SYMBOL(&amp;lt;ls_change_log&amp;gt;).
ASSIGN COMPONENT 'CDHDR' OF STRUCTURE &amp;lt;ls_change_log&amp;gt; TO &amp;lt;ls_cdhdr&amp;gt;.
LOOP AT &amp;lt;ls_change_log&amp;gt;-cdpos_tab[] ASSIGNING FIELD-SYMBOL(&amp;lt;ls_cdpos&amp;gt;)WHERE changenr = &amp;lt;ls_cdhdr&amp;gt;-changenr.
 if &amp;lt;ls_cdpos&amp;gt;-new_value is not initial.
  ....
 else.
  continue.
 endif.
ENDLOOP.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 09:56:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699265#M31703</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-08-24T09:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programming using FOR Expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699266#M31704</link>
      <description>&lt;P&gt;"Is FOR supports such a requirement by somehow?"&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;See the documentation,&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenfor_cond.htm" target="test_blank"&gt;https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenfor_cond.htm&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenfor_cond.htm" target="test_blank"&gt;https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenfor_cond.htm&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Dynamic WHERE is possible and also nested FORs should work.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;What you can't do, is to nest statements as ASSIGN COMPONENT. Only other expressions are possible. And for that you still need LOOP. But that's OK, since expressions don't make statements obsolete. They have another scope.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 15:07:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699266#M31704</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2018-08-24T15:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programming using FOR Expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699267#M31705</link>
      <description>&lt;P&gt;Hi Horst, &lt;/P&gt;
  &lt;P&gt;OK thank you for the information. So for now I would understand that, FOR cannot support dynamic programming.. So LOOP ENDLOOP is still essential..&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 05:22:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699267#M31705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-08-27T05:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programming using FOR Expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699268#M31706</link>
      <description>&lt;P&gt;Why? What's the point of replacing LOOP? Where did you read this?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 06:40:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699268#M31706</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2018-08-27T06:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programming using FOR Expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699269#M31707</link>
      <description>&lt;P&gt;Edit: I enhanced the answer.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 07:37:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-for-expressions/m-p/699269#M31707</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2018-08-27T07:37:12Z</dc:date>
    </item>
  </channel>
</rss>

