问题:在ALV界面中输入可编辑字段的值,点击保存按钮,这个值并没有传入程序内表。
解决方法:在点击按钮的操作之后加入获取屏幕值的方法。
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = LR_GRID.
CALL METHOD LR_GRID->CHECK_CHANGED_DATA.
一个具体使用场景:
FORM FRM_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
READ TABLE GT_ALV INTO WA_ALV INDEX RS_SELFIELD-TABINDEX.
CHECK SY-SUBRC = 0.
DATA: LR_GRID TYPE REF TO CL_GUI_ALV_GRID,
MYINDEX TYPE SY-TABIX.
CASE R_UCOMM.
WHEN '&SAVE'.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = LR_GRID.
CALL METHOD LR_GRID->CHECK_CHANGED_DATA.
RS_SELFIELD-REFRESH = 'X'.
PERFORM FRM_SAVEDATA.
ENDCASE.
RS_SELFIELD-REFRESH = 'X'.
ENDFORM.
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/19534.html