SAP Knowledge Base Article - Public

2727036 - "Tax number is invalid" - Error When Replicating Business Partners for Country Spain


You replicate Business Partners from SAP ERP/S4H to SAP Cloud for Customer (C4C) where the Business Partner's Tax Number Category Code belongs to Spain (ES). The message leaves the ERP/S4H system, but fails with the below error in C4C: "Tax number is invalid".


SAP Cloud for Customer




Reproducing the Issue

  1. Go to Web Service Message Monitoring under Administrator Work center.
  2. Search for the Message ID and BusinessPartnerERPReplicationIn Service Interface.
  3. Message failed with "Tax number is invalid" error.
  4. Open the Payload
  5. Check the <TaxNumber> node.


The issue can be caused by the following 2 scenarios:

  1. NIF (Fiscal Identity Number) is not valid. The fiscal identification number for a Spanish person/company would be their DNI plus a letter, or a letter, seven digits and a check letter for the rest of individuals. For more details about the NIF, please, you may check the following site (it is in Spanish): Information about 'NIF de personas fisicas' on site of 'agenciatributaria'. The law that explains the composition of the NIF is Real Decreto 338/1990, article 2.

  2. NIE (Foreign Identity Number) is being sent as ES1. S4HANA and ECC supports NIF and NIE in the same field, ES1 and STCD1 respectively. In C4C, the behavior is different, as it uses a different TaxIdentificationNumberTypeCode for NIE. If you are sending a NIE as Party Tax ID you should use ES3 instead of ES1. On the C4C Payload it should be:

  <TaxNumber actionCode="04">
  <PartyTaxID schemeID=" ">X0245313H</PartyTaxID>


Below follows the correction for causes 1 and 2:

  1. To correct the issue, you should fill the field <PartyTaxID> with a valid NIF.

  2. In order to fix the issue, you can manually maintain these entries in SM30, using V_TFKTAXNUMTYPE  for the required country in S4H/ERP.

In case, you are using S4HC, you need to create a new custom tax number type for Spain in the Tax Number Type fine tuning in C4C Business Configuration. Map this new tax number type to ES1 in ERP/S4 and set the ES1+ES3 to inactive in C4C.

See Also

2021660 - Missing tax number categories in note 775919

163554 - Tax number checks - general


Tax number is invalid, Spain, Tax number , KBA , LOD-CRM-INT-ERP , Integration of C4C with ERP , How To


SAP Cloud for Customer add-ins all versions