Hi All,
My report needs to calculate totals for the ALV report but I am unable to see the total Symbol (sigma symbol ) on the application toolbar on the ALV.
Can anyone suggest what is wrong with my code ?
Thanks.
I have given theportion of my code where I build the Field Catalogue and the ALV F.M. is called.
data :
begin of w_output,
prctr like csks-prctr, " Profit Center
ltext like cskt-ltext, " Cost center texts
kstar type cosp-kstar, " Cost Element
cost_comp(40) type c, " Cost Component
kostl like csks-kostl, " Cost Centers
prctr_per type t811f-value, " % Allocation to PCTR
plan_ctr type coep-wogbtr, " Plan Spending PCTR Total
plan_pctr type coep-wogbtr, " Plan Spending to PCTR
act_ctr type coep-wogbtr, " Actual Spending on CTR Total
act_pctr type coep-wogbtr, " Actual Spending to PCTR
waers type waers, " Currency
end of w_output.
data :
i_output like table of w_output,
i_output_temp like table of w_output,
w_layo type slis_layout_alv.
start-of-selection.
perform prepare_output.
perform build_fcat.
end-of-selection.
perform display_alv.
form build_fcat .
Field - Profit Center
w_fcat-fieldname = 'PRCTR'.
w_fcat-ref_tabname = 'CSKS'.
append w_fcat to i_fcat.
clear w_fcat.
Field - Profit Center Text
w_fcat-fieldname = 'LTEXT'.
w_fcat-ref_tabname = 'CSKT'.
append w_fcat to i_fcat.
clear w_fcat.
Field - Cost element
w_fcat-fieldname = 'KSTAR'.
w_fcat-ref_tabname = 'COSP'.
append w_fcat to i_fcat.
clear w_fcat.
Field - Cost Component
w_fcat-fieldname = 'COST_COMP'.
w_fcat-ref_tabname = 'I_OUTPUT'.
w_fcat-seltext_m = 'Cost Component'.
append w_fcat to i_fcat.
clear w_fcat.
Field - Cost Center
w_fcat-fieldname = 'KOSTL'.
w_fcat-do_sum = 'X'.
w_fcat-ref_tabname = 'CSKS'.
append w_fcat to i_fcat.
clear w_fcat.
Field - Plan Spending CTR total
w_fcat-fieldname = 'PLAN_CTR'.
w_fcat-ref_tabname = 'I_OUTPUT'.
w_fcat-seltext_m = 'Plan Spending CTR Total'.
w_fcat-do_sum = 'X'.
append w_fcat to i_fcat.
clear w_fcat.
Field - Actual Spending CTR Total
w_fcat-fieldname = 'ACT_CTR'.
w_fcat-ref_tabname = 'I_OUTPUT'.
w_fcat-do_sum = 'X'.
w_fcat-seltext_m = 'Actual Spending CTR Total'.
append w_fcat to i_fcat.
clear w_fcat.
w_layo-colwidth_optimize = 'X'.
w_layo-zebra = 'X'.
endform. " BUILD_FCAT
form display_alv .
Display ALV Report.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_grid_title = 'Plant Spending Report'
is_layout = w_layo
it_fieldcat = i_fcat
i_default = 'X'
i_save = 'X'
it_sort = i_sort
tables
t_outtab = 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. " IF sy-subrc NE 0
endform. " DISPLAY_ALV