<?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/1733586#M319248</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;                  Control break statements are used to stop the control at a particular point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. AT NEW f. &lt;/P&gt;&lt;P&gt;2. AT END OF f. &lt;/P&gt;&lt;P&gt;3. AT FIRST. &lt;/P&gt;&lt;P&gt;4. AT LAST. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;In a LOOP which processes a dataset created with EXTRACT , you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT . The sequence of statements which lies between them is then executed if a control break occurs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use these key words for control break processing with extract datasets only if the active LOOP statement is proceesing an extract dataset. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The control level structure with extract datasets is dynamic. It corresponds exactly to the sort key of the extract dataset, i.e. to the order of fields in the field group HEADER by which the extract dataset was sorted . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the start of a new control level (i.e. immediately after AT ), the following occurs in the output area of the current LOOP statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All default key fields (on the right) are filled with "*" after the current control level key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All other fields (on the right) are set to their initial values after the current control level key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Between AT and ENDAT , you can use SUM to insert the appropriate control totals in the number fields (see also ABAP/4 number types ) of the LOOP output area (on the right) after the current control level key. Summing is supported both at the beginning of a control level ( AT FIRST , AT NEW f ) and also the end of a control level ( AT END OF f , AT LAST ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of the control level processing (i.e. after ENDAT ), the old contents of the LOOP output area are restored&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use control break on any fields&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;chk this sample program&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REPORT YCHATEST LINE-SIZE 350.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TABLES MARA.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA : BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;         MATNR LIKE MARA-MATNR,&lt;/P&gt;&lt;P&gt;         AMOUNT TYPE P DECIMALS 2,&lt;/P&gt;&lt;P&gt;       END OF ITAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ITAB-MATNR = '12345'.&lt;/P&gt;&lt;P&gt;ITAB-AMOUNT = '100.20'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;CLEAR ITAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ITAB-MATNR = '12345'.&lt;/P&gt;&lt;P&gt;ITAB-AMOUNT = '100.20'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;CLEAR ITAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ITAB-MATNR = '3456'.&lt;/P&gt;&lt;P&gt;ITAB-AMOUNT = '100.20'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;CLEAR ITAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;sort itab by matnr amount.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  AT END OF AMOUNT.  &lt;/P&gt;&lt;P&gt;    WRITE : / ITAB-MATNR , ITAB-AMOUNT.&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;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2007 08:37:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-14T08:37:23Z</dc:date>
    <item>
      <title>control break statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1733582#M319244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi friends,&lt;/P&gt;&lt;P&gt;can i use control break statements on non primary key fields&lt;/P&gt;&lt;P&gt;can u plz give any example  if we can use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;malleswari.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 07:42:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1733582#M319244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-12T07:42:34Z</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/1733583#M319245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Check&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1870263"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 07:46:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1733583#M319245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-12T07:46:52Z</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/1733584#M319246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;yes we can use control break on any fields

chk this sample program


REPORT YCHATEST LINE-SIZE 350.

TABLES MARA.

DATA : BEGIN OF ITAB OCCURS 0,
         MATNR LIKE MARA-MATNR,
         AMOUNT TYPE P DECIMALS 2,
       END OF ITAB.

ITAB-MATNR = '12345'.
ITAB-AMOUNT = '100.20'.
APPEND ITAB.
CLEAR ITAB.

ITAB-MATNR = '12345'.
ITAB-AMOUNT = '100.20'.
APPEND ITAB.
CLEAR ITAB.

ITAB-MATNR = '3456'.
ITAB-AMOUNT = '100.20'.
APPEND ITAB.
CLEAR ITAB.

sort itab by matnr amount.

LOOP AT ITAB.
  AT END OF AMOUNT.  
    WRITE : / ITAB-MATNR , ITAB-AMOUNT.
  ENDAT.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 07:48:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1733584#M319246</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-12T07:48:47Z</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/1733585#M319247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt;  You can use the control breaks on any statement , but only thing is that it will be applicable to all the fields before the field on which you have applied the control break.&lt;/P&gt;&lt;P&gt;As in the above example , if the material of second record is changed from '12345' to '123456' the the output will be&lt;/P&gt;&lt;P&gt;12345    100.20&lt;/P&gt;&lt;P&gt;123456  100.20&lt;/P&gt;&lt;P&gt;3456      100.20.&lt;/P&gt;&lt;P&gt;So for correct application of control breaks all the field before this field must be considered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 07:56:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1733585#M319247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-12T07:56:06Z</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/1733586#M319248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;                  Control break statements are used to stop the control at a particular point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. AT NEW f. &lt;/P&gt;&lt;P&gt;2. AT END OF f. &lt;/P&gt;&lt;P&gt;3. AT FIRST. &lt;/P&gt;&lt;P&gt;4. AT LAST. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;In a LOOP which processes a dataset created with EXTRACT , you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT . The sequence of statements which lies between them is then executed if a control break occurs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use these key words for control break processing with extract datasets only if the active LOOP statement is proceesing an extract dataset. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The control level structure with extract datasets is dynamic. It corresponds exactly to the sort key of the extract dataset, i.e. to the order of fields in the field group HEADER by which the extract dataset was sorted . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the start of a new control level (i.e. immediately after AT ), the following occurs in the output area of the current LOOP statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All default key fields (on the right) are filled with "*" after the current control level key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All other fields (on the right) are set to their initial values after the current control level key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Between AT and ENDAT , you can use SUM to insert the appropriate control totals in the number fields (see also ABAP/4 number types ) of the LOOP output area (on the right) after the current control level key. Summing is supported both at the beginning of a control level ( AT FIRST , AT NEW f ) and also the end of a control level ( AT END OF f , AT LAST ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of the control level processing (i.e. after ENDAT ), the old contents of the LOOP output area are restored&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use control break on any fields&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;chk this sample program&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REPORT YCHATEST LINE-SIZE 350.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TABLES MARA.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA : BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;         MATNR LIKE MARA-MATNR,&lt;/P&gt;&lt;P&gt;         AMOUNT TYPE P DECIMALS 2,&lt;/P&gt;&lt;P&gt;       END OF ITAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ITAB-MATNR = '12345'.&lt;/P&gt;&lt;P&gt;ITAB-AMOUNT = '100.20'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;CLEAR ITAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ITAB-MATNR = '12345'.&lt;/P&gt;&lt;P&gt;ITAB-AMOUNT = '100.20'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;CLEAR ITAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ITAB-MATNR = '3456'.&lt;/P&gt;&lt;P&gt;ITAB-AMOUNT = '100.20'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;CLEAR ITAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;sort itab by matnr amount.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  AT END OF AMOUNT.  &lt;/P&gt;&lt;P&gt;    WRITE : / ITAB-MATNR , ITAB-AMOUNT.&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;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 08:37:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1733586#M319248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T08:37:23Z</dc:date>
    </item>
  </channel>
</rss>

