<?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 Sub total in ALV GRID using oops concept in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-total-in-alv-grid-using-oops-concept/m-p/2681514#M619843</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;If Plant (VBAP-WERKS) is not the same for all items on a Sales Order (VBAK-VBELN is the same for al items) then create a separate line on the report for each different plant specified in the line items.  Copy all fields from the original order line except for plant and Net Value.  Net Value should be the total of item Net Values for all items with the same plant in the order.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;Order----	                Item&lt;DEL&gt;-	        Plant&lt;/DEL&gt;-	                                Net Value---&lt;/P&gt;&lt;P&gt;123----		010&lt;DEL&gt;-	          3467&lt;/DEL&gt;-	                 100.00---&lt;/P&gt;&lt;P&gt;123----		020&lt;DEL&gt;-	          7865&lt;/DEL&gt;-	                 50.00---&lt;/P&gt;&lt;P&gt;123----		030&lt;DEL&gt;-	          3467&lt;/DEL&gt;-	                80.50---&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report:&lt;/P&gt;&lt;P&gt;Order&lt;DEL&gt;-	                Plant&lt;/DEL&gt;-	             Net Value---&lt;/P&gt;&lt;P&gt;123&lt;DEL&gt;-		3467&lt;/DEL&gt;-	             180.50---&lt;/P&gt;&lt;P&gt;123&lt;DEL&gt;-		7865&lt;/DEL&gt;-	              50.00----&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to dispaly the Report format in ALV Grid using oops concept...&lt;/P&gt;&lt;P&gt;no need of calling any function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nithya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Aug 2007 12:07:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-28T12:07:22Z</dc:date>
    <item>
      <title>Sub total in ALV GRID using oops concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-total-in-alv-grid-using-oops-concept/m-p/2681514#M619843</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;If Plant (VBAP-WERKS) is not the same for all items on a Sales Order (VBAK-VBELN is the same for al items) then create a separate line on the report for each different plant specified in the line items.  Copy all fields from the original order line except for plant and Net Value.  Net Value should be the total of item Net Values for all items with the same plant in the order.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;Order----	                Item&lt;DEL&gt;-	        Plant&lt;/DEL&gt;-	                                Net Value---&lt;/P&gt;&lt;P&gt;123----		010&lt;DEL&gt;-	          3467&lt;/DEL&gt;-	                 100.00---&lt;/P&gt;&lt;P&gt;123----		020&lt;DEL&gt;-	          7865&lt;/DEL&gt;-	                 50.00---&lt;/P&gt;&lt;P&gt;123----		030&lt;DEL&gt;-	          3467&lt;/DEL&gt;-	                80.50---&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report:&lt;/P&gt;&lt;P&gt;Order&lt;DEL&gt;-	                Plant&lt;/DEL&gt;-	             Net Value---&lt;/P&gt;&lt;P&gt;123&lt;DEL&gt;-		3467&lt;/DEL&gt;-	             180.50---&lt;/P&gt;&lt;P&gt;123&lt;DEL&gt;-		7865&lt;/DEL&gt;-	              50.00----&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to dispaly the Report format in ALV Grid using oops concept...&lt;/P&gt;&lt;P&gt;no need of calling any function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nithya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 12:07:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-total-in-alv-grid-using-oops-concept/m-p/2681514#M619843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T12:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sub total in ALV GRID using oops concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-total-in-alv-grid-using-oops-concept/m-p/2681515#M619844</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;Here is example code&lt;/P&gt;&lt;P&gt;This is the method to be called:&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;get_subtotals&lt;/P&gt;&lt;BR /&gt;&lt;B&gt;&lt;P&gt;Use&lt;/P&gt;&lt;/B&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Returns the current subtotals of the ALV Grid Control. Having created totals for at least one column, users can calculate at most nine subtotals. The list is sorted by the values of one or several columns (called the subtotals column). If a value is changed in the subtotals column, the subtotal is displayed (this is also referred to as control level change).&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Integration&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before you access the subtotals value, you use the method get_sort_criteria &lt;A href="Page 80"&gt;&lt;/A&gt; to get the sort table &lt;A href="https://community.sap.com/Ext."&gt;&lt;/A&gt;. One row of this table describes properties of a column in the output table.&lt;/P&gt;&lt;P&gt;&amp;#149; If the field SUBTOT is set for a column in this table, the column is a subtotals column.&lt;/P&gt;&lt;P&gt;&amp;#149; The field SPOS then indicates at which level (see below) the subtotal has been calculated.&lt;/P&gt;&lt;P&gt;&amp;#149; The field FIELDNAME contains the name of the subtotals column in the output table.&lt;/P&gt;&lt;P&gt;Based on this information, you specifically access the values of the tables passed (using reference variables COLLECT01 to COLLECT09).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Features&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL METHOD &amp;lt;ref. var. to CL_GUI_ALV_GRID&amp;gt;-&amp;gt;get_subtotals
