* BEGIN OF DELETE BY SD13032008 DEL FOR CPSS 8735 ** CODE MODIFED BY SD28122007 FOR CPSS 8735 ** CODE MODIFIED BY SD07022008 FOR CPSS 8735 * TYPES: BEGIN OF TY_VBRK, * * VBTYP LIKE VBRK-VBTYP, * END OF TY_VBRK. * * DATA: W_VBRK LIKE VBRK. * * TYPES: BEGIN OF TY_VBUK, * VBELN LIKE VBUK-VBELN, * END OF TY_VBUK. * * DATA: W_VBUK LIKE VBUK. * * IF SY-TCODE EQ 'VF01' OR * SY-TCODE EQ ‘VF02’ OR * SY-TCODE EQ ‘VF11’. * * * IF tkomk-vkorg = 'HRO1' OR * tkomk-vkorg = 'HRO2' OR * tkomk-vkorg = 'HRO3' OR * tkomk-vkorg = 'HAG1' OR * tkomk-vkorg = 'YDI1'. * * * IF VBUK-VBTYP NE 'M'. "SD12022008INS FOR CPSS 8735 * * PERFORM ZZ_TAX_DETERMINATION_COMPANY CHANGING VBRK-STCEG. **"SD28122007I * ENDIF. * * CLEAR W_VBRK. * ENDIF. * * ENDIF. ** END OF CODE CHANGE * END OF DELETE BY SD13032008 DEL * begin of delete by SD13032008 DEL * CODE CHANGED BY SD28122007 FOR CPSS 8735 *FORM ZZ_TAX_DETERMINATION_COMPANY * CHANGING VBRK-STCEG." TABLES XKOMV STRUCTURE KOMV. * * TYPES: BEGIN OF TY_ZVAT, * MANDT LIKE ZVAT-MANDT, * COUNTRYCODE LIKE ZVAT-COUNTRYCODE, * VATCODE LIKE ZVAT-VATCODE, * END OF TY_ZVAT. * * TYPES: BEGIN OF TY_KNAS, * LAND1 LIKE KNAS-LAND1, * STCEG LIKE KNAS-STCEG,
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
KUNNR LIKE KNAS-KUNNR, END OF TY_KNAS. TYPES: BEGIN OF TY_KNA1, LAND1 LIKE KNA1-LAND1, STCEG LIKE KNA1-STCEG, KUNNR LIKE KNA1-KUNNR, END OF TY_KNA1. DATA:W_VBPA LIKE VBPA. DATA:W_KNAS TYPE TY_KNAS. DATA:W_KNA1 TYPE TY_KNA1. DATA: W_ZVAT TYPE TY_ZVAT. DATA: I_XKOMV LIKE XKOMV. LOOP AT XKOMV WHERE KSCHL = 'MWST'. I_XKOMV = XKOMV. SELECT SINGLE COUNTRYCODE INTO W_ZVAT-COUNTRYCODE FROM ZVAT WHERE VATCODE = XKOMV-MWSK1. IF SY-SUBRC = 0. SELECT SINGLE KUNNR INTO W_VBPA-KUNNR FROM VBPA WHERE PARVW = 'AG' AND VBELN = VBAK-VBELN. IF SY-SUBRC = 0. SELECT SINGLE STCEG INTO W_KNAS-STCEG FROM KNAS WHERE LAND1 = W_ZVAT-COUNTRYCODE AND KUNNR = W_VBPA-KUNNR. IF SY-SUBRC NE 0. SELECT SINGLE STCEG INTO W_KNAS-STCEG FROM KNA1 WHERE LAND1 = W_ZVAT-COUNTRYCODE. ENDIF. ENDIF. ELSE. CONTINUE. ENDIF. MOVE I_XKOMV-KNUMV TO XVBRK-VBELN. MOVE W_KNAS-STCEG TO VBRK-STCEG. MOVE W_KNAS-STCEG TO XVBRK-STCEG. MOVE W_ZVAT-COUNTRYCODE TO VBRK-STCEG_L.
* * MOVE W_ZVAT-COUNTRYCODE TO XVBRK-STCEG_L. * * MODIFY XVBRK INDEX 1. * * * ENDLOOP. * *ENDFORM. "ZZ_TAX_DETERMINATION_COMPANY * * END OF CHANGES * END OF DELETE BY SD13032008 DEL
first include include zymk0027. "tax determination
"SDV971112INS
* CODE CHANGED BY SHUBHANGI ON 26TH Dec 2007 FOR CPSS 8735 *FORM ZZ_TAX_DETERMINATION_COMPANY ." TABLES XKOMV STRUCTURE KOMV. ** ** *** DATA: BEGIN OF I_VBPA OCCURS 0, *** VBELN LIKE VBPA-VBELN, *** LAND1 LIKE VBPA-LAND1, *** END OF I_VBPA. *** *** DATA: W_VBPA LIKE I_VBPA. **** **** DATA: BEGIN OF I_LIPS OCCURS 0, **** VGBEL LIKE LIPS-VGBEL, *** *** END OF I_LIPS. *** ****DATA: BEGIN OF I_VBRP OCCURS 0, **** VBELN LIKE VBRP-VBELN, **** VGPOS LIKE VBRP-VGPOS, **** END OF I_VBRP. **** ****DATA: BEGIN OF I_VBRK OCCURS 0, **** VBELN LIKE VBRK-VBELN, **** KNUMV LIKE VBRK-KNUMV, **** END OF I_VBRK. **** **** * DATA: BEGIN OF I_ZVAT OCCURS 0, * COUNTRYCODE LIKE ZVAT-COUNTRYCODE, * VATCODE LIKE ZVAT-VATCODE, * END OF I_ZVAT. **** **** DATA: BEGIN OF I_KONV OCCURS 0, **** KNUMV LIKE KONV-KNUMV, **** KSCHL LIKE KONV-KSCHL, **** MWSK1 LIKE KONV-MWSK1, **** END OF I_KONV. ****
**** DATA:BEGIN OF I_KOMV OCCURS 0. **** INCLUDE STRUCTURE KOMV. **** DATA: END OF I_KOMV. **** **** **** DATA: BEGIN OF I_KNAS OCCURS 0, **** STCEG LIKE KNAS-STCEG, **** END OF I_KNAS. **** **** DATA: BEGIN OF I_KNA1 OCCURS 0, **** STCEG LIKE KNA1-STCEG, **** END OF I_KNA1. **** *LOOP AT XKOMV WHERE KSCHL EQ 'MWST'. * * *SELECT COUNTRYCODE VATCODE INTO TABLE I_ZVAT FROM ZVAT WHERE * COUNTRYCODE = XKOMV-MWSK1. *ENDLOOP. *ENDFORM. "ZZ_TAX_DETERMINATION_COMPANY * * END OF CHANGES.
RV60AFZZ Form userexit_pricing_prepare_tkomk
Endform MV60AF0V_VBRK_BEARBEITEN LV69AFZZ LV60AA58 1) VAT Registration number of the sold-to-party should always be triggered in invoice – This is satisfied by customization. 2) Domestic Sales: If the VAT-code for tax (MWST) is defined in the Ztable as below, we should use the VAT-registration of sold to party for “Vat Registration of country”
VAT-Code country VAT-registration of country AE AT AT AF AT AT AI AT AT A4 BE BE A5 BE BE AT BE BE RM CH CH RN CH CH RO CH CH A2 DE DE C2 DE DE C3 DE DE D1 DE DE S1 DE DE TU DE DE AA NL NL AB NL NL AC NL NL SN NL NL
1) In the billing check the value of Tax Code (Field MWSK1) for condition type KSCHL = MWST. With this tax code go to Z-Table ZVAT and check whether the tax code is there. If it is then use the VAT Registration number of the sold-to-party in the Country mentioned in Z-Table. Fetch Vat registration number from table KNAS or KNA1 based on the country (LAND1) in Z-Table. If the tax code is not available in the Z-table then proceed as follows 2) Fetch VAT Registration number of sold to party from table KNA1, field STCEG.
Anna screen flow, Sales order change
We have to click on the header details button
In header details, we have on billing tab with in this one we have one tax classification field. Here if they change the taxclassifcation fied, automatically tax code is going to change, tax code will effect in vf01 transaction, now the requirement is we have to change the vatregestration no and central tax field in the vf01 transaction, based on the taxcode, based on the taxcode we have pick the country code, by using countrycode and sold to party no we have to pick the vat registration no, sales no.
like below tax code will change in va02 , but this tax code couldn’t effect in vf01 transaction while creating or changing the billing document vf01,vf02, now we have use the user exit and while entering it self it should display the
vf01 screen after entering the delivery document no
in header details we can find the vat registration no field
In vf01 transaction tax code like below.