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