<?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 ALV sum average subtotal... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751475#M325859</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone show me where in code of class CL_GUI_ALV_GRID are calculated:&lt;/P&gt;&lt;P&gt;sum, average, max, min. &lt;/P&gt;&lt;P&gt;I need to calculatete this values on a huge amount of data and I;m interesting how this is done in ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Tomek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Dec 2006 14:19:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-12T14:19:21Z</dc:date>
    <item>
      <title>ALV sum average subtotal...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751475#M325859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone show me where in code of class CL_GUI_ALV_GRID are calculated:&lt;/P&gt;&lt;P&gt;sum, average, max, min. &lt;/P&gt;&lt;P&gt;I need to calculatete this values on a huge amount of data and I;m interesting how this is done in ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Tomek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 14:19:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751475#M325859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-12T14:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: ALV sum average subtotal...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751476#M325860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For sum, you just need to pass DO_SUM = 'X' for the fields for which you need the totals, in the field catalog.&lt;/P&gt;&lt;P&gt;For averafe you need to pass DO_SUM = 'C'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for maximum, you need to sort the table based on the quantity and the key fields.&lt;/P&gt;&lt;P&gt;the first is maximum and the last will be the minimum(for descending order).&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 14:23:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751476#M325860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-12T14:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: ALV sum average subtotal...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751477#M325861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No! I don't need explanation how to calculate! As I wrote I need to find in class place where this is calculated. I must perform on huge amount data calculations and then calculate sum, averages, minimun, maximum and so one.&lt;/P&gt;&lt;P&gt;Thatway I'm curious how this is done in code of ALV Greed!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 14:29:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751477#M325861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-12T14:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: ALV sum average subtotal...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751478#M325862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomasz,&lt;/P&gt;&lt;P&gt;method GET_TOTALS of class CL_GUI_ALV_GRID says this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method get_totals .
* not in use while import/export from memory has to be used for
* saving the internal tables. Therfore the function module
* LVC_TOTALS_GET is used.
* ...
endmethod.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For subtotals, take a look at method GET_GROUPLEVELS, line 65:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  data: l_sumlevel      type i,
        l_sumlevel_unit type i.

  call function 'LVC_SUMLEVEL_TRANSLATE'
    changing
      ct_sort           = m_cl_variant-&amp;gt;mt_sort
      ct_grouplevels    = m_cl_variant-&amp;gt;mt_grouplevels
      c_sumlevel_global = l_sumlevel
      c_sumlevel_unit   = l_sumlevel_unit.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 14:30:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751478#M325862</guid>
      <dc:creator>former_member199581</dc:creator>
      <dc:date>2006-12-12T14:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: ALV sum average subtotal...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751479#M325863</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;it is not calculated in the class but you pass some values to the grid in the field catalogue like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD mygrid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;          it_toolbar_excluding          = t_fcodes[]&lt;/P&gt;&lt;P&gt;       CHANGING&lt;/P&gt;&lt;P&gt;          it_outtab                     = mytable[]&lt;/P&gt;&lt;P&gt;          it_fieldcatalog               = field_catal[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for your field catalogue you can fill the table so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            i_structure_name = 'SFLIGHT'&lt;/P&gt;&lt;P&gt;       CHANGING&lt;/P&gt;&lt;P&gt;            ct_fieldcat      = field_catal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field_catal is of type lvc_t_fcat and this one has among others fields DO_SUM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 14:32:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-sum-average-subtotal/m-p/1751479#M325863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-12T14:32:01Z</dc:date>
    </item>
  </channel>
</rss>

