|
有时候可能会有不经过PBO而更新DYNPRO画面的内容的要求。
比如:DYNPRO有个合计金额项目,ALV里面有个金额列,要求改变ALV的金额后,同时改变DYNPRO的合计金额,
可以用下面的方法来更新,将要更新的项目的名称和内容放进DYNFIELDS内表就可以了。
下面的方法加在REFRESH之前。
DATA:
DYNFIELD TYPE DYNPREAD,
DYNFIELDS TYPE TABLE OF DYNPREAD.
CLEAR:
DYNFIELD.
REFRESH:
DYNFIELDS.
DYNFIELD-FIELDNAME = '金额'.
DYNFIELD-FIELDVALUE = '100.00'.
APPEND DYNFIELD TO DYNFIELDS.
CALL FUNCTION 'DYNP_UPDATE_FIELDS'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
REQUEST = 'A'
* START_SEARCH_IN_CURRENT_SCREEN = ' '
* START_SEARCH_IN_MAIN_SCREEN = ' '
* START_SEARCH_IN_STACKED_SCREEN = ' '
* START_SEARCH_ON_SCR_STACKPOS = ' '
* SEARCH_OWN_SUBSCREENS_FIRST = ' '
* SEARCHPATH_OF_SUBSCREEN_AREAS = ' '
TABLES
DYNPFIELDS = DYNFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
UNDEFIND_ERROR = 7
OTHERS = 8. |
|