06-15-2015 7:23 PM
Hi All
Please, I need some help.
There is a requirement to update the cost center (field KOSTL table EKKN) - when Account Assignment Category equal 'F'.
And also the cost center should appear at ME21N/ME22N/ME23N screen. The functional analyst already customized KOSTL at the screen.
I am using BADI ME_PROCESS_PO_CUST, method PROCESS_ITEM
data: ls_mepoitem type mepoitem.
data: lt_account type purchase_order_accountings.
data: wa_items type purchase_order_accounting.
data : lt_exkn type mepoaccounting.
ls_mepoitem = im_item->get_data( ).
lt_account = im_item->get_accountings( ).
loop at lt_account into wa_items.
lt_exkn = wa_items-accounting->get_data( ).
* obtain cost center from COAS
data: l_kostv type coas-kostv.
clear l_kostv.
select single kostv
into l_kostv
from coas
where aufnr = lt_exkn-aufnr.
if sy-subrc ne 0.
clear l_kostv.
endif.
ls_mepoitem-kostl = l_kostv.
im_item->set_data( ls_mepoitem ).
endloop.
The problem is that EKKN-KOSTL is not been update and also the cost center at the ME21N is not displaying the cost center data.
Could you please advise?
Thanks in advance.
Joao Gaia
07-07-2015 5:57 AM
The Below Documentation for Business Add-In ME_PROCESS_PO_CUST explains that the Account Data can be changes using this method .
The PROCESS_ACCOUNT method enables you to change the account assignment data and check it for correctness.
The following parameters are available:
- IM_ACCOUNT - Account assignment
The interface reference is of the type IF_PURCHASE_ORDER_ACCOUNT_MM. You can use all methods defined there.
One more check whether the Data is maintained for the Internal Order in KO03(Display of Internal Order).
Thanks,
Seshadri
07-24-2015 11:20 AM
Hi
For the interface IF_PURCHASE_ORDER_ACCOUNT_MM there is a method SET_DATA , Did you try it ?