The user command is stored in CL_GUI_ALV_GRID->M_UCOMM
So basically it is enough to clear m_ucomm
It can be called like this
my_Grid->SET_USER_COMMAND
exporting i_ucomm = space.
It happens that you have an error condition triggered in your on_data_changed event handler.
If the error is red (blocking) no further processing can happen until the error is resolved.
Not even an undo button press is allowed.
So one can try to solve this situation by checking for a certain ucomm in the on data changed method.
But this does not work because once the ucomm is set, it stays set until another ucomm is selected, even throughout data changes in the ALV that have nothing to do with that ucomm.
To be honest the internal undo ucomm works even if there is an error, but you have to press it twice. Somewhat weird isn't it!?
Slowly i am realizing that the complexity of a non trivial data editing program with non trivial checks on the data ( like time constraints on time dependent data) based on ALV can be quite high, and that the ALV control itself does not help mastering this complexity: it adds more and more complexity with its weird control-flow structure.