Skip to Content

Don't have ALV Grid subtotal text at first display

Hello, community!

The problem:

I use REUSE_ALV_GRID_DISPLAY.

Subtotal's and total's texts don't appear until i'll make a drill-down action. Then it appears. What should i do to make it appear at first ALV display?

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2005 at 10:22 AM

    Hi,

    totals_text

    Value range: SPACE, string (not more than 60)

    ' ' = In the first column, the standard system indicates the totals level by displaying an adequate number of '*' for the overall total. After the asterisks, the system displays the string 'total' provided that the column width of the first output column is large enough. If the column width is not sufficient, only the asterisks are displayed.

    gs_layout-total_text = 'total'

    'string' = After the totals level indicated visually by means of '*', the system displays the string passed provided that the column width is sufficient.

    http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e056d52611d2b468006094192fe3/frameset.htm

    reward points for helpfull answers and close the thread if your question is solved.

    regards,

    venu.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2005 at 10:23 AM

    Hi,

    Declare them in the layout table.

    DATA: I_LAYOUT type slis_layout_alv.

    <b>I_LAYOUT-totals_text = `TOTAL `.

    I_LAYOUT-subtotals_text = `SUBTOTAL `.</b>

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = w_repid

    i_structure_name = 'SFLIGHT'

    <b> is_layout = i_layout</b> it_fieldcat = i_fieldcat[]

    it_sort = i_sort[]

    i_save = w_save

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    TABLES

    t_outtab = i_sflight

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    Hope it helps u.

    Kindly reward points if u find it useful.

    Thanks&Regards,

    Ruthra

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 14, 2005 at 10:35 AM

    Well, maybe I didn't say enough clear. My english is not so good 😊 I didn't mean -total_text property. But in my program i "group" same(equal) values of one column as "total text" and roll-up them with hiding other columns with not identical values for the mentioned above "level".

    And just this "total_text" doesn't appear at first display.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 14, 2005 at 10:54 AM

    Hi,

    Check this link for sample program.

    http://www.geocities.com/mpioud/Z_DEMO_ALV_SORT.html

    Kindly reward points by clicking the star on the left of reply,if it helps.

    Add a comment
    10|10000 characters needed characters exceeded

    • Explanation for my problem:

      REPORT z_demo_alv_sort.
      *---------------------------------------------------------------------*
      * This program lists orders (VBAK) with sort and sub-total for        *
      * 'sold-to-party' (KUNNR) and 'Sales organization' (VKORG)            *
      *---------------------------------------------------------------------*
      * Author : Michel PIOUD                                               *
      * Email : mpioud@yahoo.fr  HomePage : http://www.geocities.com/mpioud *
      *---------------------------------------------------------------------*
      TABLES : vbak.
      
      TYPE-POOLS: slis.                      " ALV Global types
      
      SELECT-OPTIONS :
        s_vkorg FOR vbak-vkorg,              " Sales organization
        s_kunnr FOR vbak-kunnr,              " Sold-to party
        s_vbeln FOR vbak-vbeln.              " Sales document
      
      SELECTION-SCREEN :
        SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
      PARAMETERS p_max(2) TYPE n DEFAULT '40' OBLIGATORY.
      SELECTION-SCREEN END OF LINE.
      
      DATA:
        BEGIN OF gt_vbak OCCURS 0,
          vkorg LIKE vbak-vkorg,             " Sales organization
          kunnr LIKE vbak-kunnr,             " Sold-to party
          vbeln LIKE vbak-vbeln,             " Sales document
          netwr LIKE vbak-netwr,             " Net Value of the Sales Order
          waerk LIKE vbak-waerk,             " Document currency
        END OF gt_vbak.
      
      *---------------------------------------------------------------------*
      INITIALIZATION.
      
        v_1 = 'Maximum of records to read'.
      
      *---------------------------------------------------------------------*
      START-OF-SELECTION.
      
        PERFORM f_read_data.
      
        PERFORM f_display_data.
      
      *---------------------------------------------------------------------*
      *      Form  f_read_data
      *---------------------------------------------------------------------*
      FORM f_read_data.
      
        SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
                 FROM vbak
                   UP TO p_max ROWS
                WHERE kunnr IN s_kunnr
                  AND vbeln IN s_vbeln
                  AND vkorg IN s_vkorg.
      
      ENDFORM.                               " F_READ_DATA
      *---------------------------------------------------------------------*
      *      Form  f_display_data
      *---------------------------------------------------------------------*
      FORM f_display_data.
      
        DEFINE m_fieldcat.
          add 1 to ls_fieldcat-col_pos.
          ls_fieldcat-fieldname   = &1.
          ls_fieldcat-ref_tabname = 'VBAK'.
          ls_fieldcat-do_sum      = &2.
          ls_fieldcat-cfieldname  = &3.
       <b>   ls_fieldcat-tech        = &4.</b>
          append ls_fieldcat to lt_fieldcat.
        END-OF-DEFINITION.
      
        DEFINE m_sort.
          add 1 to ls_sort-spos.
          ls_sort-fieldname = &1.
          ls_sort-up        = 'X'.
          ls_sort-subtot    = &2.
          append ls_sort to lt_sort.
        END-OF-DEFINITION.
      
        DATA:
          ls_fieldcat TYPE slis_fieldcat_alv,
          lt_fieldcat TYPE slis_t_fieldcat_alv,
          lt_sort     TYPE slis_t_sortinfo_alv,
          ls_sort     TYPE slis_sortinfo_alv,
          ls_layout   TYPE slis_layout_alv.
      
        m_fieldcat 'VKORG' ''  '' <b>'X'</b>.
        m_fieldcat 'KUNNR' ''  '' <b>'X'</b>.
        m_fieldcat 'VBELN' ''  '' <b>''</b>.
        m_fieldcat 'NETWR' 'X' 'WAERK' <b>''</b>.
        m_fieldcat 'WAERK' ''  '' <b>''</b>.
      
        m_sort 'VKORG' 'X'.                  " Sort by vkorg and subtotal
        m_sort 'KUNNR' 'X'.                  " Sort by kunnr and subtotal
        m_sort 'VBELN' ''.                   " Sort by vbeln
      
        ls_layout-cell_merge = 'X'.
        ls_layout-totals_before_items = 'X'.
      
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
             EXPORTING
                  is_layout   = ls_layout
                  it_fieldcat = lt_fieldcat
                  it_sort     = lt_sort
             TABLES
                  t_outtab    = gt_vbak.
      
      ENDFORM.                               " F_DISPLAY_DATA
      ***************** END OF PROGRAM Z_DEMO_ALV_SORT **********************
      

      When I add "bold" code i can't see subtotal text at first display.

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.