Application Development and Automation 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: 
Read only

ALV grid - Disabling options

Former Member
0 Likes
612

Hi,

I have a question on the ALV grid.

In the ALV grid, there is the button - EXPORT under which the following options are available:-

- Spreadsheet

- Word Processing

- Local File

- Send...

I just want to whether it is possible to remove the 'Send' option from the list, all other options should be available ?

Regards,

Ajit G

Hi,

I have a question on the ALV grid.

In the ALV grid, there is the button - EXPORT under which the following options are available:-

- Spreadsheet

- Word Processing

- Local File

- Send...

I just want to whether it is possible to remove the 'Send' option from the list, all other options should be available ?

Regards,

Ajit G

2 REPLIES 2
Read only

Former Member
0 Likes
515

Hi,

For this kind of a requirement where you want the standard ALV

pf-status to get modified, you have to exclude the required Send Option

functionality from it. You can do like:



DATA: itab_exclude TYPE slis_t_extab,
      wa_exclude TYPE slis_extab.

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

*& *MAINTAINIG INTERNAL TABLE FOR EXCLUDING COMPONENTS FROM THE ALV STANDARD TOOLBAR
* For excluding the components from the standard toolbar we have to comment the
*  i_callback_pf_status_set          = 'PF_STATUS' in the grid display function module
*&---------------------------------------------------------------------*

  wa_exclude-fcode = '&LFO'.

  APPEND wa_exclude TO itab_exclude.

  CLEAR wa_exclude.

  wa_exclude-fcode = '&NFO'.

  APPEND wa_exclude TO itab_exclude.  "You can like this exclude the function code of send Option functionality here


Then you can pass it in the Reuse Function Module,

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
*    I_INTERFACE_CHECK                 = ' '
*    I_BYPASSING_BUFFER                = ' '
*    I_BUFFER_ACTIVE                   = ' '
      i_callback_program                = sy-repid
      i_callback_pf_status_set          = 'PF_STATUS'
      i_callback_user_command           = 'COMM'
      i_callback_top_of_page            = 'TOP'
*    I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*    I_CALLBACK_HTML_END_OF_LIST       = ' '
*    I_STRUCTURE_NAME                  =
*    I_BACKGROUND_ID                   = ' '
      i_grid_title                      = it_grid_title
*    I_GRID_SETTINGS                   =
      is_layout                         = it_layout
      it_fieldcat                       = it_field
*    it_excluding                      = itab_exclude      " function codes appended in this internal table will get deleted in o/p

Hope it helps,

Regards

Mansi

Read only

Former Member
0 Likes
515

Hello Agit G,

To disable options in ALV; you got to call following method in PBO,


  ******************Hiding Buttons*****************
  ls_exclude = cl_gui_alv_grid=>mc_fc_sum.
  APPEND ls_exclude TO lt_exclude.
  CLEAR ls_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_mb_filter.
  APPEND ls_exclude TO lt_exclude.

  CLEAR ls_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_mb_sum.
  APPEND ls_exclude TO lt_exclude.

*lt_exclude contains all set of filters that have to be disabled.

*  IF w_check = space.

  CALL METHOD t_grid->set_table_for_first_display
    EXPORTING
*    i_buffer_active               =
*    i_bypassing_buffer            =
*    i_consistency_check           =
*      i_structure_name              = 'T_TABLE'
*    is_variant                    =
*    i_save                        =
*    i_default                     = 'X'
      is_layout                     = w_layo
*    is_print                      =
*    it_special_groups             =
     it_toolbar_excluding          = lt_exclude
*    it_hyperlink                  =
*    it_alv_graphics               =
*    it_except_qinfo               =
*    ir_salv_adapter               =
    CHANGING
      it_outtab                     = t_spfli
      it_fieldcatalog               = t_fcat
    it_sort                       = t_sort
*    it_filter                     =
*  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.

I hope that is going to help you.

Thanks,

Zahack