函数名为EXIT_SAPMM07M_001,此出口是在MB1A/MB1B保存时触发的增强,可增加输入数量和需求数量的判断。
例子:
*&———————————————————————*
*& 包括 ZXMBCU02
*&———————————————————————*
IF sy-tcode = ‘MB1A’.
IF i_mseg-bwart = ‘261’ OR i_mseg-bwart = ‘262’.
IF l_rsnum = ”.
SELECT SINGLE rsnum FROM afko INTO l_rsnum
WHERE aufnr = i_mseg-aufnr.
ENDIF.
IF it_resb[] IS INITIAL.
SELECT aufnr matnr INTO
CORRESPONDING FIELDS OF TABLE it_resb FROM resb
WHERE rsnum = l_rsnum.
ENDIF.
READ TABLE it_resb INTO it_resb WITH KEY matnr = i_mseg-matnr.
IF sy-subrc <> 0.
MESSAGE ‘生产订单组件清单中有不包含的物料!’ TYPE ‘E’.
ENDIF.
ENDIF.
ENDIF.
PS:最后记得加上e_sgtxt = i_mseg-sgtxt.
转载自:http://blog.itpub.net/9309631/viewspace-751642/