Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Save the updated data is not working when REUSE_ALV_GRID_DISPLAY is called from a method

hagit
Active Participant
0 Kudos
338

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

1 ACCEPTED SOLUTION

hagit
Active Participant
297

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

3 REPLIES 3

himanshu_gupta13
Product and Topic Expert
Product and Topic Expert
0 Kudos
297

Hello Hagit,

REUSE ALV grid FM is recommended to use outside of methods.

Many Thanks / Himanshu Gupta

hagit
Active Participant
0 Kudos
297

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?

hagit
Active Participant
298

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