<?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: Control loop statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532016#M243072</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;before using the control loop statements you should sort the internal table by control break.&lt;/P&gt;&lt;P&gt;In your case you should sort your itab as &amp;lt;b&amp;gt;SORT SAMPLE_TAB BY FIELD1.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Abdul Hakim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Aug 2006 23:33:28 GMT</pubDate>
    <dc:creator>abdul_hakim</dc:creator>
    <dc:date>2006-08-01T23:33:28Z</dc:date>
    <item>
      <title>Control loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532014#M243070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       I always have the confusion while I am using the control loops statment with respective to fields I want to use control loops on. &lt;/P&gt;&lt;P&gt;  data: begin of sample_tab occurs 0,&lt;/P&gt;&lt;P&gt;         field1 like mara-matnr,&lt;/P&gt;&lt;P&gt;         field2 like vbrp-vbeln,&lt;/P&gt;&lt;P&gt;         field3 like maktx-maktl,&lt;/P&gt;&lt;P&gt;        end of sample_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      Let's think that FIELD1 is the desired field that I want to apply the control loops statment logic  on always. Please also let me know that what care that I have to take before the use of Control loop statement. Please explain following scenarios. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT end of - field1 is first field in sample_tab?&lt;/P&gt;&lt;P&gt;          - field2 is second field in sample_tab?&lt;/P&gt;&lt;P&gt;          - field1 is first field in sample_tab and not &lt;/P&gt;&lt;P&gt;            a key field of any db table.&lt;/P&gt;&lt;P&gt;          - field1 is second field in sample_tab and not &lt;/P&gt;&lt;P&gt;            a key field of any db table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT frist  - field1 is first field in sample_tab?&lt;/P&gt;&lt;P&gt;          - field2 is second field in sample_tab?&lt;/P&gt;&lt;P&gt;          - field1 is first field in sample_tab and not &lt;/P&gt;&lt;P&gt;            a key field of any db table?&lt;/P&gt;&lt;P&gt;          - field1 is second field in sample_tab and not &lt;/P&gt;&lt;P&gt;            a key field of any db table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT last  - field1 is first field in sample_tab?&lt;/P&gt;&lt;P&gt;          - field2 is second field in sample_tab?&lt;/P&gt;&lt;P&gt;          - field1 is first field in sample_tab and not &lt;/P&gt;&lt;P&gt;            a key field of any db table?&lt;/P&gt;&lt;P&gt;          - field1 is second field in sample_tab and not &lt;/P&gt;&lt;P&gt;            a key field of any db table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on change of  - field1 is first field in sample_tab?&lt;/P&gt;&lt;P&gt;          - field2 is second field in sample_tab?&lt;/P&gt;&lt;P&gt;          - field1 is first field in sample_tab and not &lt;/P&gt;&lt;P&gt;            a key field of any db table?&lt;/P&gt;&lt;P&gt;          - field1 is second field in sample_tab and not &lt;/P&gt;&lt;P&gt;            a key field of any db table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Thanks in advance.&lt;/P&gt;&lt;P&gt;   SDN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2006 23:09:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532014#M243070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-01T23:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Control loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532015#M243071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go through the link for control levels,&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb381a358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb381a358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Azaz Ali.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2006 23:19:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532015#M243071</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-01T23:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Control loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532016#M243072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;before using the control loop statements you should sort the internal table by control break.&lt;/P&gt;&lt;P&gt;In your case you should sort your itab as &amp;lt;b&amp;gt;SORT SAMPLE_TAB BY FIELD1.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Abdul Hakim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2006 23:33:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532016#M243072</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2006-08-01T23:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Control loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532017#M243073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to properly use those statements, you should first sort your itab by field1. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort sample_tab by field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at sample_tab.&lt;/P&gt;&lt;P&gt;at end of field1.&lt;/P&gt;&lt;P&gt; write: / 'END'.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at first.&lt;/P&gt;&lt;P&gt;write: / 'This is the first record'.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at last.&lt;/P&gt;&lt;P&gt;write: / 'This is the last record'.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. Please award points for useful answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2006 01:39:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532017#M243073</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-08-02T01:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Control loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532018#M243074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AT end of field1&lt;/P&gt;&lt;P&gt;- field1 is first field in sample_tab?&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; will be processed whenever field1 changes &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;AT end of field2&lt;/P&gt;&lt;P&gt;- field2 is second field in sample_tab?&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; will be processed whenever field1 or field2 changes &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;- field1 is first field in sample_tab and not &lt;/P&gt;&lt;P&gt;a key field of any db table.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; will be processed whenever field1 changes &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; being a key field is not relevant &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;- field1 is second field in sample_tab and not &lt;/P&gt;&lt;P&gt;a key field of any db table.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; will be processed whenever field1 OR the first field changes &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; being a key field is not relevant &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT frist - field1 is first field in sample_tab?&lt;/P&gt;&lt;P&gt;- field2 is second field in sample_tab?&lt;/P&gt;&lt;P&gt;- field1 is first field in sample_tab and not &lt;/P&gt;&lt;P&gt;a key field of any db table?&lt;/P&gt;&lt;P&gt;- field1 is second field in sample_tab and not &lt;/P&gt;&lt;P&gt;a key field of any db table?&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; regardless of field values this code will be exected on the very FIRST pass of the loop&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT last - field1 is first field in sample_tab?&lt;/P&gt;&lt;P&gt;- field2 is second field in sample_tab?&lt;/P&gt;&lt;P&gt;- field1 is first field in sample_tab and not &lt;/P&gt;&lt;P&gt;a key field of any db table?&lt;/P&gt;&lt;P&gt;- field1 is second field in sample_tab and not &lt;/P&gt;&lt;P&gt;a key field of any db table?&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; regardless of field values this code will be exected on the very LAST pass of the loop&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on change of - field1 is first field in sample_tab?&lt;/P&gt;&lt;P&gt;- field2 is second field in sample_tab?&lt;/P&gt;&lt;P&gt;- field1 is first field in sample_tab and not &lt;/P&gt;&lt;P&gt;a key field of any db table?&lt;/P&gt;&lt;P&gt;- field1 is second field in sample_tab and not &lt;/P&gt;&lt;P&gt;a key field of any db table?&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; do not use 'on change' this it is intended for 'selects' not loops. Instead use 'at new ..'. &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;at new field1.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;This will be executed whenever the field1 value differs from the previous pass (or on the first pass).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;at new field2.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;This will be executed whenever the field1 OR field2 values differ from the previous pass (or on the first pass).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2006 02:55:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-loop-statements/m-p/1532018#M243074</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-08-02T02:55:51Z</dc:date>
    </item>
  </channel>
</rss>

