SAP BADI 使用增强清单

1、

使用BADI的增强清单 .......................................................................................... 2 1.1.

ZMB_MIGO_BADI ......................................................................................... 2 1.1.1. Method: PUBLISH_MATERIAL_ITEM................................................... 2 1.2. ZMB_RESERVATION_BADI ........................................................................... 6

1.2.1. 1.3.

Method: DATA_CHECK ........................................................................ 6

ZME_HOLD_PO ............................................................................................. 9

1.3.1. Method: IS_ALLOWED......................................................................... 9 1.4. ZME_PROCESS_PO_CUST ........................................................................... 10

1.4.1. 1.5.

Method: PROCESS_ITEM ................................................................... 10

ZME_PROCESS_REQ_CUST ........................................................................ 14 1.5.1. Method: OPEN.................................................................................... 14 1.5.2. Method: PROCESS_ITEM ....................................... 错误!未定义书签。 1.5.3. Method: PROCESS_ACCOUNT ............................... 错误!未定义书签。 ZME_REQ_POSTED ..................................................................................... 27 1.6.1. Method: POSTED................................................................................ 27 ZMRM_HEADER_CHECK ............................................................................ 29 1.7.1. Method: HEADERDATA_CHECK ........................................................ 29 使用USER_EXIT的增强清单........................................................................... 33 Project:ZMM1 外部采购文件审批的增强处理项目 ......................................... 33

1.6. 1.7. 2、

2.1.

2.1.1. User Exit: M06E0004........................................................................... 33 2.2. Project:ZMM2 采购申请审批的增强处理项目 ................................................ 41 2.1.2. User Exit: M06B0002 .......................................................................... 41 2.3. Project:ZMM3 ............................................................................................... 41

2.1.3. User Exit: LMEKO001 ......................................................................... 43 2.1.4. User Exit: LMEKO002 ......................................................................... 44 2.4. Project: ZMM5 采购文件建立的增强 ............................................................. 44

2.1.5. 2.5.

User Exit: MM06E005在采购凭证中的客户字段 .................................. 44

Project: ZMM6 .............................................................................................. 51 2.1.6. User Exit: MBCF0002物料凭证项目中的段文本 .................................. 51

1、 使用BADI的增强清单

1.1. ZMB_MIGO_BADI

1.1.1. Method: PUBLISH_MATERIAL_ITEM

method IF_EX_MB_MIGO_BADI~PUBLISH_MATERIAL_ITEM .

data abc(40) value '(SAPLMIGO)GODYNPRO-DETAIL_TAKE'. data: text type string, ZGOITEM TYPE GOITEM. DATA zME TYPE C. data: ctr(70).

data: p_line type table of TLINE initial size 0.

DATA P_INLINES type table of TLINE initial size 0 . field-symbols: type any. assign (abc) to .

MOVE LS_GOITEM TO ZGOITEM.

*---------------------------------------------------------------* *检查物料的ABC状态

*----------------------------------------------------------------* IF ZGOITEM-EKORG = '2000' and ZGOITEM-MATNR is not initial and ( ZGOITEM-BWART = '103' or ZGOITEM-BWART = '101' ) AND = 'X'.

CALL FUNCTION 'Z_MIGO_DIS_MAT' EXPORTING

zmatnr = ZGOITEM-MATNR zwerks = ZGOITEM-werks * CHANGING

* DT = EXCEPTIONS

CANCELLED = 1 NO_VALUES = 2 OTHERS = 3 .

IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.

endif.

*---------------------------------------------------------------* *对设备备件103收货后是否进行检验结果纪录进行检查

*---------------------------------------------------------------* IF zgoitem-bwart = '105' AND zgoitem-ekorg = '2000'

AND zgoitem-xdetermination = ' '. \库存确定选择才进行判断

IF zgoitem-webre = ' '.

MESSAGE w000(zz) WITH '非基于收货的发票校验情况下,不确定是否已有检验结果'. ELSE.

* concatenate ZGOITEM-LFBNR ZGOITEM-LFBJA ZGOITEM-LFPOS into ctr. * CALL FUNCTION 'ZTEXT_READ_CHECK' * EXPORTING

* ID = 'F00' * INLINE_COUNT = '1' * LANGUAGE = '1' * NAME = CTR * OBJECT = 'MSEG' ** LOCAL_CAT = ' ' * IMPORTING

** HEADER =

* ME = zME * TABLES

* INLINES = P_INLINES * LINES = P_LINE ** EXCEPTIONS

** ID = 1 ** LANGUAGE = 2 ** NAME = 3 ** NOT_FOUND = 4 ** OBJECT = 5 ** REFERENCE_CHECK = 6 ** OTHERS = 7 * .

* IF SY-SUBRC <> 0.

** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO ** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. * ENDIF.

* if zme = 1.

* message I024(zz) with zGOITEM-LFBNR ZGOITEM-LFBJA ZGOITEM-LFPOS. * LEAVE TO TRANSACTION 'MIGO'. * endif.

* clear ctr.

*&------------------------------------------------------------* *&CHANGE THE LOGIC FOR THE RESULT OF QUALITY MAINTAINENCE

*&------------------------------------------------------------* SELECT SINGLE * FROM zm01_s_103 INTO wa_zm01_s_103 WHERE zmblnr = zgoitem-lfbnr AND zmjahr = zgoitem-lfbja AND zzeile = zgoitem-lfpos. IF sy-subrc NE 0.

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4