<?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: calculating subtotal in table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-subtotal-in-table-control/m-p/3771669#M907534</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;&lt;STRONG&gt;subtotal_text&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output text for subtotals in the grid control if the subtotal criterion (column used by the user for calculating the subtotal) is hidden. In the default setting, the ALV Grid Control outputs the column header of the subtotal criterion and the value to which the subtotal calculated refers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Event parameters&lt;/P&gt;&lt;P&gt; Meaning&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ES_SUBTOTTXT_INFO&lt;/P&gt;&lt;P&gt;Type LVC_S_STXT&lt;/P&gt;&lt;P&gt; Structure with information on the subtotal criterion&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;EP_SUBTOT_LINE&lt;/P&gt;&lt;P&gt;Type Ref To DATA&lt;/P&gt;&lt;P&gt; Reference variable to the inserted subtotal line in the grid control. Columns for which no total was calculated remain set to their initial value.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;E_EVENT_DATA&lt;/P&gt;&lt;P&gt;Type Ref To CL_ALV_EVENT_DATA&lt;/P&gt;&lt;P&gt; Attribute M_DATA of this object is a reference to the subtotal text.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For an overview, see: Events of Class CL_GUI_ALV_GRID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You display a table with data of structure SFLIGHT in an ALV Grid Control. We now change the pre-set subtotal text for subtotal criterion plane type of table SFLIGHT :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define and implement an event handler method for event subtotal_text . Register this event with SET HANDLER . &lt;/P&gt;&lt;P&gt;Call a subroutine within this method and pass the event parameters to that subroutine. &lt;/P&gt;&lt;P&gt;Event parameters ep_subtot_line and e_event_data contain reference variables to generic data type DATA . This is why you must use field symbols in the subroutine:&lt;/P&gt;&lt;P&gt;FORM method_subtotal_text USING es_subtottxt_info TYPE lvc_s_stxt&lt;/P&gt;&lt;P&gt;                               ep_subtot_line TYPE REF TO data&lt;/P&gt;&lt;P&gt;                               e_event_data TYPE REF TO&lt;/P&gt;&lt;P&gt;                               cl_alv_event_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA ls_sflight LIKE sflight.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;fs1&amp;gt; STRUCTURE sflight DEFAULT ls_sflight,&lt;/P&gt;&lt;P&gt;                &amp;lt;fs2&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF es_subtottxt_info-criteria = 'PLANETYPE'.&lt;/P&gt;&lt;P&gt;    ASSIGN ep_subtot_line-&amp;gt;* TO &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;    ASSIGN e_event_data-&amp;gt;m_data-&amp;gt;* TO &amp;lt;fs2&amp;gt;.&lt;/P&gt;&lt;P&gt;    CONCATENATE es_subtottxt_info-keyword ': '&lt;/P&gt;&lt;P&gt;                &amp;lt;fs1&amp;gt;-planetype INTO &amp;lt;fs2&amp;gt;.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " METHOD_SUBTOTAL_TEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check your result as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate the total for a column. &lt;/P&gt;&lt;P&gt;Calculate subtotals for column plane type . &lt;/P&gt;&lt;P&gt;Hide column plane type . To do this, use either the standard context menu or a new layout.&lt;/P&gt;&lt;P&gt;The new text defined is displayed at the beginning of a subtotal line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 May 2008 07:14:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-08T07:14:09Z</dc:date>
    <item>
      <title>calculating subtotal in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-subtotal-in-table-control/m-p/3771667#M907532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all my requrement is like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using one tabbed screen .&lt;/P&gt;&lt;P&gt;in the last tabbed screen i have used table control in that&lt;/P&gt;&lt;P&gt;screen there is one requirement so that to  calculate the subtotal as we can do in case of alv reporting by using the subtotal button .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anybody help me how to do this .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 07:08:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-subtotal-in-table-control/m-p/3771667#M907532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T07:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: calculating subtotal in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-subtotal-in-table-control/m-p/3771668#M907533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Papps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess there is no subtotal functionality in Table control.&lt;/P&gt;&lt;P&gt;Probably what you can do is to code the subtotal logic in PAI when 'Sub Total' button is clicked and &lt;/P&gt;&lt;P&gt;Insert the subtotal values in in the internal table which is used for the table control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 07:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-subtotal-in-table-control/m-p/3771668#M907533</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T07:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: calculating subtotal in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-subtotal-in-table-control/m-p/3771669#M907534</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;&lt;STRONG&gt;subtotal_text&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output text for subtotals in the grid control if the subtotal criterion (column used by the user for calculating the subtotal) is hidden. In the default setting, the ALV Grid Control outputs the column header of the subtotal criterion and the value to which the subtotal calculated refers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Event parameters&lt;/P&gt;&lt;P&gt; Meaning&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ES_SUBTOTTXT_INFO&lt;/P&gt;&lt;P&gt;Type LVC_S_STXT&lt;/P&gt;&lt;P&gt; Structure with information on the subtotal criterion&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;EP_SUBTOT_LINE&lt;/P&gt;&lt;P&gt;Type Ref To DATA&lt;/P&gt;&lt;P&gt; Reference variable to the inserted subtotal line in the grid control. Columns for which no total was calculated remain set to their initial value.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;E_EVENT_DATA&lt;/P&gt;&lt;P&gt;Type Ref To CL_ALV_EVENT_DATA&lt;/P&gt;&lt;P&gt; Attribute M_DATA of this object is a reference to the subtotal text.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For an overview, see: Events of Class CL_GUI_ALV_GRID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You display a table with data of structure SFLIGHT in an ALV Grid Control. We now change the pre-set subtotal text for subtotal criterion plane type of table SFLIGHT :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define and implement an event handler method for event subtotal_text . Register this event with SET HANDLER . &lt;/P&gt;&lt;P&gt;Call a subroutine within this method and pass the event parameters to that subroutine. &lt;/P&gt;&lt;P&gt;Event parameters ep_subtot_line and e_event_data contain reference variables to generic data type DATA . This is why you must use field symbols in the subroutine:&lt;/P&gt;&lt;P&gt;FORM method_subtotal_text USING es_subtottxt_info TYPE lvc_s_stxt&lt;/P&gt;&lt;P&gt;                               ep_subtot_line TYPE REF TO data&lt;/P&gt;&lt;P&gt;                               e_event_data TYPE REF TO&lt;/P&gt;&lt;P&gt;                               cl_alv_event_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA ls_sflight LIKE sflight.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;fs1&amp;gt; STRUCTURE sflight DEFAULT ls_sflight,&lt;/P&gt;&lt;P&gt;                &amp;lt;fs2&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF es_subtottxt_info-criteria = 'PLANETYPE'.&lt;/P&gt;&lt;P&gt;    ASSIGN ep_subtot_line-&amp;gt;* TO &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;    ASSIGN e_event_data-&amp;gt;m_data-&amp;gt;* TO &amp;lt;fs2&amp;gt;.&lt;/P&gt;&lt;P&gt;    CONCATENATE es_subtottxt_info-keyword ': '&lt;/P&gt;&lt;P&gt;                &amp;lt;fs1&amp;gt;-planetype INTO &amp;lt;fs2&amp;gt;.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " METHOD_SUBTOTAL_TEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check your result as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate the total for a column. &lt;/P&gt;&lt;P&gt;Calculate subtotals for column plane type . &lt;/P&gt;&lt;P&gt;Hide column plane type . To do this, use either the standard context menu or a new layout.&lt;/P&gt;&lt;P&gt;The new text defined is displayed at the beginning of a subtotal line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 07:14:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-subtotal-in-table-control/m-p/3771669#M907534</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T07:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: calculating subtotal in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-subtotal-in-table-control/m-p/3771670#M907535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Jagdish can we do this in table control &lt;/P&gt;&lt;P&gt;i did not get it properly how to do it ? would you please explain it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 07:24:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-subtotal-in-table-control/m-p/3771670#M907535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-08T07:24:44Z</dc:date>
    </item>
  </channel>
</rss>

