We know how to use some familiar events of ALV in Web Dynpro for ABAP like ON_DATA_CHECK,ON_CLICK,ON_LEAD_SELECT. Here I am going to show how to use the ON_CELL_ACTION event .
When we change the data in any cell of ALV table and press enter, ON_CELL_ACTION event will trigger and will give changed value in cell.
1.Create a method in the view name it like ON_CELL_ACTION,method type is Event handler that select from drop down and select event is ON_CELL_ACTION from Interface Controller Events.
2.Now to trigger this event write the below code in WDDOMODIFYVIEW method of view.
* Data Declaration
data lo_cmp_usage type ref to if_wd_component_usage.
data lo_interfacecontroller type ref to iwci_salv_wd_table .
data lo_value type ref to cl_salv_wd_config_table.
* Instantiate ALV
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
* Call get_model of Interface Controller to get reference of ALV
lo_value = lo_interfacecontroller->get_model(
).
* Enable the ON_CELL_ACTION Event
call method lo_value->if_salv_wd_table_settings~set_cell_action_event_enabled
exporting
value = ABAP_TRUE .