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: 

How to get tax amounts related to PO

Former Member
0 Kudos
380

Dear All,

I have to write a report based on PO and taxes related to it.

I have got the PO details, but how to get the tax details like service tax, Excise , SHcess.

I get some details in KONV table but when I check the PO taxes there are more no. of taxes.

miro has not been done for that PO.

Please help,

Thanks in advance,

Salman Zahir

1 ACCEPTED SOLUTION

Former Member
0 Kudos
310

Hi,

Please Use the FM : CALCULATE_TAX_ITEM to fetch all taxes pertaining to PO and line Item.

Before this we have to use FM:'REFRESH_TAX_TABLES'.

Check the sample code for your reference.:

LOOP AT it_ekko_ekpo INTO is_ekko_ekpo.

CALL FUNCTION 'REFRESH_TAX_TABLES'

  • EXPORTING

  • LIVERY = 1

.

CONCATENATE '0' is_ekko_ekpo-ebelp INTO w_ebelp.

*"--- Assigning values to Taxcom

is_taxcom-bukrs = is_ekko_ekpo-bukrs.

is_taxcom-budat = is_ekko_ekpo-bedat.

is_taxcom-ebeln = is_ekko_ekpo-ebeln.

is_taxcom-kposn = w_ebelp.

is_taxcom-mwskz = is_ekko_ekpo-mwskz.

is_taxcom-lifnr = is_ekko_ekpo-lifnr.

is_taxcom-matnr = is_ekko_ekpo-matnr.

is_taxcom-werks = is_ekko_ekpo-werks.

is_taxcom-land1 = is_ekko_ekpo-lands.

is_taxcom-wrbtr = is_ekko_ekpo-netwr.

IF is_taxcom-mwskz IS NOT INITIAL.

*"--- Function Module to get Condition types

CALL FUNCTION 'CALCULATE_TAX_ITEM'

EXPORTING

i_taxcom = is_taxcom

TABLES

t_xkomv = it_komv

EXCEPTIONS

mwskz_not_defined = 1

mwskz_not_found = 2

mwskz_not_valid = 3

steuerbetrag_falsch = 4

country_not_found = 5

OTHERS = 6.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

DELETE it_komv WHERE kbetr = 0.

LOOP AT it_komv INTO is_komv.

is_out-kschl = is_komv-kschl.

APPEND is_out TO it_out.

ENDLOOP.

CLEAR: is_taxcom,

w_ebelp.

ENDIF.

ENDLOOP.

thanks

Eswar Rao

4 REPLIES 4

GauthamV
Active Contributor
0 Kudos
310

Did you check KONP,KONH tables ?

Former Member
0 Kudos
310

Yes I have checked the tables KONH KONP butI cannot find the entries corresponding

to the condition record number.

Edited by: Salman Zahir on Mar 30, 2009 1:52 PM

Former Member
0 Kudos
311

Hi,

Please Use the FM : CALCULATE_TAX_ITEM to fetch all taxes pertaining to PO and line Item.

Before this we have to use FM:'REFRESH_TAX_TABLES'.

Check the sample code for your reference.:

LOOP AT it_ekko_ekpo INTO is_ekko_ekpo.

CALL FUNCTION 'REFRESH_TAX_TABLES'

  • EXPORTING

  • LIVERY = 1

.

CONCATENATE '0' is_ekko_ekpo-ebelp INTO w_ebelp.

*"--- Assigning values to Taxcom

is_taxcom-bukrs = is_ekko_ekpo-bukrs.

is_taxcom-budat = is_ekko_ekpo-bedat.

is_taxcom-ebeln = is_ekko_ekpo-ebeln.

is_taxcom-kposn = w_ebelp.

is_taxcom-mwskz = is_ekko_ekpo-mwskz.

is_taxcom-lifnr = is_ekko_ekpo-lifnr.

is_taxcom-matnr = is_ekko_ekpo-matnr.

is_taxcom-werks = is_ekko_ekpo-werks.

is_taxcom-land1 = is_ekko_ekpo-lands.

is_taxcom-wrbtr = is_ekko_ekpo-netwr.

IF is_taxcom-mwskz IS NOT INITIAL.

*"--- Function Module to get Condition types

CALL FUNCTION 'CALCULATE_TAX_ITEM'

EXPORTING

i_taxcom = is_taxcom

TABLES

t_xkomv = it_komv

EXCEPTIONS

mwskz_not_defined = 1

mwskz_not_found = 2

mwskz_not_valid = 3

steuerbetrag_falsch = 4

country_not_found = 5

OTHERS = 6.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

DELETE it_komv WHERE kbetr = 0.

LOOP AT it_komv INTO is_komv.

is_out-kschl = is_komv-kschl.

APPEND is_out TO it_out.

ENDLOOP.

CLEAR: is_taxcom,

w_ebelp.

ENDIF.

ENDLOOP.

thanks

Eswar Rao

0 Kudos
310

Thanks Eswar problem solved

Salman Zahir