12-10-2021 12:03 PM
Hi
SAP_BASIS 750 0017
ALV CL_GUI_ALV_GRID. Editable.
There is a colum that is a button (FIELDCAT-HOTSPOT & FIELDCAT-STYLE).
Clicking the buton triggers event BUTTON_CLICK.
Method ON_BUTTON_CLICK (registered as event handler vor event BUTTON_CLICK) handels event.
This works fine except when before clicking the button a new row is inserted with the standart button insert row. Then the event is not triggered (at least the handler is not called). Other events (F4, DATA_CHANGED) are still triggered.
Any ideas? Thanks!
Regards
Alexander
12-27-2021 10:24 AM
SOLUTION.
I hijacked* the standart button insert row and programmed it myself. Now the event BUTTON_CLICK works after inserting a row.
I still don't know what the problem is. Somehow the standart button insert row disturbes the event framework?
* Handle event ON_TOOLBAR. Set new function code for button insert row. Handle event BEFORE_USER_COMMAND. Add new row. May use methods GET_CURRENT_CELL, SET_CURRENT_CELL_VIA_ID and REFRESH.
12-10-2021 12:49 PM
12-11-2021 1:10 PM
Please post a minimal reproducible example if you need further assistance. Thank you.
12-27-2021 10:13 AM
12-27-2021 10:24 AM
SOLUTION.
I hijacked* the standart button insert row and programmed it myself. Now the event BUTTON_CLICK works after inserting a row.
I still don't know what the problem is. Somehow the standart button insert row disturbes the event framework?
* Handle event ON_TOOLBAR. Set new function code for button insert row. Handle event BEFORE_USER_COMMAND. Add new row. May use methods GET_CURRENT_CELL, SET_CURRENT_CELL_VIA_ID and REFRESH.
12-27-2021 2:29 PM
For information, it took me 15 minutes to create a minimal program to reproduce, and it worked for me (so couldn't reproduce the problem). From there, I would compare the 2 programs to understand why one works and the other not, by adapting the minimal one to include the complex stuff of the second one, step by step, till it doesn't work anymore...