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

Making button disable in tool bar

Former Member
0 Likes
1,197

Guru,

I am displaying on ALV using class. I have some toolbar in out put.

Could you pls tell me how to disable them.

Thanks,

Sandeep Garg

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
848

copy the standard PF-status "Standard" and make changes to it and use it in ur code..

Guru,

I am displaying on ALV using class. I have some toolbar in out put.

Could you pls tell me how to disable them.

Thanks,

Sandeep Garg

5 REPLIES 5
Read only

former_member156446
Active Contributor
0 Likes
849

copy the standard PF-status "Standard" and make changes to it and use it in ur code..

Read only

Former Member
0 Likes
848

SET PF-STATUS 'XYZ' EXCLUDING 'WHAT BUTTON U WANT TO DISABLE(FUNCTION-CODE).

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
848

Hi,

Use this code to disable standard buttons from alv toolbar, its working:-


*FOR EXCLUDING STANDARD BUTTON FROM ALV TOOLBAR
DATA : it_exclude TYPE slis_t_extab,
            wa_exclude TYPE slis_extab.

*&---------------------------------------------------------------------*
*          FOR EXCLUDING STANDARD BUTTONS FROM ALV TOOLBAR
*&---------------------------------------------------------------------*
  wa_exclude-fcode = '&OUP'.
  APPEND wa_exclude TO it_exclude.
  CLEAR wa_exclude.

  wa_exclude-fcode = '&ODN'.
  APPEND wa_exclude TO it_exclude.
  CLEAR wa_exclude.

  wa_exclude-fcode = '&OAD'.
  APPEND wa_exclude TO it_exclude.
  CLEAR wa_exclude.

  wa_exclude-fcode = '&INFO'.
  APPEND wa_exclude TO it_exclude.
  CLEAR wa_exclude.

*--similarly append other function codes of the buttons that you want to exclude
*--and pass this internal table to FM REUSE_ALV_GRID_DISPLAY


*&---------------------------------------------------------------------*
*          DISPLAY RECORDS IN ALV GRID
*&---------------------------------------------------------------------*
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                = ' '
*   I_BUFFER_ACTIVE                   = ' '
   i_callback_program                = rep_id
*   i_callback_pf_status_set          = 'PF'
   i_callback_user_command           = 'COMMAND'
   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                      = wa_title
*   I_GRID_SETTINGS                   =
   is_layout                         = wa_layout
   it_fieldcat                       = it_field
   it_excluding                      = it_exclude "excule buttons
*   IT_SPECIAL_GROUPS                 =
   it_sort                           = it_sort
*   IT_FILTER                         =
*   IS_SEL_HIDE                       =
*   I_DEFAULT                         = 'X'
   i_save                            = 'A'
   is_variant                        = wa_variant
   it_events                         = it_event
*   IT_EVENT_EXIT                     =
*   IS_PRINT                          =
*   IS_REPREP_ID                      =
*   I_SCREEN_START_COLUMN             = 0
*   I_SCREEN_START_LINE               = 0
*   I_SCREEN_END_COLUMN               = 0
*   I_SCREEN_END_LINE                 = 0
*   I_HTML_HEIGHT_TOP                 = 0
*   I_HTML_HEIGHT_END                 = 0
*   IT_ALV_GRAPHICS                   =
*   IT_HYPERLINK                      =
*   IT_ADD_FIELDCAT                   =
*   IT_EXCEPT_QINFO                   =
*   IR_SALV_FULLSCREEN_ADAPTER        =
* IMPORTING
*   E_EXIT_CAUSED_BY_CALLER           =
*   ES_EXIT_CAUSED_BY_USER            =
    TABLES
      t_outtab                          = it_ekpo
 EXCEPTIONS
   program_error                     = 1
   OTHERS                            = 2.

  IF sy-subrc <> 0.
  ENDIF.

Hope this helps you.

Thanks & Regards,

Tarun Gambhir

Read only

Former Member
0 Likes
848

hi,

Your requirement can be achieved this way too.

declare a internal table of type sy-ucomm.

Fill the table with function codes you want to exclude from displaying on the basic list.

Then set pf-status 'MYSTATUS' excluding <internal-table>.

Thanks

Sharath

Read only

former_member195698
Active Contributor
0 Likes
848

Do u want to exclude some buttons in the ALV toolbar ?

Since u are using classes, u have to fill the table parameter IT_TOOLBAR_EXCLUDING

provide the buttons which u want to exclude.