04-10-2008 5:59 AM
Hi Experts,
I am using ALV grid in my Report.
I have 10 groups like 0-10 ,10-20,20-30,30-40.............
and i have some records in each group.
my problem is I have to count number of records per age group .
i can subtotal it easily for salary field.
but how should i count number of records per age group?
04-10-2008 6:22 AM
04-10-2008 7:25 AM
04-10-2008 7:52 AM
Hi,
Before displaying datta try this..
1. consider 2 fields r there : group, count.
2. declare two new itabs itab_groups, itab_new_disp as ur old itab - "itab_display".
itab_groups[] = itab_display[].
sort itab_groups by groups.
delete adjacent duplicates from itab_groups comparing groups.
loop at itab_groups.
loop at itab_display where group eq itab_groups-group.
count = count + itab_display-count.
itab_new_disp = itab_display.
append itab_new_disp.
endloop.
itab_new_disp-group = 'subtotal'.
itab_new_disp-COUNT = count.
append itab_new_disp.
clear : count.
endloop.
3. Now pass the itab - 'itab_new_disp' , to the fun module for display.
reply back..... with ur code..
With Rgds,
S.Barani