Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Urjent How to Disable SORT and SUMMATIONS icon in alv gris layout

Former Member
0 Kudos

Hi Experts,

How can we Disable SORT and SUMMATIONS icons(application tool bar) in alv grid layout.

Thanks in advance.

Manisha.

1 ACCEPTED SOLUTION

former_member212653
Active Contributor
0 Kudos

check this out:

pass the function codes of buttons which are not required

Function group: SLVC_FULLSCREEN

GUI status : STANDARD_FULLSCREEN


*&---------------------------------------------------------------------*
*& Report  ZTEST1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ztest1.
TYPE-POOLS: slis.

DATA:i_sbook TYPE STANDARD TABLE OF sbook INITIAL SIZE 0,
     i_fieldcatalog TYPE slis_t_fieldcat_alv,
     wa_sbook TYPE sbook.
DATA:wa_layout TYPE slis_layout_alv,
     i_excluding TYPE slis_t_extab,
     wa_excluding TYPE slis_extab.

SELECT-OPTIONS:
s_carrid FOR wa_sbook-carrid.

AT SELECTION-SCREEN.
  IF s_carrid IS NOT INITIAL.
    SELECT COUNT( * )
      FROM scarr WHERE carrid IN s_carrid.
    IF sy-subrc <> 0.
      MESSAGE e000(ztest) WITH 'Invalid Airline Code'.

    ENDIF.
  ENDIF.

START-OF-SELECTION.

  SELECT *

    FROM sbook
    INTO TABLE i_sbook
    UP TO 50 ROWS
    WHERE carrid IN s_carrid.
  CHECK sy-subrc = 0.

  DATA: l_repid TYPE syrepid VALUE sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name               = l_repid
      i_internal_tabname           = 'I_SBOOK'
     i_structure_name             = 'SBOOK'
      i_client_never_display       = 'X'
*   I_INCLNAME                   =
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = i_fieldcatalog
    EXCEPTIONS
      inconsistent_interface       = 1
      program_error                = 2
      OTHERS                       = 3
            .
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.



  wa_excluding-fcode  = '&UMC'.
  APPEND wa_excluding TO i_excluding.
  wa_excluding-fcode  = '&OUP'.
  APPEND wa_excluding TO i_excluding.
  wa_excluding-fcode  = '&ODN'.
  APPEND wa_excluding TO i_excluding.


*  wa_layout-confirmation_prompt = 'X'.
*  wa_layout-window_titlebar = 'My Title'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_structure_name = 'SBOOK'
      is_layout        = wa_layout
      it_excluding     = i_excluding
    TABLES
      t_outtab         = i_sbook
    EXCEPTIONS
      program_error    = 1
      OTHERS           = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

3 REPLIES 3

former_member181962
Active Contributor
0 Kudos

Former Member
0 Kudos

hello..

Go to program in SE80, go to its status and you will see the icons for sorting and summation.

Here you cna remove them from status or make them in active..

hope this helps.

Same thing you cna do from SE41 by entering program name and status name.

agasti..

former_member212653
Active Contributor
0 Kudos

check this out:

pass the function codes of buttons which are not required

Function group: SLVC_FULLSCREEN

GUI status : STANDARD_FULLSCREEN


*&---------------------------------------------------------------------*
*& Report  ZTEST1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ztest1.
TYPE-POOLS: slis.

DATA:i_sbook TYPE STANDARD TABLE OF sbook INITIAL SIZE 0,
     i_fieldcatalog TYPE slis_t_fieldcat_alv,
     wa_sbook TYPE sbook.
DATA:wa_layout TYPE slis_layout_alv,
     i_excluding TYPE slis_t_extab,
     wa_excluding TYPE slis_extab.

SELECT-OPTIONS:
s_carrid FOR wa_sbook-carrid.

AT SELECTION-SCREEN.
  IF s_carrid IS NOT INITIAL.
    SELECT COUNT( * )
      FROM scarr WHERE carrid IN s_carrid.
    IF sy-subrc <> 0.
      MESSAGE e000(ztest) WITH 'Invalid Airline Code'.

    ENDIF.
  ENDIF.

START-OF-SELECTION.

  SELECT *

    FROM sbook
    INTO TABLE i_sbook
    UP TO 50 ROWS
    WHERE carrid IN s_carrid.
  CHECK sy-subrc = 0.

  DATA: l_repid TYPE syrepid VALUE sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name               = l_repid
      i_internal_tabname           = 'I_SBOOK'
     i_structure_name             = 'SBOOK'
      i_client_never_display       = 'X'
*   I_INCLNAME                   =
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = i_fieldcatalog
    EXCEPTIONS
      inconsistent_interface       = 1
      program_error                = 2
      OTHERS                       = 3
            .
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.



  wa_excluding-fcode  = '&UMC'.
  APPEND wa_excluding TO i_excluding.
  wa_excluding-fcode  = '&OUP'.
  APPEND wa_excluding TO i_excluding.
  wa_excluding-fcode  = '&ODN'.
  APPEND wa_excluding TO i_excluding.


*  wa_layout-confirmation_prompt = 'X'.
*  wa_layout-window_titlebar = 'My Title'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_structure_name = 'SBOOK'
      is_layout        = wa_layout
      it_excluding     = i_excluding
    TABLES
      t_outtab         = i_sbook
    EXCEPTIONS
      program_error    = 1
      OTHERS           = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.