<?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 break statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1394966#M191485</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ON CHANGE OF f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Executes the processing block enclosed by the "ON CHANGE OF f" and "ENDON" statements whenever the contents of the field f change (control break processing). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally, you use the statement to manipulate database fields during GET events or SELECT/ENDSELECT processing. &lt;/P&gt;&lt;P&gt;ON CHANGE OF is unsuitable for recognizing control levels in loops of this type because it always creates a global auxiliary field which is used to check for changes. This global auxiliary field is only changed in the relevant ON CHANGE OF statement. It is not reset when the processing enters loops or subroutines, so unwanted effects can occur if the loop or subroutine is executed again. Also, since it is set to its initial value when created (like any other field), any ON CHANGE OF processing will be executed after the first test, unless the contents of the field concerned happen to be identical to the initial value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA T100_WA TYPE T100. &lt;/P&gt;&lt;P&gt;SELECT * FROM T100 &lt;/P&gt;&lt;P&gt;         INTO T100_WA &lt;/P&gt;&lt;P&gt;         WHERE SPRSL = SY-LANGU AND &lt;/P&gt;&lt;P&gt;                         MSGNR &amp;lt; '010' &lt;/P&gt;&lt;P&gt;                   ORDER BY PRIMARY KEY. &lt;/P&gt;&lt;P&gt;  ON CHANGE OF T100_WA-ARBGB. &lt;/P&gt;&lt;P&gt;    ULINE. &lt;/P&gt;&lt;P&gt;    WRITE: / '**&lt;STRONG&gt;', T100_WA-ARBGB, '&lt;/STRONG&gt;**'. &lt;/P&gt;&lt;P&gt;  ENDON. &lt;/P&gt;&lt;P&gt;  WRITE: / T100_WA-MSGNR, T100_WA-TEXT. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Displays all messages with their numbers in the logon language, provided the number is less than '010'. &lt;/P&gt;&lt;P&gt;Each time the message class changes, it is output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT END OF f.&lt;/P&gt;&lt;P&gt;f is a sub-field of an internal table or extract dataset (EXTRACT) which is being processed with LOOP, i.e. the variants 1 and 2 only make sense within a LOOP. &lt;/P&gt;&lt;P&gt;Both "AT NEW f." and "AT END OF f. " introduce processing blocks which are concluded by " ENDAT.". &lt;/P&gt;&lt;P&gt;These processing blocks are processed whenever the contents of a field f or a sub-field defined before f change as a result of processing with LOOP. "AT NEW f." begins a new group of (table) lines with the same contents as the field f while "AT END OF f." concludes such a group. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the AT ... ENDAT processing of internal tables, all argument fields following f are filled with "*". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples &lt;/P&gt;&lt;P&gt;1. AT for sub-fields of an internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF COMPANIES OCCURS 20, &lt;/P&gt;&lt;P&gt;        NAME(30), &lt;/P&gt;&lt;P&gt;        PRODUCT(20), &lt;/P&gt;&lt;P&gt;        SALES TYPE I, &lt;/P&gt;&lt;P&gt;      END   OF COMPANIES. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;LOOP AT COMPANIES. &lt;/P&gt;&lt;P&gt;  AT NEW NAME. &lt;/P&gt;&lt;P&gt;    NEW-PAGE. &lt;/P&gt;&lt;P&gt;    WRITE / COMPANIES-NAME. &lt;/P&gt;&lt;P&gt;  ENDAT. &lt;/P&gt;&lt;P&gt;  WRITE: / COMPANIES-PRODUCT, COMPANIES-SALES. &lt;/P&gt;&lt;P&gt;  AT END OF NAME. &lt;/P&gt;&lt;P&gt;    SUM. &lt;/P&gt;&lt;P&gt;    WRITE: / COMPANIES-NAME, COMPANIES-SALES. &lt;/P&gt;&lt;P&gt;  ENDAT. &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The AT statements refer to the field COMPANIES-NAME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward Points if it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gunjan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Jun 2006 09:50:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-17T09:50:49Z</dc:date>
    <item>
      <title>control break statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1394965#M191484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;what is the difference between 'onchange of' and 'atend of' control breaks. explain in detail with example.&lt;/P&gt;&lt;P&gt;Thank u in advance.&lt;/P&gt;&lt;P&gt;SRI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jun 2006 08:57:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1394965#M191484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-17T08:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: control break statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1394966#M191485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ON CHANGE OF f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Executes the processing block enclosed by the "ON CHANGE OF f" and "ENDON" statements whenever the contents of the field f change (control break processing). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally, you use the statement to manipulate database fields during GET events or SELECT/ENDSELECT processing. &lt;/P&gt;&lt;P&gt;ON CHANGE OF is unsuitable for recognizing control levels in loops of this type because it always creates a global auxiliary field which is used to check for changes. This global auxiliary field is only changed in the relevant ON CHANGE OF statement. It is not reset when the processing enters loops or subroutines, so unwanted effects can occur if the loop or subroutine is executed again. Also, since it is set to its initial value when created (like any other field), any ON CHANGE OF processing will be executed after the first test, unless the contents of the field concerned happen to be identical to the initial value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA T100_WA TYPE T100. &lt;/P&gt;&lt;P&gt;SELECT * FROM T100 &lt;/P&gt;&lt;P&gt;         INTO T100_WA &lt;/P&gt;&lt;P&gt;         WHERE SPRSL = SY-LANGU AND &lt;/P&gt;&lt;P&gt;                         MSGNR &amp;lt; '010' &lt;/P&gt;&lt;P&gt;                   ORDER BY PRIMARY KEY. &lt;/P&gt;&lt;P&gt;  ON CHANGE OF T100_WA-ARBGB. &lt;/P&gt;&lt;P&gt;    ULINE. &lt;/P&gt;&lt;P&gt;    WRITE: / '**&lt;STRONG&gt;', T100_WA-ARBGB, '&lt;/STRONG&gt;**'. &lt;/P&gt;&lt;P&gt;  ENDON. &lt;/P&gt;&lt;P&gt;  WRITE: / T100_WA-MSGNR, T100_WA-TEXT. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Displays all messages with their numbers in the logon language, provided the number is less than '010'. &lt;/P&gt;&lt;P&gt;Each time the message class changes, it is output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT END OF f.&lt;/P&gt;&lt;P&gt;f is a sub-field of an internal table or extract dataset (EXTRACT) which is being processed with LOOP, i.e. the variants 1 and 2 only make sense within a LOOP. &lt;/P&gt;&lt;P&gt;Both "AT NEW f." and "AT END OF f. " introduce processing blocks which are concluded by " ENDAT.". &lt;/P&gt;&lt;P&gt;These processing blocks are processed whenever the contents of a field f or a sub-field defined before f change as a result of processing with LOOP. "AT NEW f." begins a new group of (table) lines with the same contents as the field f while "AT END OF f." concludes such a group. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the AT ... ENDAT processing of internal tables, all argument fields following f are filled with "*". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples &lt;/P&gt;&lt;P&gt;1. AT for sub-fields of an internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF COMPANIES OCCURS 20, &lt;/P&gt;&lt;P&gt;        NAME(30), &lt;/P&gt;&lt;P&gt;        PRODUCT(20), &lt;/P&gt;&lt;P&gt;        SALES TYPE I, &lt;/P&gt;&lt;P&gt;      END   OF COMPANIES. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;LOOP AT COMPANIES. &lt;/P&gt;&lt;P&gt;  AT NEW NAME. &lt;/P&gt;&lt;P&gt;    NEW-PAGE. &lt;/P&gt;&lt;P&gt;    WRITE / COMPANIES-NAME. &lt;/P&gt;&lt;P&gt;  ENDAT. &lt;/P&gt;&lt;P&gt;  WRITE: / COMPANIES-PRODUCT, COMPANIES-SALES. &lt;/P&gt;&lt;P&gt;  AT END OF NAME. &lt;/P&gt;&lt;P&gt;    SUM. &lt;/P&gt;&lt;P&gt;    WRITE: / COMPANIES-NAME, COMPANIES-SALES. &lt;/P&gt;&lt;P&gt;  ENDAT. &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The AT statements refer to the field COMPANIES-NAME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward Points if it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gunjan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jun 2006 09:50:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1394966#M191485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-17T09:50:49Z</dc:date>
    </item>
  </channel>
</rss>

