11-05-2009 3:49 PM
Hi ,
I have to capture change on ALV cells , I am using HANDLE_DATA_CHANGED_FINISHED but this event gets triggered only after hitting ENTER or other user commands.
I wan to avoid Hitting ENTER and other user commands to trigger HANDLE_DATA_CHANGED_FINISHED/HANDLE_DATA_CHANGED . Any Ideas how to achieve this ?
-Raj
11-12-2009 9:17 PM
Hello
Why cant you use handle_data_changed for data_change event instead of data_changed_finished event
This will get trigerred when you enter my_grid->check_changed_data( ) method.
Or else you can register the enter evt explictly so that this event handler method gets triggered automatically like
my_grid->register_edit_event(
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter )..
11-12-2009 9:17 PM
Hello
Why cant you use handle_data_changed for data_change event instead of data_changed_finished event
This will get trigerred when you enter my_grid->check_changed_data( ) method.
Or else you can register the enter evt explictly so that this event handler method gets triggered automatically like
my_grid->register_edit_event(
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter )..
11-16-2009 8:44 AM
Arshad Ansary is semi right, you need to register edit events with attribute mc_evt_modifies which will trigger handler once you move the cursor to other cell/field
CALL METHOD g_alv_grid_ref->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modifies. "trigger event after change is made and cursor is moved to other field
Regards
Marcin
11-16-2009 11:01 PM
Hi Arshad & Marcin ,
Thanks for your replies.
i have already registered edit event with attribute
i_event_id = cl_gui_alv_grid=>mc_evt_modifies. tried i_event_id = cl_gui_alv_grid=>cl_gui_alv_grid=>mc_evt_enter too .
As Marcin said the event is getting triggered when the user changes and focus the cursor on next field , but I have many editable drop down fields on the ALV
After entering a value in one of the editable ALV then instead of focusing on the other field , if I try to select/click on the menu icon on the drop down (editable field ) then it triggers the HANDLE_DATA_CHANGED_FINISHED event and the drop down
flashes and disapears i have to reselect dorp down to select the value which is annoying .
Everything works fine when I enter a value in one of the editable field then hit " enter key " . So I am trying to programaticaly trigger enter soon after user changes/enteres some value in the editable cell . Is this possible ?
-Raj
11-17-2009 7:43 AM
So I am trying to programaticaly trigger enter soon after user changes/enteres some value in the editable cell . Is this possible ?
I am afraid simulating ENTER is not possible, you will have to stick to one of given approaches.
Anyhow it is strange why these flashes come. Didn't you set some breakpoint in handler? You may also try with other change event like DATA_CHANGED , maybe this will help.
Regards
Marcin
11-17-2009 4:02 PM
Marcin ,
For now .. I am sticking with the focus option . I tried using HANDLE_DATA_CHANGED but it did not work as per my requirement .
Thanks a lot for your help .
-Raj