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

Problem with subtotal, and the total icon is not displayed at the toolbar

Hi all,

I'm currentlyhaving difficulties working with the subtotal and the grandtotal. I have the code in the right place like the sort table

CLEAR k_sort.

ADD 1 TO k_sort-spos.

k_sort-fieldname = pv_fieldname.

k_sort-up = c_x.

k_sort-subtot = pv_subtot.

APPEND k_sort TO i_sort.

and the fieldcatalog

CLEAR k_fieldcat.

add 1 to k_fieldcat-col_pos.

k_fieldcat-fieldname = pv_fieldname.

k_fieldcat-tabname = c_tabname.

k_fieldcat-seltext_l = pv_seltext.

k_fieldcat-outputlen = pv_outputlen.

k_fieldcat-datatype = pv_datatype.

k_fieldcat-do_sum = pv_dosum.

APPEND k_fieldcat TO i_fieldcat.

but it didn't seems to show both the total and subtotal. Even the icon is not displayed at the ALV toolbar. The field which I need the total is a currency field. I even try other fields (interger fields) but with no luck. I'm using REUSE_ALV. Any help is greatly appreciated.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 11:23 AM

    Hi

    Check the fields in layout structure to display the icon

    Regards,

    MB

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2007 at 11:28 AM

    hi,

    In field catalog for the particular column which you want to sum make that as 'X'.

    say

     WHEN'MATNR'.
     it_fcat-do_sum = 'X'.
     CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program     = report_id
                i_grid_title           = ws_title
    *            i_callback_top_of_page = 'TOP-OF-PAGE'
                is_layout              = wa_layout
                it_fieldcat            = i_fieldcat[]
                it_sort                = i_sortcat
                i_save                 = 'A'
                it_events              = i_events
           TABLES
                t_outtab               = i_reportdata1
           EXCEPTIONS
                program_error          = 1
                OTHERS                 = 2.
      IF sy-subrc <> 0.
    

    This will enable.

    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.