<?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 PROBLEM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-problem/m-p/2994690#M707404</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Khan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for this you should slightly modify the declaration of your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let the plant field be the first field in your internal table.like,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;          werks type t001w-werks,&lt;/P&gt;&lt;P&gt;          -&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;          -&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;          -&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now in the loop,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;   at new werks.&lt;/P&gt;&lt;P&gt;      write:/ itab-werks.&lt;/P&gt;&lt;P&gt;   endat.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;     write:/ ...............( all table fields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   at end of werks.&lt;/P&gt;&lt;P&gt;      sum.&lt;/P&gt;&lt;P&gt;      write:/ itab- ( all the qty &amp;amp; currency fields)&lt;/P&gt;&lt;P&gt;   endat.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Oct 2007 10:40:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-25T10:40:25Z</dc:date>
    <item>
      <title>CONTROL BREAK PROBLEM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-problem/m-p/2994688#M707402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;              I have a classical report that shows record from many Plants. I have sorted the Internal table by plant and now want to display the data acording to plant. It has to first show the plant name then below that it shows all data related to that plant and then Total of that plant. For that I used control breal statement ( On change of  ) to display plant. But what could I use to display total at end of every plant data. I tried ( at end of ) but it shows total after every line. Plz help.&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2007 10:34:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-problem/m-p/2994688#M707402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-25T10:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: CONTROL BREAK PROBLEM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-problem/m-p/2994689#M707403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;See this sample doc and code and write the report accordingly&lt;/P&gt;&lt;P&gt;All this AT NEW, AT FIRST, AT END OF and AT LAST are called control break statements of Internal tables and are used to calculate the TOTALS based on sertain key fields in that internal table&lt;/P&gt;&lt;P&gt;FIrst to use these statements the ITAB has to be sorted by the key fields on whcih you need the SUM of the fields.&lt;/P&gt;&lt;P&gt;Some time you will get * when mopving data from this int table to other table using these commands&lt;/P&gt;&lt;P&gt;so you have to use&lt;/P&gt;&lt;P&gt;READ TABLE ITAB INDEX SY-TABIX in AT..ENDAT..if you are using other fields between them&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: sflight_tab TYPE SORTED TABLE OF sflight&lt;/P&gt;&lt;P&gt;WITH UNIQUE KEY carrid connid fldate,&lt;/P&gt;&lt;P&gt;sflight_wa LIKE LINE OF sflight_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM sflight&lt;/P&gt;&lt;P&gt;INTO TABLE sflight_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT sflight_tab INTO sflight_wa.&lt;/P&gt;&lt;P&gt;AT NEW connid.&lt;/P&gt;&lt;P&gt;WRITE: / sflight_wa-carrid,&lt;/P&gt;&lt;P&gt;sflight_wa-connid.&lt;/P&gt;&lt;P&gt;ULINE.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;WRITE: / sflight_wa-fldate,&lt;/P&gt;&lt;P&gt;sflight_wa-seatsocc.&lt;/P&gt;&lt;P&gt;AT END OF connid.&lt;/P&gt;&lt;P&gt;SUM.&lt;/P&gt;&lt;P&gt;ULINE.&lt;/P&gt;&lt;P&gt;WRITE: / 'Sum',&lt;/P&gt;&lt;P&gt;sflight_wa-seatsocc UNDER sflight_wa-seatsocc.&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;AT END OF carrid.&lt;/P&gt;&lt;P&gt;SUM.&lt;/P&gt;&lt;P&gt;ULINE.&lt;/P&gt;&lt;P&gt;WRITE: / 'Carrier Sum',&lt;/P&gt;&lt;P&gt;sflight_wa-seatsocc UNDER sflight_wa-seatsocc.&lt;/P&gt;&lt;P&gt;NEW-PAGE.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;AT LAST.&lt;/P&gt;&lt;P&gt;SUM.&lt;/P&gt;&lt;P&gt;WRITE: / 'Overall Sum',&lt;/P&gt;&lt;P&gt;sflight_wa-seatsocc UNDER sflight_wa-seatsocc.&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;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harini.S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2007 10:38:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-problem/m-p/2994689#M707403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-25T10:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: CONTROL BREAK PROBLEM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-problem/m-p/2994690#M707404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Khan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for this you should slightly modify the declaration of your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let the plant field be the first field in your internal table.like,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;          werks type t001w-werks,&lt;/P&gt;&lt;P&gt;          -&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;          -&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;          -&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now in the loop,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;   at new werks.&lt;/P&gt;&lt;P&gt;      write:/ itab-werks.&lt;/P&gt;&lt;P&gt;   endat.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;     write:/ ...............( all table fields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   at end of werks.&lt;/P&gt;&lt;P&gt;      sum.&lt;/P&gt;&lt;P&gt;      write:/ itab- ( all the qty &amp;amp; currency fields)&lt;/P&gt;&lt;P&gt;   endat.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2007 10:40:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-problem/m-p/2994690#M707404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-25T10:40:25Z</dc:date>
    </item>
  </channel>
</rss>

