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: 

event while trying to edit field on alv

Former Member
0 Kudos

HI All ,

I create editable alv screen and i want that when the user will edit the row and press enter

raise event but i dont find any event that handle Enter button

any idea ?

Regards

James

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello James

The method you are looking for is REGISTER_EDIT_EVENT. For a sample report check BCALV_EDIT_03:


...
* Per default the edit mode of grid control is 'activated'
* for editable cells.

*§3.Optionally register ENTER to raise event DATA_CHANGED.
*   (Per default the user may check data by using the check icon).
 call method g_grid->register_edit_event
               exporting
                  i_event_id = cl_gui_alv_grid=>mc_evt_enter.

  CREATE OBJECT g_event_receiver.
  SET HANDLER g_event_receiver->handle_data_changed FOR g_grid.

ENDFORM.                               "CREATE_AND_INIT_ALV
...

Regards

Uwe

4 REPLIES 4

kesavadas_thekkillath
Active Contributor
0 Kudos

in se38 check the program bcalvedit04 , provide the invalid value and hit enter.

uwe_schieferstein
Active Contributor
0 Kudos

Hello James

The method you are looking for is REGISTER_EDIT_EVENT. For a sample report check BCALV_EDIT_03:


...
* Per default the edit mode of grid control is 'activated'
* for editable cells.

*§3.Optionally register ENTER to raise event DATA_CHANGED.
*   (Per default the user may check data by using the check icon).
 call method g_grid->register_edit_event
               exporting
                  i_event_id = cl_gui_alv_grid=>mc_evt_enter.

  CREATE OBJECT g_event_receiver.
  SET HANDLER g_event_receiver->handle_data_changed FOR g_grid.

ENDFORM.                               "CREATE_AND_INIT_ALV
...

Regards

Uwe

0 Kudos

Hello UWI

THANKS its work!!!

one last question i have a alv with 3 frame and when i use the event enter

for the edit frame its work great and i add also

mo_alv_at->register_edit_event( i_event_id = cl_gui_alv_grid=>mc_evt_modified ).

so if user edit new row and press on tab so the event data changed is triggered .

the problem is when the user edit new row and without press enter or other

button he press on different frame or when he press back on the header of the screen ,

the last update data not saved since changed data is not trigger .

there is event that when the user press on different frame or different place on screen

trigger the event of change data (since the data is actually changed )

Thanks for answer

and time and best regards

James

Edited by: James Herb on Jul 20, 2010 12:11 PM

0 Kudos

HI ,

I solved it with registration of event check_changed_data( IMPORTING e_valid = lv_valid ).

and the event change data is triggers when I do some changes is different frames

Regards

James