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: 

To remove icons from Tool bar in a ALV list in Module pool program (OOPs)

Former Member
0 Kudos

Hi

I am developing ALV list in Module pool program using OOPs and custome container.

I have developed a interactive ALV list. By default I am getting the Icons of u201Cdelete rowu201D and u201Cinsert row u201Cand u201Ccutu201D in TOOl bar . I want to remove that . I do want other Icons such as "details".

I am using methods

1. set_table_for_first_display

2. set_ready_for_input

3. get_selected_rows

Guide me, know how to do it? How to remove some of the Icons from standard Tool bar .

thanks

Kakoli

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Write a form like this,

DATA : lt_exclude TYPE ui_functions.

FORM f003_exclude_tb_functions CHANGING p_lt_exclude TYPE ui_functions.

*To exclude tool bar fucctions which are not Required.

DATA ls_exclude TYPE ui_func.

REFRESH p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_select_all.

APPEND ls_exclude TO p_lt_exclude.

ENDFORM. " f003_exclude_tb_functions

form display.

PERFORM f003_exclude_tb_functions CHANGING lt_exclude. " ---> form defination is as above

CALL METHOD alv_grid->set_table_for_first_display

EXPORTING

is_layout = gs_layout

  • is_variant = ls_variant

  • i_save = 'A'

  • i_default = 'X'

it_toolbar_excluding = lt_exclude "-----> Pass it here

CHANGING

it_outtab = it_coupon_output

it_fieldcatalog = it_fieldcat.

endform.

Hope it helps you,

Regards,

Abhijit G. Borkar

3 REPLIES 3

Former Member
0 Kudos

Hi,

Write a form like this,

DATA : lt_exclude TYPE ui_functions.

FORM f003_exclude_tb_functions CHANGING p_lt_exclude TYPE ui_functions.

*To exclude tool bar fucctions which are not Required.

DATA ls_exclude TYPE ui_func.

REFRESH p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.

APPEND ls_exclude TO p_lt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_select_all.

APPEND ls_exclude TO p_lt_exclude.

ENDFORM. " f003_exclude_tb_functions

form display.

PERFORM f003_exclude_tb_functions CHANGING lt_exclude. " ---> form defination is as above

CALL METHOD alv_grid->set_table_for_first_display

EXPORTING

is_layout = gs_layout

  • is_variant = ls_variant

  • i_save = 'A'

  • i_default = 'X'

it_toolbar_excluding = lt_exclude "-----> Pass it here

CHANGING

it_outtab = it_coupon_output

it_fieldcatalog = it_fieldcat.

endform.

Hope it helps you,

Regards,

Abhijit G. Borkar

0 Kudos

Dear Abhijit,

Your answerer was very useful,

But the only problem i encountered is , if i don't wont any icon in the toolbar.

Since there  are almost 30 to 40 "ui_func" in the class CL_GUI_ALV_GRID

which makes me to write append statement multiple times.

Is there any way with which we can directly hide the entire toolbar by passing some variable or some thing else .

Thanks,

Gejo john

Hi Gejo,

You can add no_toolbar the in layout parameter like this :

data : ls_layout    TYPE lvc_s_layo.

ls_layout-NO_TOOLBAR = 'X'.

CALL METHOD mo_grid->set_table_for_first_display
         EXPORTING
           is_layout                     = ls_layout
           is_variant                    = lv_variant
           i_save                        = 'X'
         CHANGING
           it_outtab                     = gt_data
           it_fieldcatalog               = lt_fieldcat
         EXCEPTIONS
           invalid_parameter_combination = 1
           program_error                 = 2
           too_many_lines                = 3
           OTHERS                        = 4.

all of alv toolbar will be hide using this code.

Thanks