![SAP对像变化点增强--物料,客户修改时触发增强点 - 第1张 | 优通SAP SAP对像变化点增强--物料,客户修改时触发增强点 - 第1张 | 优通SAP](http://www.ut163.com/wp-content/uploads/2019/08/20190829101444-11.png)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
method IF_EX_BDCP_BEFORE_WRITE~FILTER_BDCPV_BEFORE_WRITE. * BREAK IBM_YANGJF. *特定用户 列表不写入变化点. BREAK yangsen . DATA: WA_ZIMM048 TYPE ZIMM048. SELECT SINGLE * FROM ZIMM048 INTO WA_ZIMM048 WHERE UNAME = SY-UNAME. IF SY-SUBRC = 0 AND SY-DATUM >= WA_ZIMM048-DATAB AND SY-DATUM <= WA_ZIMM048-DATBI. DELETE CHANGE_POINTERS WHERE TABNAME ''. ENDIF. DATA: BEGIN OF WRSZ_KEY , MANDT TYPE WRSZ-MANDT, ASORT TYPE WRSZ-ASORT, LFDNR TYPE WRSZ-LFDNR, END OF WRSZ_KEY. DATA: L_LOCNR TYPE WRSZ-LOCNR. FIELD-SYMBOLS: TYPE BDCPV. FIELD-SYMBOLS: TYPE BDI_CDPOS. DATA: WA_POS TYPE BDI_CDPOS. LOOP AT CHANGE_POINTERS ASSIGNING WHERE TABNAME = 'WRSZ'. WRSZ_KEY = -TABKEY. *删除的,添加地点信息到KEY值中. IF -CDCHGID = 'D'. SELECT SINGLE LOCNR FROM WRSZ INTO L_LOCNR WHERE ASORT = WRSZ_KEY-ASORT AND LFDNR = WRSZ_KEY-LFDNR. IF SY-SUBRC = 0. CONCATENATE -TABKEY L_LOCNR INTO -TABKEY. ENDIF. ENDIF. *特定情况,地点分类中删除地点,会导致地点结束日期变化.这种情况,视同删除,设置删除标记 IF -FLDNAME = 'DATBI'. READ TABLE CHANGE_DOCUMENT_POSITIONS INTO WA_POS WITH KEY TABNAME = -TABNAME TABKEY = -TABKEY FNAME = -FLDNAME. IF SY-SUBRC = 0 AND WA_POS-VALUE_NEW '99991231'. -CDCHGID = 'D'. ENDIF. ENDIF. ENDLOOP. *记录地点税分类从2->1的变化信息 data: wa_zifi042a TYPE zifi042A. LOOP AT CHANGE_DOCUMENT_POSITIONS ASSIGNING WHERE TABNAME = 'KNVI' AND FNAME = 'TAXKD'. IF -VALUE_NEW = '1' AND -VALUE_OLD = '2'. wa_ZIFI042A-KUNNR = -OBJECTID. WA_ZIFI042A-OLD_TAXKD = -VALUE_OLD. WA_ZIFI042A-NEW_TAXKD = -VALUE_NEW. WA_ZIFI042A-DATUM = SY-DATUM. WA_ZIFI042A-UZEIT = SY-UZEIT. MODIFY ZIFI042A FROM WA_ZIFI042A. ENDIF. ENDLOOP. *WM:调用函数记录WM相关主数据的变化点表 CALL FUNCTION 'ZHX_WM_MD_WRITE_CHANGE' EXPORTING CDPOS = CHANGE_DOCUMENT_POSITIONS[] CDHDR = CHANGE_DOCUMENT_HEADER. endmethod. |