昨天群里有人问,就自己试了一下,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(30) 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 = 1 NO_VALUES_FOUND = 2. READ TABLE R_TAB INDEX 1. 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 = '1222222'."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 = 1 INVALID_DYNPROFIELD = 2 INVALID_DYNPRONAME = 3 INVALID_DYNPRONUMMER = 4 INVALID_REQUEST = 5 NO_FIELDDESCRIPTION = 6 UNDEFIND_ERROR = 7. ENDMODULE.
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/18614.html