Consider the scenario: During invoice verification, it is found that a vendor invoice amount is often a ’rounded’ form of the expected amount (from PO/GR). The small differences are passed into a GL account which is defined in OBYC against the key DIF. Check the following link for more.
https://aroopsnotepad.wordpress.com/2013/09/27/rounding-off-in-invoice-verification/
If the GL account assigned to DIF is a P&L item and it has a cost element assigned to it, it longs for a CO object resulting in an error Account xxxx requires assignment to a CO object.
The general technique is to assign a default cost center against the company code and cost element in OKB9. But what to do when the cost center needs to be derived from the profit center (or plant)? The OKB9 configuration does not work since neither the profit center not the plant gets passed into the line item for rounding differences.
You can ‘push’ the profit center or the plant to the line item by means of an enhancement.
In the include LMRMPF09, form accit_dif_aufbauen, the system generates the difference line item.
At the end of the form, use the enhancement point to update the profit center.
ptx_accit[] is an internal table which contains all the FI line items.
The enhancement can identify the row containing DIF and then change profit center / plant.
In the screenshot above, the profit center is forced into ptx_accit internal table in the line item containing DIF.
Once the profit center is found, the system can derive the cost center automatically using the standard OKB9 configuration.
The above subroutine is called both during simulation as well as posting. It is also called during MR8M (cancellation of invoices).
ERS would not have this issue, since the vendor invoices are not physically entered.
A sample code is below.
Lets assume the requirement is that
a) Tcode is MIRO or MR8M
b) A DIF line item exists (implies there is a value to be rounded off)
c) The profit center of the difference line item must be the same as that of the WRX line item (ie the GRIR clearing account)
*** enhancement starts
field-symbols: <lf_accit_dif> type accit, <lf_accit_wrx> type accit.
if sy-tcode = ‘MIRO’ or sy-tcode = ‘MR8M’.
read table ptx_accit assigning <lf_accit> with key ktosl = ‘DIF’.
if sy-subrc = 0.
read table ptx_accit assigning <lf_accit_wrx> with key ktosk = ‘WRX’.
if sy-subrc = 0.
<lf_accit_dif>-prctr = <lf_accit_wrx>-prctr.
endif.
endif.
endif.