‎2009 Nov 20 10:56 AM
I'm calling the following method from my ALV grid to handle editable fields
HANDLE_ITEM_CHANGED
FOR EVENT DATA_CHANGED_FINISHED
OF CL_GUI_ALV_GRID
IMPORTING E_MODIFIED
ET_GOOD_CELLS,
I only want to check these changes when a new SAVE button is pushed on the tool bar. How do I check the FCODE for when this button is pressed so the method is only invoked at this button push?
Thanks Mart
‎2009 Nov 20 11:23 AM
Halo Mart,
Please set a flag when the user presses SAVE Button .
Inside the event handler method of data change u add one more method like perform_checks passing e_data_changed to it.
if my_save_flag eq abap_true .
perform_checks( er_data_changed ).
endif.
Inside this perform_checks method you can do all the validations.
One more idea is you can check for sy-ucomm eq 'SAVE'.
Regards
Arshad
‎2009 Nov 20 11:23 AM
Halo Mart,
Please set a flag when the user presses SAVE Button .
Inside the event handler method of data change u add one more method like perform_checks passing e_data_changed to it.
if my_save_flag eq abap_true .
perform_checks( er_data_changed ).
endif.
Inside this perform_checks method you can do all the validations.
One more idea is you can check for sy-ucomm eq 'SAVE'.
Regards
Arshad
‎2009 Nov 20 1:01 PM
Hi Mart,
On the push of save button call the following method of the class cl_gui_alv_grid.
CALL METHOD g_grid->check_changed_data
IMPORTING
e_valid = w_valid
CHANGING
c_refresh = c_x
.
Other than that you can suppress the log message from coming by calling following method inside the handler of event DATA_CHANGED.
CALL METHOD us_data_changed->refresh_protocol .
I have tried this and this had worked for me.
Regards
Avinash