Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding -ALV count in subgroup.

Former Member
0 Kudos

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?

3 REPLIES 3

Former Member
0 Kudos

Hi,

Check the following link:

http://sapdev.co.uk/reporting/alv/alvgrid_sort.htm

Regards,

Bhaskar

Former Member
0 Kudos

HI EXPERTS

ANY UPDATE ON THIS??

Former Member
0 Kudos

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