Validate a tax number

This page describes a sample business scenario for validating tax numbers and how to do such an extension on SAP S/4HANA Cloud.

Sample Scenario

You wish to validate the format of the Tax Identification Number (TIN) for a country, on the SAP S/4HANA Cloud system and display a message in case of an error.

To do so, you need to implement a logic to validate the tax number and create a repository to store custom messages for validation results. The system provides a Business Add-In (BAdI) that can be used to implement the validation check of the TIN.

Note: Information provided in this document is as per features available in SAP S/4HANA Cloud release 1905. There might be variations to screen and field names in other release versions.

Prerequisites

  • You have administrative access to SAP S/4HANA Cloud.
  • You have implementation experience on SAP S/4HANA Cloud.
  • You have coding experience, since this extensibility solution requires implementation of a coding logic.

Authorizations

Implementation of the Extension

Implement Validation Logic using a BAdI

SAP S/4HANA Cloud Launchpad - > Custom Fields and Logic app.

  1. Create a New Enhancement Implementation using the Custom Logic option in the Custom Fields and Logic app.
  2. Write the implementation logic for the tax validation in the Draft Logic area and publish the New Enhancement Implementation.

    • Note: Enter a solution specific to the purpose of this implementation in the code logic. This is required because the BAdI does not have an option to set a filter for this purpose.

Create a Repository to Store Custom Messages

  1. Navigate to the Custom Reusable Elements app on SAP S/4HANA Cloud Launchpad.
  2. Create a New Code List using Custom Code List.
  3. Specify the translation language and enter the translated text for the custom messages, if translation is relevant for your implementation.

    • Note: The system does not translate the message. You must manually enter the translated text for the message in the language in which, the system must display the message. For example, if the translated text is to be in German, enter the translated message in German.
  4. Publish the custom code list.

Test the BAdI Implementation

  1. Navigate to the Manage Customer Master Data app on the SAP S/4HANA Cloud Launchpad.
  2. Open Customer List in edit mode and select a Customer.
  3. Add a new tax number. If the new tax number is saved in an incorrect format, the system should display the relevant error message.