07-02-2012 10:03 AM
Hello ABAP Experts ,
I am subjected to a client requirement according to which whenever purchase orders are created with stock transfer document type (ZSTM , ZSTO are the customised types used) , Commitment item field under the ACCOUNT ASSIGNMENT Tab in me21n should be filled with value 'DUMMY'.
So i choose ME_PROCESS_PO_CUST Badi to accomplish this task.
And taking the below conditions i wrote my code :
Whenever Purchase Order type ZSTM or ZSTO is selected Item Category is automatically assigned with value 7 ( its displayed as value U but is saved as value 7 in EKPO)
So whenever EKPO-PSTYP = '7'
set EKKN-FIPOS = 'DUMMY'.
My code is as follows which i wrote under METHOD PROCESS_ACCOUNT
method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ACCOUNT.
DATA: LS_ACCOUNT TYPE MEPOACCOUNTING ,
LS_ITEM TYPE REF TO IF_PURCHASE_ORDER_ITEM_MM,
PO_ITEM TYPE MEPOITEM.
BREAK : SAPABAP.
LS_ITEM = IM_ACCOUNT->GET_ITEM( ). "for getting PO line item being processed
PO_ITEM = LS_ITEM->GET_DATA( ).
LS_ACCOUNT = IM_ACCOUNT->GET_DATA( ). "for getting PO line item Account Assignment
IF PO_ITEM-PSTYP eq '7'.
LS_ACCOUNT-FIPOS = 'DUMMY'.
CALL METHOD IM_ACCOUNT->SET_DATA( LS_ACCOUNT ).
ENDIF.
Break point is also not working.
Thanks n Regards ,
Sij
07-03-2012 1:43 AM
Are you using the classic BADi ME_PROCESS_PO_CUST or have you implemented it from the new Enhancement Spot ME_PROCESS_PO_CUST ?
The classic BADI has been migrated to the new Enhancement Spot ME_PROCESS_PO_CUST.
- Puneet
07-03-2012 6:43 AM
Hello Puneet ,
I have implemented using the classic BADI ME_PROCESS_PO_CUST.
I will try your suggestion and revert you back.
Thanks n Regards ,
Sij.
07-03-2012 6:54 AM
Hello Puneet ,
I have checked and found that my implementation is showing in new Enhancement Spot ME_PROCESS_PO_CUST also.
You can check it out from the below screen shot
07-04-2012 2:16 AM
Hi Sijin Chandran,
This BADI ME_PROCESS_PO_CUST is not a multiple use and allows only an implementation.
Please check if exists other implementation active in the system. I suspect that's it.
Regards
Bruno Xavier.
07-04-2012 7:05 AM
Hello Bruno ,
No this the only implementation in our system. If multiple usage is not allowed in this BADI then how can i create a new one.
Anyway i have managed the solution by implementing the same in Method PROCESS_ITEM.
And its working , whenever the user creates a PO with type ZSTM or ZSTO Commitment Item field gets filled with DUMMY value.
Thank you all for spending your valuable time for helping me to find the solution.
11-17-2012 8:21 AM
This is because the Classical BAdi has migrated to new BADI... check the implementation of the enhancement spot and it should work for you..
11-17-2012 8:58 AM
Hello All ,
I got the solution for this problem by writing code in Method PROCESS_ITEM instead.
Thanks to all for your contributions.