出现值实际已经变化但DIALOG屏幕并没有动态变化时,可尝试使用函数:DYNP_VALUES_UPDATE手动刷新屏幕
DATA: lt_dynpupdate TYPE TABLE OF dynpread,
ls_dynpupdate LIKE LINE OF lt_dynpupdate.
ls_dynpupdate-fieldname = 'GS_TEST-MATNR'.
ls_dynpupdate-fieldvalue = lv_test4.
APPEND ls_dynpupdate TO lt_dynpupdate.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = lt_dynpupdate
EXCEPTIONS
invalid_abapworkarea = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.