Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8604

Re: How to sum internal table field values.

$
0
0

Hi Sri Devi ,


Based on mblnr you can the internal table with the help of sorting table


in the field catalog pass as below  and sort based on the mblnr


  gw_fcat-fieldname = 'KWMENG'.

  gw_fcat-tabname = 'GT_FINAL'.

  gw_fcat-seltext_m = 'Quantity'.

  gw_fcat-do_sum = 'X'.  """""This is for sum up the internal Table""""

  APPEND gw_fcat TO gt_fcat.

  CLEAR gw_fcat.

*&---------------------------------------------------------------------*

*&      Form f_display_alv

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM f_display_alv .

  DATA:lv_repid TYPE sy-repid.

  lv_repid = sy-cprog.

 

  DATA: w_layout TYPE slis_layout_alv.

 

  w_layout-colwidth_optimize = 'X'.

  w_layout-zebra = 'X'.

 

 

  gw_sort-fieldname = 'VBELN'.

  gw_sort-tabname = 'GW_FINAL'.

  gw_sort-subtot = 'X'.

  APPEND gw_sort TO gt_sort.

 

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

      i_callback_program      = sy-cprog

      i_callback_user_command = 'USER_COMMAND'

      i_callback_top_of_page  = 'TOP_OF_PAGE'

      is_layout               = w_layout

      it_fieldcat             = gt_fcat

      it_sort                 = gt_sort

    TABLES

      t_outtab                = gt_final.

  1. ENDFORM.                    "f_display_alv

Viewing all articles
Browse latest Browse all 8604

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>