2012 Jul 02 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
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
2012 Jul 03 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
2012 Jul 03 6:43 AM
2012 Jul 03 6:54 AM
2012 Jul 04 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.
2012 Jul 04 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.
2012 Nov 17 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..
2012 Nov 17 8:58 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |