SAP TAX_NUMBER_CHECK Function Module for Check Tax Numbers
TAX_NUMBER_CHECK is a standard tax number check SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Check Tax Numbers processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for tax number check FM, simply by entering the name TAX_NUMBER_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: TSRV
Program Name: SAPLTSRV
Main Program: SAPLTSRV
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function TAX_NUMBER_CHECK pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'TAX_NUMBER_CHECK'"Check Tax Numbers.
EXPORTING
COUNTRY = "
* TAX_CODE_5 = ' ' "
* NATURAL_PERSON_FLAG = 'X' "Natural Person
* REGION = ' ' "
* STKZU = ' ' "
* TAX_CODE_1 = ' ' "Tax Number 1
* TAX_CODE_2 = ' ' "Tax Number 2
* TYPE_OF_TAX_CODE_1 = ' ' "Tax Number Type
* TAX_CODE_3 = ' ' "Tax Number 3
* TAX_CODE_4 = ' ' "Tax Number 4
EXCEPTIONS
NOT_VALID = 1 DIFFERENT_FPRCD = 2
IMPORTING Parameters details for TAX_NUMBER_CHECK
COUNTRY -
Data type: SADR-LAND1Optional: No
Call by Reference: No ( called with pass by value option)
TAX_CODE_5 -
Data type: TAXNUM5Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NATURAL_PERSON_FLAG - Natural Person
Data type: KNA1_BF-STKZNDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
REGION -
Data type: SADR-REGIODefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
STKZU -
Data type: KNA1_BF-STKZUDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TAX_CODE_1 - Tax Number 1
Data type: KNA1_BF-STCD1Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TAX_CODE_2 - Tax Number 2
Data type: KNA1_BF-STCD2Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TYPE_OF_TAX_CODE_1 - Tax Number Type
Data type: KNA1_BF-STCD_TYPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TAX_CODE_3 - Tax Number 3
Data type: STCD3Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TAX_CODE_4 - Tax Number 4
Data type: STCD4Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_VALID - Check Unsuccessful
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DIFFERENT_FPRCD - Different Provincial Tax Codes in STCD1 and STCD2
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for TAX_NUMBER_CHECK Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.DATA: | ||||
lv_country | TYPE SADR-LAND1, " | |||
lv_not_valid | TYPE SADR, " | |||
lv_tax_code_5 | TYPE TAXNUM5, " SPACE | |||
lv_different_fprcd | TYPE TAXNUM5, " | |||
lv_natural_person_flag | TYPE KNA1_BF-STKZN, " 'X' | |||
lv_region | TYPE SADR-REGIO, " SPACE | |||
lv_stkzu | TYPE KNA1_BF-STKZU, " SPACE | |||
lv_tax_code_1 | TYPE KNA1_BF-STCD1, " SPACE | |||
lv_tax_code_2 | TYPE KNA1_BF-STCD2, " SPACE | |||
lv_type_of_tax_code_1 | TYPE KNA1_BF-STCD_TYP, " SPACE | |||
lv_tax_code_3 | TYPE STCD3, " SPACE | |||
lv_tax_code_4 | TYPE STCD4. " SPACE |
  CALL FUNCTION 'TAX_NUMBER_CHECK' "Check Tax Numbers |
EXPORTING | ||
COUNTRY | = lv_country | |
TAX_CODE_5 | = lv_tax_code_5 | |
NATURAL_PERSON_FLAG | = lv_natural_person_flag | |
REGION | = lv_region | |
STKZU | = lv_stkzu | |
TAX_CODE_1 | = lv_tax_code_1 | |
TAX_CODE_2 | = lv_tax_code_2 | |
TYPE_OF_TAX_CODE_1 | = lv_type_of_tax_code_1 | |
TAX_CODE_3 | = lv_tax_code_3 | |
TAX_CODE_4 | = lv_tax_code_4 | |
EXCEPTIONS | ||
NOT_VALID = 1 | ||
DIFFERENT_FPRCD = 2 | ||
. " TAX_NUMBER_CHECK |
ABAP code using 7.40 inline data declarations to call FM TAX_NUMBER_CHECK
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8."SELECT single LAND1 FROM SADR INTO @DATA(ld_country). | ||||
DATA(ld_tax_code_5) | = ' '. | |||
"SELECT single STKZN FROM KNA1_BF INTO @DATA(ld_natural_person_flag). | ||||
DATA(ld_natural_person_flag) | = 'X'. | |||
"SELECT single REGIO FROM SADR INTO @DATA(ld_region). | ||||
DATA(ld_region) | = ' '. | |||
"SELECT single STKZU FROM KNA1_BF INTO @DATA(ld_stkzu). | ||||
DATA(ld_stkzu) | = ' '. | |||
"SELECT single STCD1 FROM KNA1_BF INTO @DATA(ld_tax_code_1). | ||||
DATA(ld_tax_code_1) | = ' '. | |||
"SELECT single STCD2 FROM KNA1_BF INTO @DATA(ld_tax_code_2). | ||||
DATA(ld_tax_code_2) | = ' '. | |||
"SELECT single STCD_TYP FROM KNA1_BF INTO @DATA(ld_type_of_tax_code_1). | ||||
DATA(ld_type_of_tax_code_1) | = ' '. | |||
DATA(ld_tax_code_3) | = ' '. | |||
DATA(ld_tax_code_4) | = ' '. | |||
Search for further information about these or an SAP related objects