2011 Nov 21 7:00 PM
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
2011 Nov 21 7:26 PM
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
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
2011 Nov 21 7:26 PM
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
2011 Nov 21 7:35 PM
2011 Nov 21 7:45 PM
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
2011 Nov 22 7:46 PM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |