Skip to Content

ALV grid - Disabling options

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 26, 2009 at 05:21 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 26, 2009 at 05:53 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.