銷售訂單轉採購訂單增強(可變退貨)
阿新 • • 發佈:2021-01-20
1.增強點:
ES_SAPMM06E
2.SE38也可直接進去MM06EFVA_SET_ITEM_DATA
3.建的隱士增強實施
∗
*
∗-Start: MM06EFVA_SET_ITEM_DATA_01-----------------------------------------------------------
∗
*
∗
ENHANCEMENT 1 ZMM_PRICE_ENH. “active version
*
CALL FUNCTION ‘Z_3PARTY_PO_PRICE_ENH’
EXPORTING
iw_ekko = ekko
iw_eket = eket
ch_ekpo = ekpo.
ENDENHANCEMENT.
∗ * ∗-End: MM06EFVA_SET_ITEM_DATA_01----------------------------------------------------------- ∗ * ∗
ENDFORM.
4.FM裡面寫的是增強程式碼:
FUNCTION z_3party_po_price_enh.
*”----------------------------------------------------------------------
"“本地介面:
*” IMPORTING
*" REFERENCE(IW_EKKO) TYPE EKKO
*" CHANGING
*" REFERENCE(CH_EKPO) TYPE EKPO
*"----------------------------------------------------------------------
DATA: lw_vbep LIKE vbep.
DATA: lw_vbap LIKE vbap.
DATA: l_knumv LIKE vbak-knumv.
DATA: lw_konv LIKE konv.
DATA: l_auart LIKE vbak-auart.
CHECK iw_ekko-bsart = ‘NB’."第三方銷售採購訂單
- CHECK ( ch_ekpo-knttp = ‘X’ OR ch_ekpo-knttp = ‘Z’ ) AND ch_ekpo-pstyp = ‘5’."採購訂單行專案類別
CHECK ch_ekpo-pstyp = ‘5’."採購訂單行專案類別
IF iw_eket-banfn IS INITIAL AND iw_eket-bnfpo IS INITIAL.
RETURN.
ENDIF.
SELECT SINGLE vbeln posnr INTO (lw_vbep-vbeln, lw_vbep-posnr)
FROM vbep
WHERE banfn = iw_eket-banfn
AND bnfpo = iw_eket-bnfpo.
CHECK sy-subrc = 0.
SELECT SINGLE auart knumv INTO (l_auart, l_knumv )
FROM vbak
WHERE vbeln = lw_vbep-vbeln.
CHECK sy-subrc = 0.
IF ch_ekpo-pstyp = ‘5’."採購訂單行專案類別
IF l_auart = 'ZRE3'.
ch_ekpo-retpo = 'X'.
RETURN.
ENDIF.
ENDIF.
ENDFUNCTION.
5.如果想除錯的話,需要用特定使用者ALE通訊。