‎2011 Jul 12 7:14 PM
Hello,
How to calculate the subtotal through ABAP OOPS method.
The Subtotal needs to be changed to custom value. For eg: if there are values +m, -n, +o
The subtotal should include only m and o. (m+o). The calculated subtotal needs to be changed to desired valued based on condition.
please provide the solution << priority normalized >>
Edited by: Rob Burbank on Jul 12, 2011 2:41 PM
‎2011 Jul 14 7:39 AM
Hi,
Just to make sure, I have understood the problem correctly. You want to change the value of the totals or subtotals in ALV output.
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 Jul 14 7:39 AM
Hi,
Just to make sure, I have understood the problem correctly. You want to change the value of the totals or subtotals in ALV output.
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 Jul 14 7:21 PM
As you said , I am able to change the subtotal. But total is not getting changed.
How to calculate the Total based on subtotal. As of now, the total is based on the values of the column.
Total field needs to be changed to custom value(sum of changed subtotals)
please let me know the solution.