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

how to Show only subtotal not column content

Hi All,

I have a requirement in which i am subtotaling the fields in REUSE_ALV_GRID_DISPLAY, and i need to display only subtotal at the end and whole column should be blank (i.e. only subtotal should be displyed not coloumn contents). do any one have idea about this.

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2010 at 04:54 AM

    Thanks everyone,

    but the problem is, i have data in otehr columns also and that should be displayed only the column for subtotal must b blank leaving subtotal at the end. It is an existing report so i was thinking not to change it for subtotal calculation if there is any was to achieve it through ALV itself.

    24.09.2010 CR1073-1 7001198 1US 17.000 2.000

    24.09.2010 CR1073-1 7001198 1US 00.000 2.000 0.000

    24.09.2010 CR1073-1 7001198 1US 00.000 2.000 0.000

    24.09.2010 CR1073-1 7001198 1US 00.000 2.000 0.000

    24.09.2010 CR1073-1 7001198 1US 00.000 2.000 0.000

    24.09.2010 CR1073-1 7001198 1US 00.000 2.000 0.000

    24.09.2010 CR1073-1 4343843 1IT 00.000 1.000 1.000

    17.000 13.000 1.000

    17.000 13.000 1.000

    in the above output i dont want to display 17.000 (need to diplay only subtotal.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2010 at 12:21 PM

    Hi,

    Sort the Key fields and there is one 'T' simble will show . Click Contl + T simble . It will show only subtotals Save the layout.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 27, 2010 at 12:41 PM

    Insert one dummy line in the ALV and calculte the sub-total inside the program.

    Display only the dummy line.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2010 at 03:42 PM

    An easy method is create an ITAB with only the fields for the subtotal group

    Example. For "key1" Subtotal

    DATA: BEGIN OF itab1 occurs 0,

    key1 type c,

    key2 type c,

    key3 type c,

    field1 type c,

    field2 type c,

    field3 type c,

    value type p,

    END OF itab1.

    • Sum all values for key1 field.

    DATA: BEGIN OF itab2 occurs 0,

    key1 type c,

    total_value type p,

    END OF itab2.

    ...

    clear itab1.

    loop at itab1.

    clear itab2.

    itab2-key1 = itab1-key1.

    itab2-total_value = itab1-value.

    collect itab2.

    endloop.

    ...

    ALV --> Show the itab2

    Regards.

    JMV

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2010 at 03:46 PM

    Output all of the fields, but also create a display variant that shows subtotals only. When you output the display, output it with this display variant.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 27, 2010 at 12:46 PM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 27, 2010 at 02:44 PM

    This message was moderated.

    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.