on 07-04-2022 5:01 AM
Hi
Before sending the table to ALV display - sort the table on the data and include that sort in ALV display
Also include do_sum = X in field catalog of that numeric column
Example:
DATA: ls_sort TYPE slis_sortinfo_alv.
CLEAR ls_sort.
ls_sort-spos = 1.
ls_sort-fieldname = 'BUDAT'.
ls_sort-up = 'X'.
ls_sort-group = 'UL'.
ls_sort-subtot = 'X'.
APPEND ls_sort TO lt_sort.
CLEAR ls_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_callback_pf_status_set = alv_status_set
i_callback_user_command = alv_user_comm
i_grid_title = grid_title
i_save = g_save
is_variant = gs_variant
is_layout = alv_layout
it_fieldcat = alv_fieldcat[]
it_events = gt_events[]
it_sort = alv_sort[] <======== INCLUDED THE SORT
IMPORTING
e_exit_caused_by_caller = g_exit_caused_by_caller
es_exit_caused_by_user = gs_exit_caused_by_user
TABLES
t_outtab = it_final. <=== your output table
Finally,
Add the do_sum = X in the field catalog of the column you want to sum up
Regards,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.