Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SubTotal - ALV

Former Member
0 Likes
819

Hello,

Need to know if it is possible to manipulate the calculation in an ALV-line totalizer.

I mounted my ALV highlighting the column Sub total (do_sum) but in my report that I have colulas are percentages (where the column% occupancy is calculated on two columns) in this column should show the percentage of totalizing column totals and not the sum % of the above.

I really have no idea if that's possible, I would like to confirm a position before moving to the user.

Thank you for your attention.

Michely

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
767

You can try getting the data of the Subtotal, using GET_SUBTOTALS method and modify them.

Something like this would help: [Classical ALV: Change Subtotal|http://help-abap.zevolving.com/2008/09/classical-alv-change-subtotal/]

You should also make sure they print correctly, [Classical ALV: Change Subtotal u2013 II for Print|http://help-abap.zevolving.com/2009/03/classical-alv-change-subtotal-ii-for-print/]

Regards,

Naimesh Patel

Hello,

Need to know if it is possible to manipulate the calculation in an ALV-line totalizer.

I mounted my ALV highlighting the column Sub total (do_sum) but in my report that I have colulas are percentages (where the column% occupancy is calculated on two columns) in this column should show the percentage of totalizing column totals and not the sum % of the above.

I really have no idea if that's possible, I would like to confirm a position before moving to the user.

Thank you for your attention.

Michely

4 REPLIES 4
Read only

naimesh_patel
Active Contributor
0 Likes
768

You can try getting the data of the Subtotal, using GET_SUBTOTALS method and modify them.

Something like this would help: [Classical ALV: Change Subtotal|http://help-abap.zevolving.com/2008/09/classical-alv-change-subtotal/]

You should also make sure they print correctly, [Classical ALV: Change Subtotal u2013 II for Print|http://help-abap.zevolving.com/2009/03/classical-alv-change-subtotal-ii-for-print/]

Regards,

Naimesh Patel

Read only

0 Likes
767

Thank you!

Read only

Former Member
0 Likes
767

Hi,

Please find the sample code below. You can calculate the desired value and update the ALV total for the column with the calculated value.



data : go_grid_mark  TYPE REF TO cl_gui_alv_grid,
          lv_totals TYPE REF TO data.
 
CALL METHOD go_grid_mark->get_subtotals
      IMPORTING
        ep_collect00 = lv_totals.
 
ASSIGN lv_totals->* TO <ft_totals>.
 
   LOOP AT <ft_totals> ASSIGNING <fs_total>.
      ASSIGN COMPONENT 'SOME_FIELD' OF STRUCTURE <fs_total> TO <fv_total>.
<fv_total> = "SOME VALUE".
modify <ft_totals> from <fs_total>
    ENDLOOP.
 

Hope this helps.

Regards,

Sagar

Read only

0 Likes
767

And how do I handle the general totalisation has the GET_TOTALS method but is not implemented, any tips? The SubTotal gave just right!

Tanks