09-04-2013 5:55 AM
Hi,
At the ALV event handler DATA_CHANGED, I want to capture the user command on the screen other than the alv toolbar. But E_UCOMM holds nothing when I press a button on the screen. How can I capture screen function code?
Best regards,
ts
09-04-2013 8:30 AM
Hi,
Have you declared function code in the PF-status of the screen.
09-04-2013 8:54 AM
Hi,
Below are the steps to achieve this functionality. you have to handle the event to catch the ucomm
1. Register the event:
*--for tab
CALL METHOD go_alv->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
*-- for enter
CALL METHOD go_alv->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
2. Get the changed row,with this below code your changed data row will be selected :
CALL METHOD go_alv->check_changed_data.
3. Handle the event:
SET HANDLER go_respond_events->handle_data_changed_finish FOR go_alv.
4. You have to create the class for this before. In this class you have to update that value:
CLASS respond_events DEFINITION FINAL .
PUBLIC SECTION .
METHODS: handle_data_changed_finish FOR EVENT data_changed_finished
OF cl_gui_alv_grid.
ENDCLASS . "respond_events definition
CLASS respond_events IMPLEMENTATION .
METHOD handle_data_changed_finish.
LOOP AT <your intarnal tablewhich used for display> INTO <ls_>.
**jwrite your code here
ENDLOOP.
ENDMETHOD. "handle_data_changed
ENDCLASS . "respond_events implementation
Regards,
Supratik
09-04-2013 9:21 AM