Skip to Content
Product Information
Author's profile photo Stephen Ward

Example of how to add a Validation with the Business Partner Master Data BADI in S/4HANA Cloud

***Image/data in this Blog is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.***

Hello SAP S/4HANA Cloud Community,

Introduction:

I work on the LO-MD-BP component for SAP S/4HANA Cloud and I wanted to share some information with our community around BADIs. While this blog is specifically aimed at Customer/Supplier Business Partner Master Data area the steps could also be useful to other areas. In the Customer/Supplier Business Partner Master Data area we have three BADIs (see this blog for information on these BADIs: Business Partner (Customer / Supplier) Master Data BADIs in S/4HANA Cloud )

In this blog, I will show a simple example of how to write a validation on the Authorisation Group field for the Business Partner Master. Much more complex validations can be written but I have written and tested a simple validation for the purpose of this blog. ***Disclaimer, the code which is written in the screenshot below is intended for demonstration purposes only.

The Steps:

1. Open the Custom Fields and Logic App (F1481)
2. Open the “Custom Logic” section and press the create symbol ‘+’
3. Choose the Business Context and BADI give it an Implementation Description and press create
Badi.png

4. On the next screen, you will be able to write your validation code, once you are happy with your code you can Test and Publish it.

Code.png
5. We will now test this line of validation code by trying to create a Business Partner while leaving the Authorisation Group field blank.
Error.png

6. Once the Authorisation Group is entered the error is no longer raised.
Entered.png

Information on Additional Related Blogs:

For the General SAP Help Portal documentation on Extensibility & Custom Fields and Logic see:
Extensibility: https://help.sap.com/viewer/f544846954f24b9183eddadcc41bdc3b/latest/en-US/3ccb50e724b045508fea8b2cf1774b2b.html

Custom Fields and Logic https://help.sap.com/viewer/f544846954f24b9183eddadcc41bdc3b/latest/en-US/57909455bf7c4fdd8bcf48d76c1eae33.html

For information on Customer / Supplier Business Partner Master Data: Authorization Groups see this blog:
Customer / Supplier Business Partner Master Data: Authorization Groups

The example in this blog is intended for explanation purposes.

Kind Regards,
Stephen Ward
SAP Product Support

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sandeep Kumar
      Sandeep Kumar

      Stephen Ward very useful, thanks for putting this together.

      Author's profile photo Priyank Kumar Jain
      Priyank Kumar Jain

      Thank you. It's quite useful.

      Author's profile photo Sai Giridhar Kasturi
      Sai Giridhar Kasturi

      thanks for sharing.

      Author's profile photo Vijayendra Tiwari
      Vijayendra Tiwari

      Good one Stephen!

      Author's profile photo Katalin Csengodi
      Katalin Csengodi

      That is clearly shown Stephen, great blog!

      Author's profile photo Ashita Dutta
      Ashita Dutta

      How can I add Validation in Supplier tab

      Author's profile photo Stephen Ward
      Stephen Ward
      Blog Post Author

      Hello Ashita Dutta,

      You can use the BADI called CMD_VALIDATE_SUPPLIER, see the blog Business Partner (Customer / Supplier) Master Data BADIs in S/4HANA Cloud for information on the three available Business Partner BADIs currently available in SAP S/4HANA Cloud.

      Kind Regards,
      Stephen