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

problem in report how to do grand total so that it will show grand total

hi expert ,

how to do subtotal and grand total and show it in whether it is in negative or positive value in report.please help me and send some example?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 03:49 AM

    Hi,

    You can use the following code to do sub total and grand total.

    *  ALV data declarations
      data: it_sortcat   type slis_sortinfo_alv occurs 1,
            wa_sort like line of it_sortcat.
     perform build_sortcat.
    
    *&------------------------------------------------------------------*
    *&      Form  build_sortcat
    *&------------------------------------------------------------------*
    *       Build Sort catalog
    *-------------------------------------------------------------------*
    FORM build_sortcat .
      wa_sort-spos      = 1.
      wa_sort-fieldname = 'EBELN'.
      wa_sort-SUBTOT    = 'X'. "subtotals any totals column by this field
    *  gd_sortcat-tabname
      APPEND wa_sort TO it_sortcat.
    
      wa_sort-spos      = 2.
      wa_sort-fieldname = 'EBELP'.
    *  gd_sortcat-tabname
      APPEND wa_sort TO it_sortcat.
    ENDFORM.                    " build_sortcat
    

    And pass it_sort to it_sort of ALV FM export parameters.

    Thanks,

    Sriram Ponna.

    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.