Hi MSR,
The action of standard buttons viz APPEND, DELETE, INSERT of WD alv cannot be captured in event ON_STANDARD_FUNCTION OR ON_FUNCTION.
Your requirement can be achieved as below
•Hide the standard functions from tool bar by using methods of interface
if_salv_wd_std_functions
◦Hide Append button -
lo_alv_model->if_salv_wd_std_functions~set_edit_append_row_allowed(abap_false )
◦Hide delete button
co_alv_model->if_salv_wd_std_functions~set_edit_delete_row_allowed(abap_false )
◦Hide insert button
co_alv_model->if_salv_wd_std_functions~set_edit_insert_row_allowed(abap_false )
•Add custom function / button to toolbar by using method of interface
if_salv_wd_function_settings
Example: Create new "INSERT_ROW'
DATA: lo_append_button TYPE REF TO cl_salv_wd_fe_button,
lo_append_func TYPE REF TO cl_salv_wd_function,
* Customize the INSERT button with the Icon display
CREATE OBJECT lo_append_button.
* Set button image
lo_append_button->set_image_source(
'ICON_INSERT_ROW' ).* Set button function
lo_append_func =
Lo_alv_model->if_salv_wd_function_settings~create_function(
id = 'APPEND_ROW' ).
lo_append_func->set_editor( lo_append_button ).
"---------------------------------------------
•Go to view methods tab and create one event handler method "on_alv_action" and bind it to an event ON_FUNCTION of alv as show in below
Pleaser refer the below link for adding custom button in alv tool bar
Creating custom button in WD alv toolbar
Hope this helps you.
Regards,
Rama
Message was edited by: Ramakrishnappa Gangappa