Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Link between taxcode and condition types (mwskz and kschl )

Former Member
0 Kudos

Hi Friends,

In PO - local taxes are calculated in the invoice tab of item details. I need to fetch these tax values to populate in my PO SmartForm.

How to get these taxes? Is there any Function Modules for this or otherwise Is there any relation between the tax code and conditions types assigned to that tax code in table level .

Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

There is no standard table to store local taxes in SAP. U have to calculate all the taxes in program. for that use FM 'CALCULATE_TAX_ITEM'.

Sample Code:

CLEAR taxcom.

taxcom-bukrs = '1000'.

taxcom-budat = wa_ekko-bedat.

taxcom-waers = wa_ekko-waers.

taxcom-kposn = wa_ekpo-ebelp.

taxcom-mwskz = wa_ekpo-mwskz.

taxcom-shkzg = 'H'.

taxcom-xmwst = 'X'.

taxcom-wrbtr = wa_ekpo-netwr.

taxcom-lifnr = wa_ekko-lifnr.

taxcom-land1 = 'IN'.

taxcom-ekorg = wa_ekko-ekorg.

taxcom-hwaer = 'INR'.

taxcom-bldat = wa_ekko-bedat.

taxcom-matnr = wa_ekpo-matnr.

taxcom-werks = wa_ekpo-werks.

taxcom-bwtar = wa_ekpo-bwtar.

taxcom-matkl = wa_ekpo-matkl.

taxcom-meins = wa_ekpo-meins.

taxcom-mglme = wa_ekpo-menge.

taxcom-mtart = wa_ekpo-mtart.

REFRESH i_taxes.

CLEAR i_taxes.

CALL FUNCTION 'CALCULATE_TAX_ITEM'

EXPORTING

i_taxcom = taxcom

TABLES

t_xkomv = i_taxes.

LOOP AT i_taxes WHERE kposn EQ wa_ekpo-ebelp.

CASE i_taxes-kschl.

WHEN 'JMO1'OR 'JMO2'.

l_bed = l_bed + i_taxes-kwert.

WHEN 'JEC1' OR 'JEC2'.

l_ecs = l_ecs + i_taxes-kwert.

WHEN 'JA1S' OR 'JA1I'.

l_sec = l_sec + i_taxes-kwert.

WHEN OTHERS.

l_tax = l_tax + i_taxes-kwert.

ENDCASE.

ENDLOOP.

ENDIF.

Rewards Points if helpful.

Regards,

Srinivas Ch

2 REPLIES 2

Former Member
0 Kudos

Hi,

There is no standard table to store local taxes in SAP. U have to calculate all the taxes in program. for that use FM 'CALCULATE_TAX_ITEM'.

Sample Code:

CLEAR taxcom.

taxcom-bukrs = '1000'.

taxcom-budat = wa_ekko-bedat.

taxcom-waers = wa_ekko-waers.

taxcom-kposn = wa_ekpo-ebelp.

taxcom-mwskz = wa_ekpo-mwskz.

taxcom-shkzg = 'H'.

taxcom-xmwst = 'X'.

taxcom-wrbtr = wa_ekpo-netwr.

taxcom-lifnr = wa_ekko-lifnr.

taxcom-land1 = 'IN'.

taxcom-ekorg = wa_ekko-ekorg.

taxcom-hwaer = 'INR'.

taxcom-bldat = wa_ekko-bedat.

taxcom-matnr = wa_ekpo-matnr.

taxcom-werks = wa_ekpo-werks.

taxcom-bwtar = wa_ekpo-bwtar.

taxcom-matkl = wa_ekpo-matkl.

taxcom-meins = wa_ekpo-meins.

taxcom-mglme = wa_ekpo-menge.

taxcom-mtart = wa_ekpo-mtart.

REFRESH i_taxes.

CLEAR i_taxes.

CALL FUNCTION 'CALCULATE_TAX_ITEM'

EXPORTING

i_taxcom = taxcom

TABLES

t_xkomv = i_taxes.

LOOP AT i_taxes WHERE kposn EQ wa_ekpo-ebelp.

CASE i_taxes-kschl.

WHEN 'JMO1'OR 'JMO2'.

l_bed = l_bed + i_taxes-kwert.

WHEN 'JEC1' OR 'JEC2'.

l_ecs = l_ecs + i_taxes-kwert.

WHEN 'JA1S' OR 'JA1I'.

l_sec = l_sec + i_taxes-kwert.

WHEN OTHERS.

l_tax = l_tax + i_taxes-kwert.

ENDCASE.

ENDLOOP.

ENDIF.

Rewards Points if helpful.

Regards,

Srinivas Ch

0 Kudos

Problem solved.

Thanks a lot Srinivas.