Академический Документы
Профессиональный Документы
Культура Документы
Welcome Guest
SDN Community BPX Community Business Analytics University Alliances SAP EcoHub
Home Forums Wiki Blogs Articles eLearning Downloads Code Exchange Career Center Events InnoCentive Idea Place SAP Help Portal
My Home > Code Gallery > Function Module to Calculate Tax in Purchase order based on condition type Browse Search
Function Module to Calculate Tax in Purchase order based on condition type Tools
4 Added by Jyothi Swaroop Kaza, last edited by Florian Teepen on Jul 21, 2010 (view change)
---> Introduction / Overview Function Module to calculate TAX in Purchase Order- What is it?
This development is used for calculating tax amount based on Condition types. Generally when we create Purchase order, the tax amount is calculated based on tax code.
While creating Purchase order if we click on taxes, the tax detailed screen will appear (refer below screen shot), In which we can see Tax calculated based on condition type. The tax field contains
the sum of all the condition types .However in our development we need to calculate tax amount only for certain condition types which we could not find in any table, so for that we developed this
Function module in which we would be getting all the condition types value separately.
The Function Module requires Purchase order header details, item details and vendor details of Purchase Order .In purchase order, tax details are item specific. So if Purchase Order has multiple
items, the function module should be in item loop.
The Table parameter has T_KONV parameter. These T_KONV parameters will populate with all condition type and amounts
CLEAR l_taxcom.
l_taxcom-bukrs = i_ekpo-bukrs.
l_taxcom-budat = i_ekko-bedat.
l_taxcom-waers = i_ekko-waers.
l_taxcom-kposn = i_ekpo-ebelp.
l_taxcom-mwskz = i_ekpo-mwskz.
l_taxcom-txjcd = i_ekpo-txjcd.
l_taxcom-shkzg = 'H'.
l_taxcom-xmwst = 'X'.
IF i_ekko-bstyp EQ 'F'.
l_taxcom-wrbtr = i_ekpo-netwr.
ELSE.
l_taxcom-wrbtr = i_ekpo-zwert.
ENDIF.
l_taxcom-lifnr = i_ekko-lifnr.
l_taxcom-land1 = i_ekko-lands. "WIA
l_taxcom-ekorg = i_ekko-ekorg.
l_taxcom-hwaer = l_wa_t001-waers.
l_taxcom-llief = i_ekko-llief.
l_taxcom-bldat = i_ekko-bedat.
l_taxcom-matnr = i_ekpo-matnr. "HTN-Abwicklung
l_taxcom-werks = i_ekpo-werks.
l_taxcom-bwtar = i_ekpo-bwtar.
l_taxcom-matkl = i_ekpo-matkl.
l_taxcom-meins = i_ekpo-meins.
IF i_ekko-bstyp EQ 'F'.
l_taxcom-mglme = i_ekpo-menge.
ELSE.
IF i_ekko-bstyp EQ 'K' AND i_ekpo-abmng GT 0.
l_taxcom-mglme = i_ekpo-abmng.
ELSE.
l_taxcom-mglme = i_ekpo-ktmng.
ENDIF.
ENDIF.
IF l_taxcom-mglme EQ 0.
l_taxcom-mglme = 1000.
ENDIF.
l_taxcom-mtart = i_ekpo-mtart.
*Calculation of TAX
1) This Function Module is used for printing partial tax amount in purchase order form .
Labels
snippet abap