Skip to Content
0
Former Member
Jun 10, 2008 at 10:41 AM

Sub total in OO ALV

39 Views

Here is how i am getting my ALV output


DATA:      gt_fieldcat TYPE lvc_t_fcat,
               wa_fieldcat TYPE lvc_s_fcat.

  wa_layout-grid_title = sy-title.
  wa_layout-zebra      = 'X'.
  wa_layout-cwidth_opt = 'X'.
  wa_layout-sel_mode   = 'A'.
  wa_layout-info_fname = 'COLOR'.

  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name = 'ZPS_NI_SAVING'
    CHANGING
      ct_fieldcat      = gt_fieldcat.

  CALL METHOD alv_grid->set_table_for_first_display
      EXPORTING
        i_structure_name              = 'ZPS_NI_SAVING'
        is_layout                     = wa_layout
*      it_toolbar_excluding          = t_ui_functions
      CHANGING
        it_outtab                     = it_output
        it_fieldcatalog               = gt_fieldcat
      EXCEPTIONS
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        OTHERS                        = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Structure ZPS_NI_SAVING contains

DIVISION

DIVISION_TXT

COST_CENTRE

PERNR

LEVEL

SCHEME

EES_SACRIFICE

ERS_CONTRIB

NI_SAVING

TOTAL_PEN_SAV

I want the subtotal of EES_SACRIFICE and ERS_CONTRIB for DIVISION

Please let me know how to get the subtotals