Concept of Tax Jurisdiction Code
Concept of Tax Jurisdiction Code
Concept of Tax Jurisdiction Code
jurisdiction structure
As we know, each country has a tax procedure. Tax procedure is a list of tax condition types and each condition type
represents a type of tax.
Tax percentage against each tax condition type is maintained in tax code.
Sap handles this requirement by using concept of tax jurisdiction code. Each tax authority is created as a tax
jurisdiction code in sap.
Since tax jurisdiction code is to identify which area or which tax authority is involved in business transaction hence by
looking at tax jurisdiction code you should be able to identify the area.
Hence tax jurisdiction code is created in such a way that it answers below
Which state?
Which county?
Which city?
Which district?
Tax jurisdiction code is composed of codes which represent state/ county/ city/ district.
3 alphanumeric digits representing state
Defining how many characters which represent state, how many characters represent county, how many characters
represent city and how many characters represent district is known as tax jurisdiction structure.
Before creating tax jurisdiction code, tax jurisdiction structure has to be defined in the system.
When document is entered, tax code is input but jurisdiction code is not input. So how does system identify which
jurisdiction code to use?
Note: Tax jurisdiction code is maintained in vendor master, customer master, internal order master, cost center
master, profit center master etc.
Finally I found out that even if you put values in xvbadr, this table is not used for the database update but instead
values in memory are taken to update the database.
To solve this problem, I updated directly the values stored in memory.
Here is the logic:
1- Go to user exit MV45AFZZ-userexit_save_document to write your code
2- Call function 'ADDR_GET_COMPLETE' in order to get the actual values of the address
3- Change the desired values
4- Update the address with function 'ADDR_UPDATE'
Sample of the code:
**Used in address update
DATA: gd_ret_code LIKE szad_field-returncode,
gd_err_tab LIKE addr_error OCCURS 10 WITH HEADER LINE.
**Used to get actual address
DATA: gd_addr1_complete TYPE szadr_addr1_complete,
gd_addr1_tab_line TYPE szadr_addr1_line.
**Used to update actual address
DATA: gd_final_values LIKE addr1_data.
CALL FUNCTION 'ADDR_GET_COMPLETE'
EXPORTING
addrnumber = xvbadr-adrnr
addrhandle = ''
IMPORTING
addr1_complete = gd_addr1_complete
EXCEPTIONS
parameter_error = 1
address_not_exist = 2
internal_error = 3
OTHERS = 4.
READ TABLE gd_addr1_complete-addr1_tab INTO gd_addr1_tab_line
WITH KEY nation = space.
IF sy-subrc EQ 0.
gd_final_values = gd_addr1_tab_line-data.
ENDIF.
**Set jurisdiction code to expected value
gd_final_values-taxjurcode = 'My Tax Code'.
**Update address in memory
CALL FUNCTION 'ADDR_UPDATE'
EXPORTING
address_data = gd_final_values
address_handle = ''
address_number = xvbadr-adrnr
DATE_FROM = '00010101'
LANGUAGE = SY-LANGU
NATION = ' '
CHECK_EMPTY_ADDRESS = 'X'
IMPORTING
address_data = gd_final_values
returncode = gd_ret_code
DATA_HAS_CHANGED =
TABLES
error_table = gd_err_tab
EXCEPTIONS
address_not_exist = 1
parameter_error = 2
version_not_exist = 3
internal_error = 4
OTHERS = 5.
https://archive.sap.com/discussions/thread/489086