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: 

Customize the standard application tool in alv report

Former Member
0 Kudos
171

Hi Experts,

I want to disable only Excel button of the application tool bar in the alv report. So, i want the process how i can do that...please help me with a sample code......

Thanks,

Rocky.

1 ACCEPTED SOLUTION

former_member156446
Active Contributor
0 Kudos
81

you got to edit the PF status and set ur own pf status..

search in the forum fro set pf-status

tip: copy the pf status named standard and edit as per ur req.

6 REPLIES 6

former_member156446
Active Contributor
0 Kudos
82

you got to edit the PF status and set ur own pf status..

search in the forum fro set pf-status

tip: copy the pf status named standard and edit as per ur req.

0 Kudos
81

Hi Joy,

Thanks for u r reply, but i dnt know how to copy that standard pf status.

Please explain me with a sample code....

Thanks,

Rocky.

0 Kudos
81

hi,

you can copy pf status using SE41 transaction.

0 Kudos
81

Hi Rocky,

If you are using normal ALV report (and not object-oriented), you can do the following:

Go to SE41. Type in program name = SAPLKKBL. Status name = STANDARD.

Copy the GUI status STANDARD of SAPLKKBL to your Program.

Then you can either go to GUI status of your program (using SE41 or SE80), and simply delete the excel button.

Or write the following code for excluding it.

FORM pf_stat_set USING extab TYPE slis_t_extab.

DATA: w_extab TYPE slis_extab.

w_extab-fcode = '&XXL'.

APPEND w_extab TO extab.

*/ Setting GUI status (assuming the newly copied gui status is named as GUISTATUS1 )

SET PF-STATUS 'GUISTATUS1' EXCLUDING extab.

ENDFORM. " pf_stat_set

Note: &XXL is the function code for Excel.

If you are using Object Oriented ALV, then you can do the following:

DATA: it_excl_toolbar TYPE ui_functions.

DATA: wa_excl_toolbar TYPE ui_func.

REFRESH:it_excl_toolbar.

CLEAR: wa_excl_toolbar.

MOVE '&XXL' TO wa_excl_toolbar.

APPEND wa_excl_toolbar TO it_excl_toolbar.

CALL METHOD go_grid_alv->set_table_for_first_display

EXPORTING

i_buffer_active = 'X'

is_layout = wa_layout

it_toolbar_excluding = it_excl_toolbar

CHANGING

it_outtab = it_output[]

it_fieldcatalog = it_fcat.

Let us know if you still face any issues.

Thanks,

Nisha Vengal.

Former Member
0 Kudos
81

Hi,

Note : this is sample code. the fct codes for Excel are to be checked.

In ALV with OO you can do this to disable some fields

data: ls_exclude type ui_func,

lt_toolbar_excluding type ui_functions.

ls_exclude = cl_gui_alv_grid=>mc_mb_export.

append ls_exclude to lt_toolbar_excluding.

ls_exclude = cl_gui_alv_grid=>mc_mb_view.

append ls_exclude to lt_toolbar_excluding.

call method g_alv_grid3->set_table_for_first_display

exporting

is_layout = gs_layout

is_variant = h_layout

i_save = 'U'

it_toolbar_excluding = lt_toolbar_excluding

changing

it_outtab = <Internal table>

it_fieldcatalog = h_t_sel_fieldcat

exceptions

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

others = 4.

for the reuse_alv_grid_display do the following :

data: i_fcode_extab type slis_t_extab,

wa_fcode type slis_extab,

wa_fcode = 'PRNT'.

append wa_fcode to i_fcode_extab.

wa_fcode = '&OAD'.

append wa_fcode to i_fcode_extab.

wa_fcode = '&AVE'.

append wa_fcode to i_fcode_extab.

wa_fcode = '&EB9'.

append wa_fcode to i_fcode_extab.

wa_fcode = '&SUM'.

append wa_fcode to i_fcode_extab.

wa_fcode = '&UMC'.

append wa_fcode to i_fcode_extab.

wa_fcode = '&XPA'.

append wa_fcode to i_fcode_extab.

wa_fcode = '&OMP'.

append wa_fcode to i_fcode_extab.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

IS_LAYOUT = LAYOUT

IT_FIELDCAT = IT_FIELDCAT

IT_SORT = IT_SORT

I_CALLBACK_PF_STATUS_SET = 'STATUS'

IT_EXCLUDING = I_FCODE_EXTAB

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IT_EVENTS = IT_EVENTS[]

TABLES

T_OUTTAB = IT_VBAK.

Edited by: Srinivas Manchikalapati on Nov 27, 2008 7:09 AM

Edited by: Srinivas Manchikalapati on Nov 27, 2008 7:15 AM

Edited by: Srinivas Manchikalapati on Nov 27, 2008 7:18 AM

Former Member
0 Kudos
81

ii

go to tcode se41

then go to copy pf status giving bcalv_test_list_dispaly and give the status name as standard

and then give the sttaus name that you have declared in prog and copy.

thanx.