12-20-2006 8:50 AM
12-20-2006 8:54 AM
12-20-2006 8:54 AM
Just set the DO_SUM parameter in the field catalog to 'X' and sort on the field based on which you want the sub-totals.
Check package SLIS for examples.
12-20-2006 8:56 AM
hai
in slis_T_fieldcat_alv in that table u have field named DO_SUM = 'X' set this for
the field which are u want to calculate total.
for subtotal in slis_t_sortinfo_alv in that structure u have field named
SUBTOT = 'X' set this field which are u want to calculate subtotal.
12-20-2006 8:56 AM
hi,
1. <u><b>TOTAL.</b></u>
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
2. <u><b>How do I add subtotals</b></u>
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
Regards
Anver
12-20-2006 9:23 AM
Hi.
Totals :
while populating the fieldcat add one more field(DO_SUM) for which field u want total.
WA-FIELDNAME = ' '.
WA-SELTEXT_M = ' ' .
WA-DO_SUM = 'X'.
APPEND WA TO I_FIELDCAT.
CLEAR WA.
Subtotals.
Create internal table and wa type SLIS_T_SORTINFO_ALV.
and populate this internal table like this.
WA-FIELDNAME = ' '.(for which field u want subtotal)
WA-UP = 'X' (sorting)
WA-SUBTOTAL = 'X'.
APPEND WA TO I_SORT.
CLEAR WA.
and pass this internal table to I_SORT of REUSE_ALV_GRID_DISPLAY function module.
Thanks,
Srinivas