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 Print Option in ALV Grid ?

Former Member
0 Kudos

Hi,

I want to disable print option in my report.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

in the function module... you will have a IT_EXCLUDING table in exporting session... in that pass a value

&RNT this will exclude the printing option

DATA : t_exclude TYPE slis_t_extab,
       fs_exclude TYPE slis_extab.
 
 
  FS_EXCLUDE-FCODE = '&RNT'.           
  APPEND FS_EXCLUDE TO T_EXCLUDE.
  CLEAR FS_EXCLUDE.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
 ..........
   IT_EXCLUDING                      = T_EXCLUDE
..........

4 REPLIES 4

Former Member
0 Kudos

Hi ,

helpful link..

Regards

Former Member
0 Kudos

Hi,

Refer to the following link for more information on ALV GRID.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a41...

It might help you.

Regards

Rajesh Kumar

Former Member
0 Kudos

hi,

in the function module... you will have a IT_EXCLUDING table in exporting session... in that pass a value

&RNT this will exclude the printing option

DATA : t_exclude TYPE slis_t_extab,
       fs_exclude TYPE slis_extab.
 
 
  FS_EXCLUDE-FCODE = '&RNT'.           
  APPEND FS_EXCLUDE TO T_EXCLUDE.
  CLEAR FS_EXCLUDE.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
 ..........
   IT_EXCLUDING                      = T_EXCLUDE
..........

Former Member
0 Kudos

Hi,

In order to remove the Print Icon do the following.

Implied, that should be done before displaying ALV.

So, While preparing ALV..

If it is using Classes, then:

DATA:wsl_button_exclude TYPE ui_func.

Then just remove the Buttons what ever you dont need as below.

wsl_button_exclude = cl_gui_alv_grid=>mc_fc_maximum.

APPEND wsl_button_exclude TO p_wtl_button_exclude.

wsl_button_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.

APPEND wsl_button_exclude TO p_wtl_button_exclude.

wsl_button_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.

APPEND wsl_button_exclude TO p_wtl_button_exclude.

wsl_button_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.

APPEND wsl_button_exclude TO p_wtl_button_exclude.

wsl_button_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.

APPEND wsl_button_exclude TO p_wtl_button_exclude.

*THIS IS FOR DISABLING PRINT

wsl_button_exclude = cl_gui_alv_grid=>MC_FC_PRINT.

APPEND wsl_button_exclude TO p_wtl_button_exclude.

After appending it to the Button Exclude Internal Table, pass it while calling

"set_table_for_first_display" as below.

CALL METHOD p_wcl_alv_grid->set_table_for_first_display

EXPORTING

is_layout = p_wsl_layout

is_variant = wsl_variant

i_save = 'X'

it_toolbar_excluding = p_wtl_button_exclude[]

CHANGING

it_outtab = wtg_outpt_tab[]

it_fieldcatalog = p_wtl_fieldcat

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

If Displaying using REUSE_ALV_GRID_DISPLAY,

Just Exculde the Button Print From the Internal table IT_EXCLUDING[].