REUSE_ALV_GRID_DISPLAY Refresh ALV_SAP刘梦_新浪博客
原创
©著作权归作者所有:来自51CTO博客作者sapLiuMeng的原创作品,请联系作者获取转载授权,否则将追究法律责任
太久不写报表了,今天用到一个简单alv显示刷新,懒得写OO的,就直接最简单的用了FM:
之前都是用OO ALV 刷新,突然忘了怎么FM 的刷新,
然后搜了下,呵呵,做个简单记录吧。
主要代码
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_structure_name = 'SPFLI'
i_callback_program = sy -repid
i_callback_pf_status_set = 'FORM_SET_PF_STATUS'
i_callback_user_command = 'FRM_COMMAND'
TABLES
t_outtab = gt_SPFLI
EXCEPTIONS
program_error = 1
OTHERS = 2 .
IF sy -subrc <> 0 .
* Implement suitable error handling here
ENDIF .
FORM form_set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STATUS_POST' .
ENDFORM.
FORM frm_command USING p_ucomm LIKE sy-ucomm
ps_selfield TYPE slis_selfield.
DATA: l_grid TYPE REF TO cl_gui_alv_grid.
CASE p_ucomm.
WHEN 'POST'.
"post to
PERFORM frm_post .....
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = l_grid.
CALL METHOD l_grid->check_changed_data.
CALL METHOD l_grid->refresh_table_display.
ps_selfield-refresh = 'X'.
ps_selfield-col_stable = 'X'.
ps_selfield-row_stable = 'X'.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'LEAVE'.
LEAVE PROGRAM.
ENDCASE .
ENDFORM.
欢迎关注订阅号:SAP学习记录 (SAPlearning )