11-26-2007 1:39 PM
I have dispalyed few fields in ALV report. First field is WERKS and afterwords AMOUNT comes in picture I want amount to de summed on change of WERKS.
How to do this in ALV? DO_SUM gives sum of whole column but I want at every new werks it should dispaly sum of amount. How to do it?
11-26-2007 2:26 PM
You need to implement the SORT table for the ALV.
DATA: ls_sort TYPE slis_sortinfo_alv.
DATA: xt_sort TYPE slis_t_sortinfo_alv.
ls_sort-fieldname = 'WEKRS'.
ls_sort-spos = 1.
ls_sort-up = 'X'.
ls_sort-sub_tot = 'X'. " << For subtotal
APPEND ls_sort TO xt_sort.
CLEAR ls_sort.
Than pass this table to ALV's IT_SORT parameter alongwith other parameters.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
.....
it_sort = Xt_sort
Regards,
Naimesh Patel