‎2010 May 03 3:54 PM
Hi Experts,
I want to sum a columm of a internal table (it_outtab) Method : CL_GUI_ALV_GRID->set_table_for_first_display.
I'm using the method set_sort_criteria to sort, but isn't working.
The following code is correct?
clear: wa_sort.
wa_sort-SPOS = '01'.
wa_sort-FIELDNAME = 'MATNR'.
wa_sort-UP = 'X'.
append wa_sort to it_sort.
clear: wa_sort.
wa_sort-SPOS = '02'.
wa_sort-FIELDNAME = 'WERKS'.
wa_sort-UP = 'X'.
append wa_sort to it_sort.
clear: wa_sort.
wa_sort-FIELDNAME = 'LABST'.
wa_sort-SUBTOT = 'X'.
append wa_sort to it_sort.
CALL METHOD og_alv_grid->set_sort_criteria
EXPORTING
it_sort = it_sort
EXCEPTIONS
no_fieldcatalog_available = 1
others = 2
I want to sum the column LABST.
Thanks.
Pacifier
‎2010 May 03 4:05 PM
Hi,
Did you mentioned the field do_sum in fieldcat?
fs_fcat type lvc_s_fcat.
fs_fcat-LABST = 'X'.
Regards,
Raghava Channooru
‎2010 May 03 4:05 PM
Hi,
Did you mentioned the field do_sum in fieldcat?
fs_fcat type lvc_s_fcat.
fs_fcat-LABST = 'X'.
Regards,
Raghava Channooru
‎2010 May 03 5:38 PM
Hi Raghava,
Thanks for help.
After fill the field the problem was solved and won't necessary to use the method set_sort_criteria.
Thanks,
Denilson