ABAP 刷新屏幕
1、用方法CL_GUI_CFW
cl_gui_cfw=>set_new_ok_code( 'p_ucomm' ). "p_ucomm = 'REFRESH'
2、用函数SAPGUI_SET_FUNCTIONCODE
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'EXPORTINGfunctioncode = '='EXCEPTIONSfunction_not_supported = 1OTHERS = 2.
两者皆可做到在PBO中刷新屏幕字段数据,用于单(双)击ALV数据后更新屏幕字段数据。
如果在PAI刷新屏幕也可用DYNP_VALUES_READ, DYNP_VALUES_UPDATE来刷新屏幕字段
* DATA: lt_dynpupdate TYPE TABLE OF dynpread,
* ls_dynpupdate LIKE LINE OF lt_dynpupdate." 设置需要更新的字段及其值
* ls_dynpupdate-fieldname = 'ZXXXX'. " 字段名
* ls_dynpupdate-fieldvalue = zxxxx. " 新值
* APPEND ls_dynpupdate TO lt_dynpupdate." 调用函数模块更新屏幕
* CALL FUNCTION 'DYNP_VALUES_UPDATE'
* EXPORTING
* dyname = sy-cprog " 当前程序名
* dynumb = sy-dynnr " 当前屏幕号
* TABLES
* dynpfields = lt_dynpupdate
* EXCEPTIONS
* OTHERS = 1.