Hi,
I need to know which all EXIT(S) and BAdI(s) i need if i need the system to block PO and items
cancellation (deletion) if advance payment has been made for that PO.
Following points would really help:
1. EXIT/BAdI which is triggered at PBO and has i_ekko as input parameter.
2. EXIT/BAdI which would help me to cancel that PO.
I tried using
EXIT MM06E005 -> EXIT_SAPMM06E_013 & EXIT_SAPMM06E_012(Function Module)->
INCLUDE ZXM06U44
For exporting PO Number to ABAP memory, but none of them triggers at PBO or while cancelling the PO.
In ZXM06U44 , wrote the following code, for exporting PO Number to ABAP memory:
EXPORT zebeln FROM i_ekko-ebeln TOMEMORYID'ZABC'.
Then in BAdI 'ME_ACTV_CANCEL_PO' -> CHECK_ACTIVITY, wrote this:
IF sy-tcode = 'ME22'OR sy-tcode = 'ME22N'OR sy-tcode = 'ME23'OR sy-tcode = 'ME23N'OR sy-tcode = 'ME29'OR sy-tcode = 'ME29N'.
TYPES: BEGINOF IT_BSEG,
EBELN TYPE BSEG-EBELN,
BELNR TYPE BSEG-BELNR,
GJAHR TYPE BSEG-GJAHR,
ENDOF IT_BSEG,
BEGINOF IT_BKPF,
BELNR TYPE BKPF-BELNR,
GJAHR TYPE BKPF-GJAHR,
BLART TYPE BKPF-BLART,
ENDOF IT_BKPF.
DATA: GT_BSEG TYPETABLEOF IT_BSEG,
GS_BSEG TYPE IT_BSEG,
GT_BKPF TYPETABLEOF IT_BKPF,
GS_BKPF TYPE IT_BKPF,
VAR(1).
SELECT EBELN BELNR GJAHR FROM BSEG
INTOTABLE GT_BSEG
WHERE EBELN = yebeln.
SELECT BELNR GJAHR BLART from bkpf
INTOTABLE GT_BKPF
FORALL ENTRIES IN GT_BSEG
WHERE BELNR = GT_BSEG-BELNR AND GJAHR = GT_BSEG-GJAHR.
LOOPAT GT_Bkpf INTO GS_Bkpf.
IF GS_bkpf-BLART = 'DP'.
VAR = 'X'.
ENDIF.
ENDLOOP.
IF VAR = 'X'.
IS_ACTIVE = 1. " IS_ACTIVE is standard export parameter.
ENDIF.
ENDIF.
-> I chose this BAdI because the name kind of says that it is for cancelling PO "ME_ACTV_CANCEL_PO".
But when i put debugger on them, none of them are triggered.
Can someone tell me the exact BAdI(s) and EXITS i should be using here?
Thanks & Regards,
KS