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: 

How to disable button in OO ALV toolbar

former_member205645
Participant
0 Kudos

Hello Gurus, i need to disable the "add new line button" in my editable OO ALV. Will reward points.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You will need to exclude the functions. Here's how.

code

You need to add the functions to this table which

are to be excluded.

Then send this table thru the method.

DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.

LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_PRINT.

APPEND LS_EXCLUDE TO PT_EXCLUDE.

CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = LAYOUT

IT_TOOLBAR_EXCLUDING = LT_EXCLUDE

IS_VARIANT = VARIANT

I_SAVE = 'A'

I_STRUCTURE_NAME = 'IALV'

CHANGING

IT_OUTTAB = IALV[]

IT_FIELDCATALOG = FIELDCAT[].

Regards,

Shiva.

6 REPLIES 6

Former Member
0 Kudos

Call METHOD toolbar->delete_button

exporting fcode = 'xxxx'.

There is also on the set for first display..


*   Display grid (First)
    CALL METHOD grid_action_0108->set_table_for_first_display
       EXPORTING
*        I_BYPASSING_BUFFER            =
*        I_BUFFER_ACTIVE               =
*        I_CONSISTENCY_CHECK           =
*        I_STRUCTURE_NAME              =
*        IS_VARIANT                    =
*        I_SAVE                        =
*        I_DEFAULT                     = 'X'
         is_layout                     = wa_layout_action_0108
*        IS_PRINT                      =
*        IT_SPECIAL_GROUPS             =
*        IT_TOOLBAR_EXCLUDING          =          "<== Note here.
*        IT_HYPERLINK                  =
*        IT_ALV_GRAPHICS               =
*        IT_EXCEPT_QINFO               =
      CHANGING
         it_outtab                     = wt_zlmcont
         it_fieldcatalog               = it_fcat_action_0108
*        IT_SORT                       =
*        IT_FILTER                     =
*      EXCEPTIONS
*        INVALID_PARAMETER_COMBINATION = 1
*        PROGRAM_ERROR                 = 2
*        TOO_MANY_LINES                = 3

Former Member
0 Kudos

Hi

Check out the program BCALV_EDIT_02 in the SLIS package

Regards

Fareedas

Former Member
0 Kudos

Hi,

You will need to exclude the functions. Here's how.

code

You need to add the functions to this table which

are to be excluded.

Then send this table thru the method.

DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.

LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_PRINT.

APPEND LS_EXCLUDE TO PT_EXCLUDE.

CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = LAYOUT

IT_TOOLBAR_EXCLUDING = LT_EXCLUDE

IS_VARIANT = VARIANT

I_SAVE = 'A'

I_STRUCTURE_NAME = 'IALV'

CHANGING

IT_OUTTAB = IALV[]

IT_FIELDCATALOG = FIELDCAT[].

Regards,

Shiva.

former_member205645
Participant
0 Kudos

Thank you Shiva, but can you please tell me where do i find the function names ??

0 Kudos

In your data area, double click on CL_GUI_ALV_GRID.

Then click on the Attributes Screen. They are listed there with many other things

0 Kudos

Thanks