Skip to Content
0
Former Member
Apr 01, 2009 at 07:41 PM

total and subtotal button not displayed in ALV_GRID_DISPLAY

27 Views

Hi,

my filed catalog is as follows:

*DIVISION

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'SPART'.

ls_fieldcat-outputlen = '04'.

ls_fieldcat-col_pos = col_pos.

ls_fieldcat-seltext_s = 'DIVI'.

ls_fieldcat-seltext_l = 'DIVISION'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

  • MATERIAL TEXT

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'MAKTX'.

  • ls_fieldcat-key = 'X'.

ls_fieldcat-outputlen = '50'.

ls_fieldcat-col_pos = col_pos.

ls_fieldcat-seltext_s = 'MODEL DESC'.

ls_fieldcat-seltext_l = 'MODEL DESRIPTION'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

  • MODEL

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'MODEL'.

  • ls_fieldcat-key = 'X'.

ls_fieldcat-outputlen = '10'.

ls_fieldcat-col_pos = col_pos.

ls_fieldcat-seltext_s = 'MODEL'.

ls_fieldcat-seltext_l = 'MODEL'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

  • MODEL TYPE

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'MODEL_TYPE'.

  • ls_fieldcat-key = 'X'.

ls_fieldcat-outputlen = '4'.

ls_fieldcat-col_pos = col_pos.

ls_fieldcat-seltext_s = 'TYPE'.

ls_fieldcat-seltext_l = 'MODEL TYPE'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

  • MODEL TRIM

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'MODEL_TRIM'.

  • ls_fieldcat-key = 'X'.

ls_fieldcat-outputlen = '5'.

  • ls_fieldcat-hotspot = 'X'.

ls_fieldcat-col_pos = col_pos.

ls_fieldcat-seltext_s = 'TRIM'.

ls_fieldcat-seltext_l = 'MODEL TRIM'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

  • VEHICLE IDENTIFICATION NUMBER (VIN)

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'VIN_NO'.

  • ls_fieldcat-key = 'X'.

ls_fieldcat-outputlen = '20'.

ls_fieldcat-col_pos = col_pos.

ls_fieldcat-seltext_s = 'VIN NO'.

ls_fieldcat-seltext_l = 'VIN NUMBER'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

*YEAR

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'YEAR'.

ls_fieldcat-outputlen = '06'.

ls_fieldcat-col_pos = col_pos.

ls_fieldcat-seltext_s = 'YEAR'.

ls_fieldcat-seltext_l = 'MODEL YEAR'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

  • QUANTITY (UNITS)

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'UNITS'.

  • ls_fieldcat-key = 'X'.

ls_fieldcat-outputlen = '04'.

ls_fieldcat-col_pos = col_pos.

ls_fieldcat-seltext_s = 'UNITS'.

ls_fieldcat-seltext_l = 'UNITS'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

  • PRICE PER UNIT

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'PRICE_UNIT'.

  • ls_fieldcat-key = ' '.

ls_fieldcat-outputlen = '14'.

ls_fieldcat-col_pos = col_pos.

  • ls_fieldcat-CFIELDNAME = 'VBRK-WAERK'.

ls_fieldcat-seltext_s = 'PRICE/UNIT'.

ls_fieldcat-seltext_l = 'PRICE PER UNIT'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

  • COST PER UNIT

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'COST_UNIT'.

  • ls_fieldcat-key = ' '.

ls_fieldcat-outputlen = '14'.

ls_fieldcat-col_pos = col_pos.

  • ls_fieldcat-CFIELDNAME = 'VBRK-WAERK'.

ls_fieldcat-seltext_s = 'COST/UNIT'.

ls_fieldcat-seltext_l = 'COST PER UNIT'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

  • GROSS PROFIT PER UNIT

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'GP_UNIT'.

  • ls_fieldcat-key = ' '.

ls_fieldcat-outputlen = '14'.

ls_fieldcat-col_pos = col_pos.

  • ls_fieldcat-CFIELDNAME = 'VBRK-WAERK'.

ls_fieldcat-seltext_s = 'GP/UNIT'.

ls_fieldcat-seltext_l = 'GP/UNIT'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

  • GROSS PROFIT - PERCETAGE PER UNIT

col_pos = col_pos + 1.

ls_fieldcat-fieldname = 'GP_PERCENTAGE'.

  • ls_fieldcat-key = ' '.

ls_fieldcat-outputlen = '14'.

ls_fieldcat-col_pos = col_pos.

ls_fieldcat-seltext_s = 'GP%/UNIT'.

ls_fieldcat-seltext_l = 'GP%/UNIT'.

APPEND ls_fieldcat TO l_fieldcat.

CLEAR ls_fieldcat.

and call to the FM is as follows:

DATA: gs_layout TYPE slis_layout_alv.

MOVE sy-repid TO g_repid.

CLEAR gs_layout.

gs_layout-zebra = 'X'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = g_repid

  • i_callback_user_command = 'USER_COMMAND'

i_structure_name = 'lt_output'

is_layout = gs_layout

  • it_sort = ls_fieldcat

it_fieldcat = gt_fieldcat

i_save = c_a

TABLES

t_outtab = lt_output

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

WRITE: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_GRID_DISPLAY'.

ENDIF.

When the output is displayed , total/ sub-total button is not displayed in the application toolbar .

I dont understand what might be the problem.Can someone help in solving this?

Thanks in advance.

Challa