<?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: Clarification in Control Break Statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210383#M1627277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is another simple method to do these kind of operations. That is to use collect statement. Here is what you should do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare types with ur fields as following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types:  begin of ty_sort,
          doc       type int2,
          section   type char3,
          tax_code  type char2,
          value     type char5,
          surcharge type int2,
          tds_amnt  type int2,
        end of ty_sort.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now declare two internal tables with keys as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:   lt_sort type standard table of ty_sort with non-unique key section tax_code value,
        ls_sort type ty_sort,

        gt_sort type standard table of ty_sort with non-unique key section tax_code value,
        gs_sort type ty_sort.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using gui_upload get your data into the internal table gt_sort. after the logic your output will be stored in lt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at gt_sort into gs_sort.
    collect gs_sort into lt_sort.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thats all, after this logic you will have your result in lt_sort.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Oct 2011 09:40:42 GMT</pubDate>
    <dc:creator>Kartik2</dc:creator>
    <dc:date>2011-10-12T09:40:42Z</dc:date>
    <item>
      <title>Clarification in Control Break Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210377#M1627271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;                      I have the following fields in the internal Table,  &lt;/P&gt;&lt;P&gt;                     Doc No, Section No, Tax code, Value ,Surcharge, TDS Amt.&lt;/P&gt;&lt;P&gt;                    1000, aaa, a1,CO 1000,100&lt;/P&gt;&lt;P&gt;                    2000,aaa,a1,nonco,2000,200&lt;/P&gt;&lt;P&gt;                    3000, aaa,a1,co,1000,100&lt;/P&gt;&lt;P&gt;                    4000,bbb,a1,nonco,1000,100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                    the required output should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                   aaa,a1,co,2000,200&lt;/P&gt;&lt;P&gt;                   aaa,a1,nonco,2000,200&lt;/P&gt;&lt;P&gt;                  bbb,a1,nonco,1000,100&lt;/P&gt;&lt;P&gt;                   &lt;/P&gt;&lt;P&gt;                 ie it should sum the values based on Value field for the particular section &amp;amp;  taxcode, It should not &lt;/P&gt;&lt;P&gt;                consider Doc No.&lt;/P&gt;&lt;P&gt;                &lt;/P&gt;&lt;P&gt;               the code i have used is &lt;/P&gt;&lt;P&gt;              sort section no Taxcode value&lt;/P&gt;&lt;P&gt;              At end of value&lt;/P&gt;&lt;P&gt;              SUM.&lt;/P&gt;&lt;P&gt;              Endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            But i cant get the required output, Please reply &lt;EM&gt;&amp;lt;removed by moderator&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Oct 12, 2011 9:29 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 08:37:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210377#M1627271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T08:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification in Control Break Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210378#M1627272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For AT statements to work, all fields left from the field you are checking on with AT have to be similar. Additionally the internal table on which you want to use AT statements has to be sorted by your field you are doing your AT at.&lt;/P&gt;&lt;P&gt;So you either make yourself a structure where doc_no isnt in at all or if, then right to your field you want to check with AT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could however make this groupchange algorithm manually. it aint that hard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 08:41:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210378#M1627272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T08:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification in Control Break Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210379#M1627273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank for your prompt reply,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;          I had moved to another internal table without Doc Field, But still i am not able to get the correct output.&lt;/P&gt;&lt;P&gt;          Can u please provide me the sample code for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 08:48:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210379#M1627273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T08:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification in Control Break Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210380#M1627274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well, section number and taxcode are still left from your field and have different values. so this wil mess up the AT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And dont forget you need that table sorted by value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 08:55:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210380#M1627274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T08:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification in Control Break Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210381#M1627275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But to be honest in such a simple case i´d rather avoid AT statements, since they will bring up oher problems as well, as long as you dont make use of a field-symbol as a workarea to loop to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i would code something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefor i take ITAB as declared internal table and WA as your declared workare to loop to, as given.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: wa_check          like line of itab,
      lv_value        type kbetr.

sort itab by value ascending.

read table itab 
into wa_check
index 1.
loop at itab into we.
  "do your summing here
  if wa-value NE wa_check-value. "end of value reached
    "trigger print of line here
    wa_check = wa.
  endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 09:03:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210381#M1627275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T09:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification in Control Break Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210382#M1627276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank u Very Much...&lt;/P&gt;&lt;P&gt;                               I am getting the result as per the requirement by tour valuable suggestion. Problem is i ddnt maintain any sequence in Internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will Assign U the points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 09:11:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210382#M1627276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T09:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification in Control Break Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210383#M1627277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is another simple method to do these kind of operations. That is to use collect statement. Here is what you should do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare types with ur fields as following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types:  begin of ty_sort,
          doc       type int2,
          section   type char3,
          tax_code  type char2,
          value     type char5,
          surcharge type int2,
          tds_amnt  type int2,
        end of ty_sort.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now declare two internal tables with keys as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:   lt_sort type standard table of ty_sort with non-unique key section tax_code value,
        ls_sort type ty_sort,

        gt_sort type standard table of ty_sort with non-unique key section tax_code value,
        gs_sort type ty_sort.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using gui_upload get your data into the internal table gt_sort. after the logic your output will be stored in lt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at gt_sort into gs_sort.
    collect gs_sort into lt_sort.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thats all, after this logic you will have your result in lt_sort.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 09:40:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clarification-in-control-break-statement/m-p/8210383#M1627277</guid>
      <dc:creator>Kartik2</dc:creator>
      <dc:date>2011-10-12T09:40:42Z</dc:date>
    </item>
  </channel>
</rss>

