07-02-2008 3:01 PM
hi, experts
my requirement is that:
i create an alv ,set it response to the enter even, if the content has changed, a class will be response it .
the code like below:
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.
but if the alv content has no changed, nothing will be happen, i want to do something such as popup a message even if the content has not changed and user press enter.
pls help me ,thanks
07-02-2008 3:04 PM
Please check this method
call method g_grid->check_changed_data
importing
e_valid = v_valid.
a®
07-02-2008 3:04 PM
Please check this method
call method g_grid->check_changed_data
importing
e_valid = v_valid.
a®
07-02-2008 3:21 PM
hi, i know this method ,but if the alv content has not been changed, call this method will not trigger my class to run.
07-02-2008 3:32 PM
I don't think this is possible.
may be you can do is
during the enter key is pressed
call method cl_gui_cfw=>set_new_ok_code
exporting
new_code = 'DUMMY'.
and in the user command
if ok_code eq 'DUMMY'
call method g_grid->check_changed_data
importing
e_valid = v_valid.
if v_valid ne c_x.
call function 'POPUP_TO_CONFIRM'
exporting
titlebar = text-025
text_question = text-026
text_button_1 = text-027
text_button_2 = text-028
display_cancel_button = ' '
importing
answer = v_answer.
endif.
a®s
Edited by: a®s on Jul 2, 2008 10:37 AM
07-02-2008 3:11 PM
Hello,
Please see these:
[https://wiki.sdn.sap.com/wiki/x/eXg]
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907].
Regards.