Skip to Content
0
Former Member
Jun 26, 2008 at 02:17 PM

how to get subtotal and total per project in PS Module cl_gui_alv_grid

15 Views

Hi all,

i have a requirement of getting Subtotals and totals of few column in the alv grid. as i have already used cl_gui_alv_grid class to display the grid , so what excatly i have to follow to get the values.

i have tried with :

wa_sort TYPE lvc_s_sort

wa_sort-spos = '1'.

wa_sort-fieldname = 'POST1'.

wa_sort-up = 'X'.

wa_sort-subtot = 'X'.

APPEND wa_sort TO t_sort.

CLEAR: wa_sort.

And in fieldcat have passed X to do_sum field.

and

CALL METHOD grid1->set_table_for_first_display

EXPORTING

is_variant = w_variant

i_save = 'A'

is_layout = t_layout

it_toolbar_excluding = t_toolbar_excluding

CHANGING

it_outtab = it_final_1[]

it_fieldcatalog = t_fieldcat

it_sort = t_sort

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS

But i coudnt see any subtotal column and total column in the grid.

please help