<?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: subtotal in internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875318#M931494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;collect will work. but it has some restrictions(chck sap docu for this)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;effective solution for this is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare an internal itab and itab_fin table with fields:&lt;/P&gt;&lt;P&gt;vbeln&lt;/P&gt;&lt;P&gt;brgew&lt;/P&gt;&lt;P&gt;volum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab5.&lt;/P&gt;&lt;P&gt;move itab5-vbeln to itab-vbeln.&lt;/P&gt;&lt;P&gt;move itab5-brgew to itab-brgew.&lt;/P&gt;&lt;P&gt;move itab5-volum to itab-volum.&lt;/P&gt;&lt;P&gt;append itab.&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;loop at itab.&lt;/P&gt;&lt;P&gt;collect itab into itab_fin.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks-&lt;/P&gt;&lt;P&gt;Harmeet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 May 2008 18:26:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-09T18:26:24Z</dc:date>
    <item>
      <title>subtotal in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875315#M931491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have one internal table.&lt;/P&gt;&lt;P&gt;its fields are &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vbeln&lt;/P&gt;&lt;P&gt;posnr&lt;/P&gt;&lt;P&gt;brgew&lt;/P&gt;&lt;P&gt;gewei&lt;/P&gt;&lt;P&gt;volum&lt;/P&gt;&lt;P&gt;voleh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;defined internal table as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF itab5 OCCURS 0,&lt;/P&gt;&lt;P&gt;         vbeln LIKE vbap-vbeln,&lt;/P&gt;&lt;P&gt;         posnr LIKE vbap-posnr,&lt;/P&gt;&lt;P&gt;         brgew LIKE vbap-brgew,&lt;/P&gt;&lt;P&gt;         gewei LIKE vbap-gewei,&lt;/P&gt;&lt;P&gt;         volum LIKE vbap-volum,&lt;/P&gt;&lt;P&gt;         &lt;/P&gt;&lt;P&gt;         voleh LIKE vbap-voleh,&lt;/P&gt;&lt;P&gt;         END OF itab5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after some oerations on internal table i get some records in itab5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each vbeln there may be motre than one posnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for all posnr of one vbeln&lt;/P&gt;&lt;P&gt;i want subtotal of the field brgew and volum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have coded this way&lt;/P&gt;&lt;P&gt;but it gets total of all vbelns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; sort itab5 by vbeln .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at itab5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    on change of itab5-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at itab5 where vbeln = itab5-vbeln.&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;&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endon.&lt;/P&gt;&lt;P&gt;&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;pls suggest me the changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;points will be rewarded to each.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2008 16:25:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875315#M931491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T16:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: subtotal in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875316#M931492</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;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab5 by vbeln posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of posnr.&lt;/P&gt;&lt;P&gt;  collect...&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>Fri, 09 May 2008 16:35:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875316#M931492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T16:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: subtotal in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875317#M931493</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;Do this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:
  itab5_aux like itab5.

loop at itab5.
  collect itab5 to itab5_aux.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab5_aux will have the sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2008 16:37:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875317#M931493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T16:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: subtotal in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875318#M931494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;collect will work. but it has some restrictions(chck sap docu for this)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;effective solution for this is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare an internal itab and itab_fin table with fields:&lt;/P&gt;&lt;P&gt;vbeln&lt;/P&gt;&lt;P&gt;brgew&lt;/P&gt;&lt;P&gt;volum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab5.&lt;/P&gt;&lt;P&gt;move itab5-vbeln to itab-vbeln.&lt;/P&gt;&lt;P&gt;move itab5-brgew to itab-brgew.&lt;/P&gt;&lt;P&gt;move itab5-volum to itab-volum.&lt;/P&gt;&lt;P&gt;append itab.&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;loop at itab.&lt;/P&gt;&lt;P&gt;collect itab into itab_fin.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks-&lt;/P&gt;&lt;P&gt;Harmeet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2008 18:26:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875318#M931494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T18:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: subtotal in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875319#M931495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Feb 2011 12:40:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-in-internal-table/m-p/3875319#M931495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-16T12:40:52Z</dc:date>
    </item>
  </channel>
</rss>

