<?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: Problems with itab: subtotal in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162679#M752272</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;1)&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;if itab-betrh &amp;lt; 0.&lt;/P&gt;&lt;P&gt;itab-verb = itab-betrh.&lt;/P&gt;&lt;P&gt;else if itab-betrh &amp;gt; 0.&lt;/P&gt;&lt;P&gt;itab-ford = itab-betrh.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;modify itab.&lt;/P&gt;&lt;P&gt;at end of (changing field name for which u want to add totals)&lt;/P&gt;&lt;P&gt;sum.&lt;/P&gt;&lt;P&gt;itab-saldo = itab-gpart.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;modify itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try as above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subbu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2007 14:21:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-11T14:21:49Z</dc:date>
    <item>
      <title>Problems with itab: subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162677#M752270</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;i've got some problems with the report which i should write.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;P&gt;i have to move to the negative values of the itab-field betrh to the itab-field verb and the positiv to the itab-field ford, but i don't know how to do this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt;i have to make sub-totals for each gpart which should be displayed in the alv-grid in the itab-field Saldo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF itab OCCURS 1000,

      gs       TYPE dimaiobpar-zgst,
      status   TYPE dimaiobpar-zstatus,
      bukrs    TYPE dfkkop-bukrs,
      betrh    TYPE dfkkop-betrh,
      verb     TYPE dfkkop-betrh,
      ford     TYPE dfkkop-betrh,
      saldo    TYPE dfkkop-betrh,
      gpart    TYPE dfkkop-gpart,
      vtref    TYPE dfkkop-vtref,
      mtyp     TYPE dimabroker-brostmtyp,
      n1       TYPE adrc-name1,
      n2       TYPE adrc-name2,
      n3       TYPE adrc-name3,
      abrtyp   TYPE dimaiobpar-zabrtyp,
      vertart  TYPE dimaiobpar-zvat,
      zrtyp    TYPE dimaiobpar-azawe_x,
      opbel    TYPE dfkkop-opbel,

      END OF itab.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Tobias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2007 14:04:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162677#M752270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-11T14:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with itab: subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162678#M752271</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;Once data is populated into itab which -ve and +ve values .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab.

if itab-betrh LT 0.
itab-verb = itab-betrh
else.
itab-ford = itab-betrh.
endif.
modify itab.
clear itab.
endloop.

before ALV display add the below code :

  DATA: ls_sort TYPE slis_sortinfo_alv,
             gt_sort       TYPE slis_t_sortinfo_alv.


  CLEAR ls_sort.
  ls_sort-fieldname = 'SALDO'.
  ls_sort-up        = 'X'.
  ls_sort-subtot    = 'X'.
  APPEND ls_sort TO gt_sort.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And pass gt_sort to it_sort of ALV grid display export parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2007 14:19:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162678#M752271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-11T14:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with itab: subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162679#M752272</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;1)&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;if itab-betrh &amp;lt; 0.&lt;/P&gt;&lt;P&gt;itab-verb = itab-betrh.&lt;/P&gt;&lt;P&gt;else if itab-betrh &amp;gt; 0.&lt;/P&gt;&lt;P&gt;itab-ford = itab-betrh.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;modify itab.&lt;/P&gt;&lt;P&gt;at end of (changing field name for which u want to add totals)&lt;/P&gt;&lt;P&gt;sum.&lt;/P&gt;&lt;P&gt;itab-saldo = itab-gpart.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;modify itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try as above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subbu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2007 14:21:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162679#M752272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-11T14:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with itab: subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162680#M752273</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;&lt;/P&gt;&lt;P&gt;1.) You can loop the table itab and if the value of berth is negagive, move the same to itab-field VERB else move the values to the field Itab-field ford.&lt;/P&gt;&lt;P&gt;at the end of the loop modify your table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.) For Subtotal, while preparing sort table of your field catalaog, say subtotal = 'X'. If you are not able to find this read the documentation of the FM, to get details. You should get to know some more things tis way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2007 14:25:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162680#M752273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-11T14:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with itab: subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162681#M752274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok thx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the loop is working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the subtotal only makes a summary of the itab-field ford.&lt;/P&gt;&lt;P&gt;i need the subtotal of ford and verb so that i get the account balance for each gpart.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2007 15:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-itab-subtotal/m-p/3162681#M752274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-11T15:07:30Z</dc:date>
    </item>
  </channel>
</rss>

