2022 Dec 19 9:59 AM
Hello Experts,
I call REUSE_ALV_GRID_DISPLAY in order to save data from ALV.
When all is done in one program it works perfectly, but when the program calls REUSE_ALV_GRID_DISPLAY via a method (the program calls a method. the method calls REUSE…) the save is not working. I can change the data in the ALV, but when I press save the data is not saved. In the debugger I can see that (in user_command subroutine) the internal table is not updated by the ALV (This is the problem).
In user_command subroutine I use
1. 1. rs_selfield-refresh = 'X'.
2. 2. IF lo_alv IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = lo_alv.
ENDIF.
IF NOT lo_alv IS INITIAL.
CALL METHOD lo_alv->CHECK_CHANGED_DATA
.
ENDIF.
Thank you in advanced
Hagit
2023 Mar 23 6:20 AM
Save the updated data works also when REUSE_ALV_GRID_DISPLAY is called from a method.
The problem was that the internal table, which contains the ALV's data was sent to the method as exporting parameter instead of changing parameter
2022 Dec 19 10:16 AM
Hello Hagit,
REUSE ALV grid FM is recommended to use outside of methods.
Many Thanks / Himanshu Gupta
2022 Dec 19 10:28 AM
hemug21 thank you for your comment.
Why is it not recomanded?
Is it better to repeat the code in every program instead of using methods?
2023 Mar 23 6:20 AM
Save the updated data works also when REUSE_ALV_GRID_DISPLAY is called from a method.
The problem was that the internal table, which contains the ALV's data was sent to the method as exporting parameter instead of changing parameter