cancel
Showing results for 
Search instead for 
Did you mean: 

Tax print problem in smartform by the condition "JVRN" for VAT charges.

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

erm that is plain wrong, if there is tax to be calculated in the document there WILL be a tax condition in table konv.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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".

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Dear Florian Kemmer,

condition JVRN & ZVRN are not present in KONV table..... can you please suggest where these condition types can be find out in which table?

Regards,

Amit

Former Member
0 Kudos

Thanks a lot! Learned something new again, great.

@amit: sorry my comment was misleading due to me beeing not fully aware of SAP standard.

But if they are not in KONV then follow the steps of MD Faheem.

Former Member
0 Kudos

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

Former Member
0 Kudos

Issue resolved....... now working fine.

thanks experts,

Amit

Edited by: akg.amit on Nov 15, 2010 10:39 AM

Edited by: akg.amit on Nov 15, 2010 10:40 AM

Former Member
0 Kudos

Now working fine.

Former Member
0 Kudos

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

Former Member
0 Kudos

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