10-17-2008 3:03 PM
Hi all,
I am trying to deactivate 'APPROVE' button in the ALV output of the program RCATS_APPROVE_ACTIVITIES.
Any ideas???
Thanx in advance!!!!
10-18-2008 6:29 PM
Hello Grigoria
The following steps are necessary to implement your requirement:
(1) Create BAdI implementation for BAdI CATS_REPORTING (i.e. class implementing interface IF_EX_CATS_REPORTING => e.g. ZCL_IM_CATS_REPORTING).
(2) Add a public method HANDLE_TOOLBAR (to your BAdI implementing class) as event handler for event TOOLBAR of CL_GUI_ALV_GRID
(3) Set method HANDLE_TOOLBAR as event handler for the CATS displaying grid instance:
METHOD if_ex_cats_reporting~before_display_appr.
SET HANDLER: handle_toolbar FOR im_alv_grid.
ENDMETHOD.
(4) Inactive the APPROVE toolbar button within the event handler method:
METHOD handle_toolbar.
* define local data
DATA: ls_button TYPE stb_button.
LOOP AT e_object->mt_toolbar INTO ls_button.
CASE ls_button-function.
WHEN cl_grid_approval_actexp=>co_ok_approve.
ls_button-disabled = 'X'.
WHEN OTHERS.
CONTINUE.
ENDCASE.
MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
ENDLOOP.
ENDMETHOD.
Regards
Uwe
10-18-2008 6:29 PM
Hello Grigoria
The following steps are necessary to implement your requirement:
(1) Create BAdI implementation for BAdI CATS_REPORTING (i.e. class implementing interface IF_EX_CATS_REPORTING => e.g. ZCL_IM_CATS_REPORTING).
(2) Add a public method HANDLE_TOOLBAR (to your BAdI implementing class) as event handler for event TOOLBAR of CL_GUI_ALV_GRID
(3) Set method HANDLE_TOOLBAR as event handler for the CATS displaying grid instance:
METHOD if_ex_cats_reporting~before_display_appr.
SET HANDLER: handle_toolbar FOR im_alv_grid.
ENDMETHOD.
(4) Inactive the APPROVE toolbar button within the event handler method:
METHOD handle_toolbar.
* define local data
DATA: ls_button TYPE stb_button.
LOOP AT e_object->mt_toolbar INTO ls_button.
CASE ls_button-function.
WHEN cl_grid_approval_actexp=>co_ok_approve.
ls_button-disabled = 'X'.
WHEN OTHERS.
CONTINUE.
ENDCASE.
MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
ENDLOOP.
ENDMETHOD.
Regards
Uwe
10-19-2008 12:57 AM
10-20-2008 11:53 AM
Note that prior to step 4 you must declare 'e_object' as a parameter for method 'HANDLE_TOOLBAR'.