MCS50001
EXIT_SAPLMCS5_001 :SIS: User Exit for Deliveries - Header Data
EXIT_SAPLMCS5_002 :SIS: User Exit for Deliveries - Item Data
例子:
EXIT_SAPLMCS5_002 :
DATA: wa_werks LIKE zsd0004_td.
SELECT SINGLE * INTO wa_werks
FROM zsd0004_td
WHERE werks = i_xmclips-werks
AND budat <= sy-datum.
IF sy-subrc = 0.
IF sy-tcode = 'VL01N' OR sy-tcode = 'VL01'.
IF sy-ucomm = 'WABU_T'.
MESSAGE a398(00) WITH 'VL01N不能发货过帐,只能保存!'.
ENDIF.
ENDIF.
IF sy-tcode = 'VL01N' OR
sy-tcode = 'VL01' .
IF i_xmclikp-wadat_ist = '00000000'.
MESSAGE a398(00) WITH '请填写--实际发货日期'.
ENDIF.
ENDIF.
ENDIF.
DATA: s_cmpre LIKE vbap-cmpre, "订单金额
o_zflag TYPE c.
DATA:BEGIN OF lt_vbap OCCURS 0,
kwmeng LIKE vbap-kwmeng,
cmpre LIKE vbap-cmpre,
END OF lt_vbap.
DATA: BEGIN OF it_konv OCCURS 0,
knumv LIKE konv-knumv,
kposn LIKE konv-kposn,
kawrt LIKE konv-kawrt,
END OF it_konv.
** SO 的金额
CLEAR: s_cmpre, lt_vbap[].
SELECT kwmeng cmpre INTO TABLE lt_vbap FROM vbap
WHERE vbeln = i_xmcvbap-vbeln.
*LOOP AT lt_vbap.
* s_cmpre = s_cmpre + lt_vbap-kwmeng * lt_vbap-cmpre.
*ENDLOOP.
DATA: l_knumv LIKE konv-knumv.
CLEAR l_knumv.
SELECT SINGLE knumv INTO l_knumv
FROM vbak
WHERE vbeln = i_xmcvbap-vbeln.
SELECT knumv kposn kawrt
INTO TABLE it_konv
FROM konv
WHERE knumv = l_knumv
AND kschl = 'MWSI'.
LOOP AT it_konv.
s_cmpre = s_cmpre + it_konv-kawrt.
ENDLOOP.
CALL FUNCTION 'Z_CHECK_SO'
EXPORTING
i_vbeln = i_xmcvbap-vbeln
i_kunnr = i_xmclikp-kunnr
i_werks = i_xmclips-werks
i_gjahr = i_xmclikp-lfdat(4)
i_datum = i_xmcvbap-erdat
i_dmbtr = s_cmpre
IMPORTING
o_zflag = o_zflag.
IF o_zflag = 'X'.
MESSAGE a398(00) WITH '订单' i_xmcvbap-vbeln
'订金没有完全交付,不能保存过账!'.
ENDIF.
阅读(15273) | 评论(8) | 转发(1) |