on 10-27-2010 12:21 PM
I have developed the smartform of service order for the organization. In that service order, I am unable to print the VAT charges on any specific material. Kindly note, VAT charges are present in "JVRN" condition type. I just find out the table KNOV, KOMV from where I have print the Frieght charges with other condition type. but I am unable to print the JVRN condition type. Can you please suggest where this "JVRN" condition type is present & in which table? Please suggest to rectify the problem <removed by moderator>.
Regards,
Amit
Edited by: Thomas Zloch on Oct 27, 2010 1:29 PM
Hi Amit,
Taxes like VAT,CST(which are defined under Tax Code)will not store in any table, you have to use FM 'CALCULATE_TAX_ITEM' to calculate the tax. The following is the example code :
FORM F_TAX_CALCULATE .
REFRESH : I_TAXES.
CLEAR : EKPO,TAXCOM.
READ TABLE EKPO WITH KEY EBELN = P_EBELN EBELP = IT_FINAL-EBELP.
IF IT_FINAL-EBELP = W_EBELP OR W_WERKS IS INITIAL.
W_WERKS = EKPO-WERKS.
SELECT SINGLE * FROM T001W INTO T001W WHERE WERKS = W_WERKS.
SELECT SINGLE ADRNR FROM KNA1 INTO W_ADRNR WHERE KUNNR = EKPO-KUNNR.
IF W_ADRNR IS INITIAL.
W_ADRNR2 = EKPO-ADRN2.
ENDIF.
IF EKKO-ADRNR IS NOT INITIAL.
W_ADRNR1 = EKKO-ADRNR.
SELECT SINGLE * FROM ADRC INTO WA_ADRC WHERE ADDRNUMBER = W_ADRNR1.
ELSE.
SELECT SINGLE ADRNR INTO W_ADRNR1 FROM LFA1 WHERE LIFNR = EKKO-LIFNR.
SELECT SINGLE * FROM ADRC INTO WA_ADRC WHERE ADDRNUMBER = W_ADRNR1.
ENDIF.
ENDIF.
IF EKPO-MWSKZ IS NOT INITIAL.
TAXCOM-BUKRS = EKPO-BUKRS.
TAXCOM-BUDAT = EKKO-BEDAT.
TAXCOM-WAERS = EKKO-WAERS.
TAXCOM-KPOSN = EKPO-EBELP.
TAXCOM-MWSKZ = EKPO-MWSKZ.
TAXCOM-TXJCD = EKPO-TXJCD.
TAXCOM-SHKZG = 'H'.
TAXCOM-XMWST = 'X'.
TAXCOM-WRBTR = EKPO-NETWR.
TAXCOM-LIFNR = EKKO-LIFNR.
TAXCOM-LAND1 = EKKO-LANDS.
TAXCOM-EKORG = EKKO-EKORG.
TAXCOM-HWAER = T001-WAERS.
TAXCOM-LLIEF = EKKO-LLIEF.
TAXCOM-BLDAT = EKKO-BEDAT.
TAXCOM-MATNR = EKPO-EMATN.
TAXCOM-WERKS = EKPO-WERKS.
TAXCOM-BWTAR = EKPO-BWTAR.
TAXCOM-MATKL = EKPO-MATKL.
TAXCOM-MEINS = EKPO-MEINS.
TAXCOM-MGLME = EKPO-MENGE.
TAXCOM-MTART = EKPO-MTART.
LOOP AT IT_KONV WHERE KSCHL IN R_KSCHL AND KPOSN = EKPO-EBELP.
TAXCOM-WRBTR = TAXCOM-WRBTR + IT_KONV-KWERT.
ENDLOOP.
CALL FUNCTION 'FIND_TAX_SPREADSHEET'
EXPORTING
BUCHUNGSKREIS = T001-BUKRS
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
CALL FUNCTION 'CALCULATE_TAX_ITEM'
EXPORTING
I_TAXCOM = TAXCOM
IMPORTING
E_TAXCOM = TAXCOM
TABLES
T_XKOMV = I_TAXES
EXCEPTIONS
MWSKZ_NOT_DEFINED = 1
MWSKZ_NOT_FOUND = 2
MWSKZ_NOT_VALID = 3
STEUERBETRAG_FALSCH = 4
COUNTRY_NOT_FOUND = 5
OTHERS = 6.
LOOP AT I_TAXES WHERE KPOSN = IT_FINAL-EBELP.
*****VAT************
IF I_TAXES-KSCHL = 'JVRN'. "Put all your Tax Conditions
IF W_VAT_R IS INITIAL.
W_VAT_R = W_VAT_R + I_TAXES-KBETR / 10.
ENDIF.
W_VAT_A = W_VAT_A + I_TAXES-KWERT.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " F_TAX_CALCULATE
Thanks & Regards,
Faheem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florian Kemmer,
The taxes which are under Conditions tab will come into KONV table and the taxes under Tax code will not store in any table and using the above said FM, you can get them. Please do research before coming to any conclusion.
Amit, you have to calculate all the taxes in your print program using the above said FM and supply them to the Samrtform. Some other code is also available which you can ignore in my above post.
Thanks & Regards,
Faheem.
what taxes are you talking about? there are only taxes on item level which are actually in KONV, if you are referring to taxes on header level, well you need to sum you taxes from konv over all items. Maybe we misunderstood ourself but i have no idea what taxes you mean with "taxes under tax code".
Hi Florian Kemmer,
There are 2 kind of taxes at item level.
1) Which we define under Conditions Tab, they will get stored in KONV, with reference of condition record number(EKKO-KNUMV) of PO we can retrieve them.
2)Taxes defined using Tax Code under Invoice tab check this image : [http://i52.tinypic.com/2a8ki86.png]. These taxes will not store in any database table, we have to retrieve them using FMs only. One of the FM is available in my above post.
Contries like India,Brazil have complex taxation and there only you willl find these Tax Codes.
Hope things are clear now
Thanks & Regards,
Faheem.
Dear Experts,
I have used the same table KONV but it's uable to find the condition types "JVRN", "ZVRN" specifically for the VAT charges on service order of smartorm. Can you please suugest the driver program code. My problem is still under pipeline. please suggest , how to resolve?
Regards,
Amit
Dear Florian Kemmer,
Thanks for replying, its not a matter for sorry dear. But your point of view is really valueable but others also haveing some point of view that is also considerable. but my problem is not being solved yet. I am still waiting for the accurate answer. If you have got any alternative solution for that, than I am also requesting you to share it please with your valueable comments.
Regards,
Amit
Edited by: akg.amit on Oct 28, 2010 11:45 AM
Dear Experts,
Kindly let me know , where should i have to make modification in program.
I am using the code for the same as below:
CLEAR V_VAT.
DATA : V_KNUMV LIKE EKKO-KNUMV,
V_KSCHL LIKE KONV-KSCHL,
V_HC00 LIKE KONV-KBETR,
V_HC00V LIKE KONV-KWERT.
SELECT SINGLE KWERT KSCHL INTO (V_VAT, V_KSCHL) FROM KONV
WHERE KNUMV = V_KNUMV
AND ( KSCHL = 'JVRD' OR KSCHL = 'JVRN' OR KSCHL = 'JIPC' OR KSCHL = 'ZVRN' ).
CLEAR: V_VAT.
SELECT SINGLE KBETR FROM KONV INTO V_VAT
WHERE KNUMV = V_KNUMV.
V_VAT = V_VAT / 10 .
CLEAR: V_TOT_TAX.
V_TOT_TAX = ( V_AMT * V_VAT ) / 100 .
CLEAR: STR10.
IF V_KSCHL = 'JVRD' OR V_KSCHL = 'JVRN' OR V_KSCHL = 'JIPC' OR V_KSCHL = 'ZVRN'.
*STR = V_MISC.
STR10 = V_VAT.
ELSE.
STR10 = V_HC00V / 10.
STR9 = V_HC00.
*V_MISC = V_HC00V.
V_VAT = V_HC00V.
ENDIF.
*******************************
CLEAR str10.
str10 = v_tot_tax.
CLEAR str9.
str9 = v_vat.
********************************
Regards,
Amit
Edited by: akg.amit on Oct 27, 2010 1:24 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
there´s a lot wrong.
1. you do a select single with many contions on kschl which are actually linked with OR statements.
That means if e.G. more than one of your KSCHLs are in the document, you will never know which one your select, selected.
2. right after that you do again a select single into the same field which you filled with the previous select, but now you dont even limit KSCHL so you are selecting the value of some random condition in the document. And with this random select you even overwrite what you already had.
3. Selecting just values from konv without the corresponding currencies isnt a too good idea as well.
didnt look any further since it seems you´d better take a basic course
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.