IMPORTING 
EP_COLLECT00 = &amp;lt;reference variable of type REF TO DATA&amp;gt; 
EP_COLLECT01 = &amp;lt;reference variable of type REF TO DATA&amp;gt; 
EP_COLLECT02 = &amp;lt;reference variable of type REF TO DATA&amp;gt; 
EP_COLLECT03 = &amp;lt;reference variable of type REF TO DATA&amp;gt; 
EP_COLLECT04 = &amp;lt;reference variable of type REF TO DATA&amp;gt;
 EP_COLLECT05 = &amp;lt;reference variable of type REF TO DATA&amp;gt;
 EP_COLLECT06 = &amp;lt;reference variable of type REF TO DATA&amp;gt;
 EP_COLLECT07 = &amp;lt;reference variable of type REF TO DATA&amp;gt;
 EP_COLLECT08 = &amp;lt;reference variable of type REF TO DATA&amp;gt; 
EP_COLLECT09 = &amp;lt;reference variable of type REF TO DATA&amp;gt; 
ET_GROUPLEVELS = &amp;lt;ínternal table of type LVC_T_GRPL&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In order to access the values of EP_COLLECT00 to EP_COLLECT09, you use ASSIGN to dereference the relevant reference variable in a field symbol of your output table type (see below).&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meaning&lt;/P&gt;&lt;P&gt;EP_COLLECT00&lt;/P&gt;&lt;P&gt;Points to the totals line. Since there is only one totals line which, in addition, has a unique totalling area, no further information is available for this table in table ET_GROUPLEVELS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get_subtotals&lt;/P&gt;&lt;P&gt;EP_COLLECT01 to EP_COLLECT09&lt;/P&gt;&lt;P&gt;Point to the subtotals line. For each subtotals level, there is one reference variable. Each of these variables points to an internal table that has the type of the output table. EP_COLLECT01 points to the subtotal at the hightest level, while EP_COLLECT02 points to the subtotal at the second highest level, and so on. The levels are derived from the sort priority (field SPOS in the sort table &lt;A href="https://community.sap.com/Ext."&gt;&lt;/A&gt;). The column by which the data was sorted first, is the highest subtotals level.&lt;/P&gt;&lt;P&gt;ET_GROUPLEVELS&lt;/P&gt;&lt;P&gt;Manages all indexes for the individual control levels. The fields of the table have the following meaning:&lt;/P&gt;&lt;P&gt;&amp;#149; INDEX_FROM, INDEX_TO: Rows of the output table for which the subtotal was created&lt;/P&gt;&lt;P&gt;&amp;#149; LEVEL: Subtotals level (see above)&lt;/P&gt;&lt;P&gt;&amp;#149; COUNTER: Number of rows for which the subtotal was created&lt;/P&gt;&lt;P&gt;&amp;#149; COMPRESS: For this subtotals line, the user has hidden the associated rows.&lt;/P&gt;&lt;P&gt;&amp;#149; COLLECT: Indicates the subtotals table (01-09) in which the values are stored&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;For an overview, see Methods of Class CL_GUI_ALV_GRID &lt;A href="Page 66"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Activities&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 12:15:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-total-in-alv-grid-using-oops-concept/m-p/2681515#M619844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T12:15:45Z</dc:date>
    </item>
  </channel>
</rss>

