2008 Feb 26 6:47 PM
Hi all,
I have an editable ALV, using FM "REUSE_ALV_GRID_DISPLAY". I like to check when user changes the data from a cell or when press Enter key. How can I do it?
REMEMBER: It's isn't a OO ALV, I'm showing it througth FM.
Regards,
Roberto Campo
2008 Feb 26 6:57 PM
i_yatthdr_old[] = i_yatthdr[]. " keep the old value
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = i_fieldcat[]
is_layout = pt_grplayout2
i_callback_program = 'YATTU0007'
i_callback_html_top_of_page = p_header
i_callback_user_command = 'F_USER_COMMAND1'
it_events = i_events[]
tables
t_outtab = i_yatthdr.
else.
message i012(yscc).
endif.
endform. " F_alv_edit_oruser
*
*&---------------------------------------------------------------------*
* Form f_user_command1 *
*&---------------------------------------------------------------------*
* This form will handle the user command from fm REUSE *
*----------------------------------------------------------------------*
form f_user_command1 using p_ucomm type sy-ucomm
rs_selfield type slis_selfield.
data p_ref1 type ref to cl_gui_alv_grid.
call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
importing
e_grid = p_ref1.
call method p_ref1->check_changed_data.
if i_yatthdr_old[] ne i_yatthdr[].
" Then do something
endif.
a®
2008 Feb 26 6:57 PM
i_yatthdr_old[] = i_yatthdr[]. " keep the old value
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = i_fieldcat[]
is_layout = pt_grplayout2
i_callback_program = 'YATTU0007'
i_callback_html_top_of_page = p_header
i_callback_user_command = 'F_USER_COMMAND1'
it_events = i_events[]
tables
t_outtab = i_yatthdr.
else.
message i012(yscc).
endif.
endform. " F_alv_edit_oruser
*
*&---------------------------------------------------------------------*
* Form f_user_command1 *
*&---------------------------------------------------------------------*
* This form will handle the user command from fm REUSE *
*----------------------------------------------------------------------*
form f_user_command1 using p_ucomm type sy-ucomm
rs_selfield type slis_selfield.
data p_ref1 type ref to cl_gui_alv_grid.
call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
importing
e_grid = p_ref1.
call method p_ref1->check_changed_data.
if i_yatthdr_old[] ne i_yatthdr[].
" Then do something
endif.
a®
2008 Feb 26 7:16 PM
Sorry, but this solution isn't correct.
The program don't execute form F_USER_COMMAND1 when user change alv data or press enter key.
More suggestions please?
Regards,
Roberto Campo
2008 Feb 27 10:23 AM
2008 Feb 27 10:52 AM
Have you seen if there is some events (parameters IT_EVENT_EXIT) that triggere the key pressed or cell changed??
2008 Feb 27 10:57 AM
Yes, I've allready checked this.
Event "DATA_CHANGED" only is triggered when user press cell matchcode. When data is changed the event isn't triggered.
We've changed plans. We will change this ALV for OO ALV one. So I'll don't need more help.
Thanks all!
Regards,
Roberto Campo
Edited by: Roberto Campo on Feb 27, 2008 11:58 AM