Hi,
Create an internal table of type LVC_T_FCAT and mark the option do_sum as 'X' and LVC_T_SORT and mark the option subtot as 'X' for the field you required. and pass these internal tables to the method SET_TABLE_FOR_FIRST_DISPLAY.
Please refer this link