<?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/1965819#M396678</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;keep it in the loop used to write the output into the basic list&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Feb 2007 14:26:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-26T14:26:33Z</dc:date>
    <item>
      <title>CONTROL BREAK STATEMENTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1965817#M396676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HELLO ALL,&lt;/P&gt;&lt;P&gt;       i have written a report program. where should i place the control break statements.  is it in the loop which i used to retrieve the data using select statements or in the loop used to wrie the output into the basic list??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;seenu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2007 14:25:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1965817#M396676</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-26T14:25: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/1965818#M396677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YOu should use the control break statements at internal table level for performance reasons.&lt;/P&gt;&lt;P&gt;Refer demo progs: DEMO_INT_TABLES_AT_1 and DEMO_INT_TABLES_AT_2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2007 14:26:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1965818#M396677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-26T14:26:23Z</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/1965819#M396678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;keep it in the loop used to write the output into the basic list&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2007 14:26:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1965819#M396678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-26T14:26:33Z</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/1965820#M396679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Control break stmt should be always in the LOOP ... ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT END OF f.
 
 
 
 
Effect 
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. 
Both "AT NEW f." and "AT END OF f. " introduce processing blocks which are concluded by " ENDAT.". 
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. 
 
Within the AT ... ENDAT processing of internal tables, all argument fields following f are filled with "*". 
 
 
 
Examples 
1. AT for sub-fields of an internal table 
 
 
 
DATA: BEGIN OF COMPANIES OCCURS 20, 
        NAME(30), 
        PRODUCT(20), 
        SALES TYPE I, 
      END   OF COMPANIES. 
... 
LOOP AT COMPANIES. 
  AT NEW NAME. 
    NEW-PAGE. 
    WRITE / COMPANIES-NAME. 
  ENDAT. 
  WRITE: / COMPANIES-PRODUCT, COMPANIES-SALES. 
  AT END OF NAME. 
    SUM. 
    WRITE: / COMPANIES-NAME, COMPANIES-SALES. 
  ENDAT. 
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2007 14:28:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1965820#M396679</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-26T14:28: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/1965821#M396680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi seenu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u need to use it inside LOOP AT ITAB... ENDLOOP.&lt;/P&gt;&lt;P&gt;when u r using control brk stmts..dont forget to sort the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;priya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2007 14:28:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1965821#M396680</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-26T14:28:46Z</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/1965822#M396681</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;control break stmts are used twhile displaying o/ps either  to calc totals or to group the fields and count the rows rtc.&lt;/P&gt;&lt;P&gt;so u shud use it in the loop used to write the o/p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the simple ex prog using control breaks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;A1(10) TYPE C,&lt;/P&gt;&lt;P&gt;A3(10) TYPE C,&lt;/P&gt;&lt;P&gt;A2 TYPE I,&lt;/P&gt;&lt;P&gt;END OF ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:TOT TYPE I,count TYPE I,i type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-A1 = 'char1'.&lt;/P&gt;&lt;P&gt;ITAB-A3 = 'abc'.&lt;/P&gt;&lt;P&gt;ITAB-A2 = '10'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-A1 = 'char1'.&lt;/P&gt;&lt;P&gt;ITAB-A3 = 'def'.&lt;/P&gt;&lt;P&gt;ITAB-A2 = '20'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-A1 = 'char1'.&lt;/P&gt;&lt;P&gt;ITAB-A3 = 'abc'.&lt;/P&gt;&lt;P&gt;ITAB-A2 = '30'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-A1 = 'char2'.&lt;/P&gt;&lt;P&gt;ITAB-A3 = 'abc'.&lt;/P&gt;&lt;P&gt;ITAB-A2 = '10'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-A1 = 'char2'.&lt;/P&gt;&lt;P&gt;ITAB-A3 = 'abc'.&lt;/P&gt;&lt;P&gt;ITAB-A2 = '20'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SORT ITAB BY A1 a3.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at itab.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;at new a1.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;write:/ itab-a1.&lt;/P&gt;&lt;P&gt;clear i.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;at new a3.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;if i &amp;gt; 0.&lt;/P&gt;&lt;P&gt;write:/10 itab-a3.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write:10 itab-a3.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;clear count.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count = count + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i = i + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;at end of a3.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;write:20 count.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;o/p :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;char1    abc                2    &lt;/P&gt;&lt;P&gt;            def                 1    &lt;/P&gt;&lt;P&gt;char2    abc                2   &amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;                                 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: don't forget to sort the table before using control breaks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*reward points for all helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2007 14:33:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1965822#M396681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-26T14:33:53Z</dc:date>
    </item>
  </channel>
</rss>

