昨天群里有人问,就自己试了一下,POV执行在走PAI之前,所以空表行的时候TABLE里是没有数据的,所以一开始想用MIDOFY的想法看来不完善,可以再空表时做个APPEND。
后来又换了个想法,直接更新屏幕值。
测试的程序,比较乱
MODULE POV_MATNR INPUT.
DATA:T_TAB TYPE TABLE OF MAKT.
DATA:R_TAB TYPE TABLE OF DDSHRETVAL WITH HEADER LINE.
DATA:P_TAB TYPE TABLE OF DYNPREAD.
DATA:S_TAB TYPE DYNPREAD.
DATA:LINE TYPE I.
DATA:LV_FIELD() TYPE C. GET CURSOR FIELD LV_FIELD LINE LINE. CALL FUNCTION 'DYNP_GET_STEPL'
IMPORTING
POVSTEPL = LINE. SELECT * INTO CORRESPONDING FIELDS OF TABLE T_TAB FROM MAKT. CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'MATNR'
* PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'GW_ZMMS014-MATNR'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* CALLBACK_METHOD =
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = T_TAB[]
* FIELD_TAB =
RETURN_TAB = R_TAB[]
* DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR =
NO_VALUES_FOUND = .
READ TABLE R_TAB INDEX .
S_TAB-FIELDNAME = 'GW_ZMMS014-MATNR'.
S_TAB-STEPL = LINE.
S_TAB-FIELDVALUE = R_TAB-FIELDVAL."ls_return_tab-fieldval.
APPEND S_TAB TO P_TAB..
S_TAB-FIELDNAME = 'GW_ZMMS014-MAKTX'.
S_TAB-STEPL = LINE.
S_TAB-FIELDVALUE = ''."ls_return_tab-fieldval.
APPEND S_TAB TO P_TAB.. CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = SY-REPID
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = P_TAB
EXCEPTIONS
INVALID_ABAPWORKAREA =
INVALID_DYNPROFIELD =
INVALID_DYNPRONAME =
INVALID_DYNPRONUMMER =
INVALID_REQUEST =
NO_FIELDDESCRIPTION =
UNDEFIND_ERROR = .
ENDMODULE.