Skip to Content
0
Former Member
Feb 01, 2008 at 02:37 AM

Subtotal in Dynamic ALV

202 Views

Hi,

I am actually working on a dynamic ALV report. But the subtotal is not working. It seems that the following code gives subtotal only when a static table is passed to the REUSE_ALV_GRID function module :

CLEAR wa_sort.

wa_sort-fieldname = c_sfcpf.

wa_sort-subtot = c_x.

APPEND wa_sort TO i_sort.

CLEAR wa_sort.

wa_sort-fieldname = c_plnbez.

wa_sort-subtot = c_x.

APPEND wa_sort TO i_sort.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_interface_check = c_blank

i_callback_program = v_repid

is_layout = wa_layout

it_fieldcat = i_fieldcat[]

it_sort = i_sort[]

it_events = i_event[]

i_save = c_a

TABLES

t_outtab = <fs_1>"i_output"

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Did anyone of you ever worked with subtotal in dynamic ALV?

Thanks for your replies.