<?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: Subtotaling in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotaling/m-p/3918515#M939038</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;Sort u r table based on (  I have a field in which i have values starting with letter L, T, and S )  that field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use control loop events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At end of field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narasimha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 May 2008 05:02:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-30T05:02:48Z</dc:date>
    <item>
      <title>Subtotaling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotaling/m-p/3918514#M939037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Forum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a field in which i have values starting with letter&lt;/P&gt;&lt;P&gt;L, T, and S. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have another field containing amount for the corresponding L, T,  and S.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is like this.. i need to do subtotal for individual values..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD1                              FIELD2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L0001                                1000&lt;/P&gt;&lt;P&gt;L0002                                1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                  Sub total          2000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T0001                                0500&lt;/P&gt;&lt;P&gt;T0002                                0200&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;                                         0700&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help me out&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mallika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 04:54:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotaling/m-p/3918514#M939037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T04:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Subtotaling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotaling/m-p/3918515#M939038</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;Sort u r table based on (  I have a field in which i have values starting with letter L, T, and S )  that field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use control loop events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At end of field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narasimha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 05:02:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotaling/m-p/3918515#M939038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T05:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Subtotaling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotaling/m-p/3918516#M939039</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;Check the below code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types : begin of tp_input,
        field1 type string,
        field2 type i,
        end of tp_input.

data : ig_input type standard table of tp_input,
       wg_input type tp_input.

data : subtotal1(4) type n,
       subtotal2(4) type n,
       subtotal3(4) type n.

wg_input-field1 = 'L0001'.
wg_input-field2 = '1000'.

append wg_input to ig_input.


wg_input-field1 = 'L0002'.
wg_input-field2 = '1000'.

append wg_input to ig_input.

wg_input-field1 = 'T0001'.
wg_input-field2 = '0500'.

append wg_input to ig_input.

wg_input-field1 = 'T0002'.
wg_input-field2 = '0200'.

append wg_input to ig_input.


loop at ig_input into wg_input.

if wg_input-field1 ca 'L'.

subtotal1 = subtotal1 + wg_input-field2.

elseif wg_input-field1 ca 'T'.

subtotal2 = subtotal2 + wg_input-field2.

elseif wg_input-field1 ca 'S'.

subtotal3 = subtotal3 + wg_input-field2.

endif.

endloop.

Write : subtotal1, / , subtotal2, / , subtotal3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 05:15:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotaling/m-p/3918516#M939039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T05:15:44Z</dc:date>
    </item>
  </channel>
</rss>

