2012 Jul 10 12:02 PM
Hi All ,
I have developed a Smartform for displaying Purchasae Order in which there is a Function Module for Calculating Tax values . Thw Function Module is - CALCULATE_TAX_ITEM . In this F.M , i give an Internal Table as Input which is of TYPE taxcom . For some P.O's , the FM calculates correct tax values of that PO but for some P.O's , it calculates wrong values . Kindly suggest , what should i do in this case .
Thanks -
Deshark Shukla
2012 Jul 10 12:15 PM
Hi Deshark,
that is not internal table....you are passing structure of type taxcom...
and i want to see the code, which values you are passing to structure ...
Thanks,
Deeps
2012 Jul 11 6:03 AM
Hii Deeps ,
I am mentioning the code below as asked by you . Here V_TAXCOM is an IT of type TAXCOM and IT_KOMV is an IT of the type KOMV .
The problem which i am facing is - I am passing V_TAXCOM in the F.M as W.A , so each time when the loop executes it calculates the values of the taxes by using Condition Value(KAWRT) field . If suppose there are 5 line items for 5 different materials and KAWRT field contains diff. values for all line items , then the calculated values in the KWERT column should contain diff. values . But itz not happening . It appends the value of 1st line item for KWERT to the remaining Line Items .
Please help and suggest me how to resolve this problem ??
Code :-
loop at it_po.
move : it_po-bukrs to v_taxcom-bukrs,
it_po-budat to v_taxcom-budat,
it_po-budat to v_taxcom-bldat,
it_po-waers to v_taxcom-waers,
it_po-waers to v_taxcom-hwaer,
it_po-kposn to v_taxcom-kposn,
it_po-mwskz to v_taxcom-mwskz,
it_po-wrbtr to v_taxcom-wrbtr,
it_po-lifnr to v_taxcom-lifnr,
it_po-ekorg to v_taxcom-ekorg,
it_po-matnr to v_taxcom-matnr,
it_po-werks to v_taxcom-werks,
it_po-matkl to v_taxcom-matkl,
it_po-meins to v_taxcom-meins,
it_po-mglme to v_taxcom-mglme,
it_po-mtart to v_taxcom-mtart,
it_po-land1 to v_taxcom-land1,
'H' to v_taxcom-shkzg,
'X' to v_taxcom-xmwst.
select single mwskz txjcd matnr netpr menge
into (v_mwskz,v_txjcd,v_matnr,v_netpr,v_menge)
from ekpo
where ebeln = wa_ekpo-ebeln and loekz = ''.
* ebelp = v_ebelp AND
if sy-subrc eq 0.
v_base = v_netpr * v_menge.
call function 'CALCULATE_TAX_ITEM'
exporting
* ANZAHLUNG = ' '
* DIALOG = ' '
* DISPLAY_ONLY = ' '
* INKLUSIVE = ' '
* I_ANWTYP = ' '
* I_DMBTR = '0'
* I_MWSTS = '0'
i_taxcom = v_taxcom
* PRUEFEN = ' '
* RESET = ' '
* IMPORTING
* E_NAVFW =
* E_TAXCOM =
* E_XSTVR =
* NAV_ANTEIL =
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
.
endif.
endloop.
2013 Jun 28 7:15 AM
Hi Shukla,
Here is the code I have used.
FUNCTION zmm_calculate_tax.
2013 Jun 28 6:47 AM