Summary

The document provides one of a solution to generate tax lines while posting FI documents via IDOC or BAPI ACC_DOCUMENT. SAP standard provides a provision using the BAdi exit to enable the tax calculation in the receiving system however it didn’t generate the GL tax lines in the FI posting to be used later for actual debit ( VAT amounts) to the tax GLs.

The scenario

While posting an FI document either from different SAP system or from Legacy system sometimes there are requirements to allow the tax processing to happen in the receiving SAP system. The processing of the tax in the receiving system can easily be activated by enabling the tax calculation, i.e. setting flag xmwst = ‘X’ via BAdI ACC_DOCUMENT. However here i am describing a solution for more complex situation whereby we want the tax lines to be added as part of posted FI document, which will otherwise happen if the document is posted via FB01 (provided tax processing is set in such a way). When we post FI document via FB01, the tax lines are generated and added as part of separate line items in  FI document. However, even though all the system settings are same, this doesn’t happen with the BAPI or IDOC (which eventually calls the BAPI) processing, reason being the way both are processed.  Solution here describes a way to achieve the same with BAPI/IDOC. The solution is valid for SAP ECC 6.0 onwards.

BAdI ACC_DOCUMENT

BAdI can be used to activate the tax calculation flag; this will enable the system to calculate the tax and will be a prerequisite for our solution, as we want the tax lines to be at least in runtime memory for being picked up by us.

Include LFACIF4O

An enhancement point provided in this includes which is called after the tax calculation can be used to append additional tax lines likewise done via transaction code FB01.

ENHANCEMENT-POINT DOCUMENT_TAX_BSET_03 SPOTS ES_SAPLFACI.

The processing routine calls Function module ‘ FI_TAX_CALCULATION_CHECK’ before actually reaching the enhancement point, the call to function module fills up the global parameter ‘XDBSEG’, which got the structure for amending the lines of BSEG. This implies a dynamic call to SAPLTAX2 be used to get the filled values for table ‘XDBSEG’ like,

ASSIGN (‘(SAPLTAX2)XDBSEG[]’) to

Where, is a local field-symbol.

With this you got tax lines as calculated by the tax routine. With this data we can start adjusting the BSEG lines to reflect the tax accounting on line items.

You can copy the code lines as used in standard routine to add tax lines subroutine “steuer_netto_setzen” include “MF05ATAX_STEUER_NETTO_SETZEN” Also add tax item to t_bseg, you can refer to the code as in subroutine OIA_UPE_VAT_LINE

Final lines of code: See attachment Main CodeLines.txt

New NetWeaver Information at SAP.com

Very Helpfull

 

 

User Rating: Be the first one !