Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV HANDLE_DATA_CHANGED_FINISHED

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member

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 )..

5 REPLIES 5

Former Member

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 )..

MarcinPciak
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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