04-28-2010 9:57 AM
Hi all,
I am printing subtotals in ALV.
Under normal cases, it runs fine. However, there is a need to select custom layouts in the selection screen and then display.
When I select any custom defined layouts, the subtotals do not come anymore. Just normal ALV display without any sub total comes up.
Please let me know how to find out subtotals in custom layouts...
04-28-2010 10:03 AM
Hello,
try with this statement I_FIELDCAT-DO_SUM = 'SPACE'. use the property Do_sum.
Thanks,
santhosh
04-28-2010 10:12 AM
hi ,
for this you have to make 2 fileldcatalog one for the simple and other for the custom layout.
hope this helps
Regards
RItesh
04-28-2010 10:52 AM
Hi,
You have to do the changes in your code for displaying Sub-Total .
I am giving one example of code, i think it helps you.
REFRESH gt_sort.
CLEAR wa_sort.
wa_sort-fieldname = 'fieldname'.<-----that you want to sort and subtotal
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
wa_sort-tabname = 'IT_OUTPUT'.
APPEND wa_sort TO gt_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = gt_layout
it_fieldcat = it_fcat
it_sort = gt_sort[]
TABLES
t_outtab = it_output
At last in field catalog pass
wa_fcat-do_sum = 'X'
I think this code solves your problem.
Furthermore i also have one program to show the comple subtotal and total.
Let me know if you want hat also or not.
Thanks.
Deepak Sharma
04-28-2010 12:50 PM
Hi,
Any luck with one of the suggestions???
Tell me if you want some more help.
Thanks.
Deepak Sharma