Introduction: VAT registration as SAP defines it is: "As part of the process of establishing the European Single Market, the tax authorities in each EU member state assign VAT registration numbers to companies. All companies that are entitled to deduct input tax can receive a VAT registration number.
A VAT registration number is alphanumeric and consists of up to 15 characters. The first two letters indicate the respective member state, for example DE for Germany or ES for Spain.
The VAT registration number is designed to specify the tax processing involved in certain transactions and to allow the financial authorities to monitor the application of the new regulation.
For this reason, the VAT registration number of the company code and that of the customer must be specified on invoices for tax-exempt deliveries and other goods and services within the European Union. The VAT registration number is thus part of the control procedure that has replaced the former border controls (EC sales list).
You can define VAT registration numbers in the system for every customer, company code, and vendor
."
(Ref: https://help.sap.com/saphelp_erp60_sp/helpdata/en/f6/e8d1538cdf4608e10000000a174cb4/content.htm)
In SAP for customer ,vendor, company master data VAT registration number plays a very important role. Hence its accuracy matter for a successful business process. Normally business user or master data team physically validate this VAT registration number from EU's official VIES website [
http://ec.europa.eu/taxation_customs/vies/vieshome.do]
This manual VAT registration number validation process can be automated and reduce the physical involvement of business user to verify the VAT registration number from EU's official VIES website . Some time its really cumbersome exercise for them when they need to validate for high volume of data uploaded from interface.
Technically this validation process can be automated directly with an interface from SAP to European Commission’s VIES application.
In SAP its possible to build an ABAP application consuming the SOAP services offered by European Commission’s VIES website.
Business Benefits:
- Accurate VAT registration number for customer, vendor
- Quality master data
- Error free business transaction
- No manual effort required for validation
- No human error
To automate this VAT registration number validation process we need to develop proxy based interface. This proxy interface will consume the SOAP services officered by European Commission VIES website. The required WSDL file to generate the proxy can be obtained form the below URL:
http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
This proxy method can be invoked in several ABAP application like : Customer Exit for individual validation , Report for mass validation.
STEP-BY-STEP Process:
How to create ABAP proxy for VAT registration number validation?
Step 1: Go to SE80 provide your package.
Note: For POC purpose we have used local package ($tmp). In project appropriate package to be selected.
Step 2: Select ‘Service Consumer’ and click on Cont.
Step 3: Here we are using a WSDL file available in European Commission website. Select third radio button and click on Cont.
Step 4: Select 1
st radio button and click on Cont.
Step 5: Specify the WSDL file created from the URL provided European Commission website.
Step 6: Specify the package and prefix. Prefix is just identifier for the ABAP objects created through wizard. Click on Cont.
Step 7: Now we can see proxy class is generated.
Step 8: Activate all the generated objects.
Step 9: We can see following two methods ‘checkVat’ and ‘checkVatApprox’ created for the proxy class.
Now we should be able to use these methods in our custom application for validating VAT registration number.
How to create logical port for validating VAT registration number?
Step 1: Go to transaction ‘SOAMANAGER’.
Step 2: Select 4
th option ‘Web Service Configuration’
Step 3: Enter object name ‘checkVatPortType’. Created at the time of proxy generation.
Step 4: Click on option ‘Create’ and select WSDL Based Configuration
Step 5: Enter logical port name and description.
Step 6: Select 2
nd radio button via file. Upload the WSDL file created from the URL provided in European Commission website.
Step 7: Now binding get created. Click on next.
Step 8: No user name and password required here. Click on next.
Step 9: Following data automatically gets populated from WSDL file. Click on next.
Step 10: Click on next.
Step 11: Click on next.
Step 12: Click on next.
Step 13: Now you can see the logical port is created.
Step 14: Select ping function and you can see communication is successful and connection established with European Commission website.
Demo Application:
Below is an example of simple application of custom report which validate customer Vat registration number.
We can provide the list of customer for which vat registration number to be validated.
Sample Code:
DATA(gv_proxy ) = ‘ZVATVALCHK’. “ Logical port name
TRY.
DATA(lo_vat_chk) =
NEW zvtco_check_vat_port_type( logical_port_name = gv_proxy ).
***We can use the proxy method ‘check_vat‘ to validate the VAT number.
******* Checks the PROXY output
TRY.
lo_vat_chk->check_vat(
EXPORTING
check_vat_request = VALUE zvtcheck_vat_request(
country_code = <lfs_data>-stceg(2)
vat_number = <lfs_data>-stceg+2
)
IMPORTING
check_vat_response = DATA(ls_response)
).
CATCH cx_ai_system_fault INTO DATA(lo_exc_syst_fault).
" Internal Error
<lfs_data>-statu = text-008.
" VAT not maintained in Customer Master
<lfs_data>-icon = icon_yellow_light.
ENDTRY.
ENDLOOP.
CATCH cx_ai_system_fault.
MESSAGE e000(ckmlwip) INTO DATA(lv_error_msg) ##NEEDED.
" Internal Error. Contact your System administrators!
RAISE EXCEPTION TYPE lcx_exception
EXPORTING
textid = VALUE scx_t100key(
msgid = sy-msgid
msgno = sy-msgno
).
ENDTRY.
References:
https://help.sap.com/saphelp_di46c2/helpdata/EN/e5/07800a4acd11d182b90000e829fbfe/content.htm
http://ec.europa.eu/taxation_customs/vies/faq.html#item_16
http://ec.europa.eu/taxation_customs/vies/faq.html
http://ec.europa.eu/taxation_customs/vies/vatRequest.html