Skip to Content
author's profile photo Former Member
Former Member

Regarding -ALV count in subgroup.

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 05:22 AM

    Hi,

    Check the following link:

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

    Regards,

    Bhaskar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 06:25 AM

    HI EXPERTS

    ANY UPDATE ON THIS??

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.