Skip to Content
Technical Articles
Author's profile photo Andreas Seifried

How to create and use data quality rules with SAP Master Data Governance on SAP S/4HANA 1809 (Part 1)

This blog provides you with a step-by-step instruction how to quickly get started with master data quality management for products in SAP Master Data Governance on SAP S/4HANA 1809. I’ve split the end-to-end description into 4 parts:

  1. Creating and implementing a data quality rule
  2. Evaluating data quality rules
  3. Analyzing evaluation results
  4. Using data quality scores

For an introduction to the functionality, see my blog Master Data Quality Management with SAP Master Data Governance on SAP S/4HANA 1809.

Furthermore, you might find this blog helpful to get an overview: Getting started with master data quality management for products using SAP Master Data Governance on SAP S/4HANA 1809. You also find the prerequisites in this blog.

The relevant online help (aka Product Assistance) is available here: http://help.sap.com/s4hana then navigate to Product Assistance => Cross Components => Master Data Governance. See the respective sections on Rule Management and Quality Evaluation beneath the nodes Configuration of MDG, Data Quality Management and Working with MDG, Data Quality Management.

Now, let’s get started with the first part…

Part 1 – Creating and implementing a data quality rule

The Example Rule

The example rule to implement is:

The field Division (MARA-SPART) must be filled
for all products of type finished goods (MARA-MTART = FERT)
that also have a product number starting with ZDEMO (MARA-MATNR = ZDEMO*)

Rule Condition

We call the first part of the rule “The field Division (MARA-SPART) must be filled” the rule condition. This is the actual check of the rule and the system shall report whether products comply with this rule or violate this rule. When the rule is evaluated, the rule condition determines the outcome of either OK or Not OK.

Rule Scope

The second part of the rule “for all products of type finished goods (MARA-MTART = FERT) that also have a product number starting with ZDEMO (MARA-MATNR = ZDEMO*)” is called the rule scope. The scope defines to which products master data the rule shall be applied. For all product data in the scope of the rule, the condition is evaluated and the evaluation of the rule produces the outcome of either OK or Not OK. For all product data that is not in the scope of the rule, the outcome is undefined.

Create the data quality rule

  1. Go to the tile group Master Data Quality Evaluation for Products and launch the app Manage Data Quality Rules – Products.
  2. The app presents a list with all existing data quality rules. Use the add button to create a new rule.
  3. Enter a name of the rule and an ID for the rule. The field Checked Field is used to document which field is subject to the rule. This information is for documentation purposes only. Click on the value help of the field Checked Field.
  4. In the select dialog, use the value help for Table to select Basic Data (MARA).
  5. Then enter SPART in Field Name and hit the enter key or click on Go. Click on the row for MARA-SPART.
  6. Fill the remaining fields of the rule, do not enter anything in Base Table for the moment. All fields are descriptive only and are irrelevant to the evaluation of the rule by the system. Click on Save when you are done.
  7. The rule is now save in status New. In this simple example we do not use other statuses than New or Active. We do not use different user or roles in the creation process either.

Implement the data quality rule using BRFplus

  1. The next step is to implement the expression of the rule. Go to the section Implementation and click on Create Expressions.
  2. The field Base Table is an important property of the rule. Semantically, Base Table defines on which level of the information hierarchy of a product the rule will be applied.
    Example 1: If Basic Data (MARA) is used, the rule will be applied to Basic Data of a product only. Consequently, there is only one outcome of this rule for a product.
    Example 2: If Plant Data (MARC) is used, the rule will be applied to the data of every plant of a product. Here, there is an outcome of the rule for each plant for which the product is available.
  3. Choose Basic Data (MARA), then click on Create Expressions. Remark: the system will be busy for a few seconds to prepare the expressions.
  4. Once completed, the app will display links to the Scope Expression and to the Condition Expression. The status of both expressions is initial.
    The Scope Expression is used by the system to determine if a product (or parts of a product as specified by Base Table) is in the scope of the rule and therefore checked with the Condition Expression. The condition expression determines the outcome of either OK or Not OK.
    If the data is not in the scope of the rule, no outcome is provided.
    Click on the link of the Scope Expression.
  5. The BRFplus workbench is launched and an initial expression displayed. The expression needs to be adapted to the desired scope of the rule.
    Example scope: … for all products of type finished goods (MARA-MTART = FERT) that also have a product number starting with ZDEMO (MARA-MATNR = ZDEMO*)
  6. First, the operand need to be changed to material type. Choose Edit Operand => Use Direct Value Range From… => Context => Material type
  7. Now, use the value help of the right-hand side operand.
  8. Choose FERT for Finished Product.
  9. The first part of the scope is now implemented. The second part, the check for the product number, is still missing.
  10. Choose Template => <1> and <2>.
    Note: This is only one of the possible solutions…
  11. Select the operand for the second part of the If expression, by choosing: Not assigned => Use Direct Value Range From… => Context => Source ID.
    Note: For products, the product number is available in the field Source ID only!
  12. Choose starts with text as the operator.
  13. Then enter your prefix in the field of the right-hand side operand.
  14. Finally, the expression should read like this:
    If Material type is equal to FERT
    and Source ID starts with text ZDEMO
    Then Boolean is true, else it is false.
    Meaning that if this condition is fulfilled, the product is in the scope of the rule, otherwise it is not in the scope.Choose Save.
    Then, choose Activate.
    Finally click on Back to return to the data quality rule.
  15. Note that the status of the scope expression was updated.
    Click on the link of the Condition Expression.
  16. In the BRFplus workbench, change the operand of the initial expression by choosing Edit Operand => Use Direct Value Range From… => Context => More … .
  17. Enter Division in the field Text and search. Select Division.
  18. Change the operator to is not initial.
  19. The resulting expression should read like this:
    If Division is not initial
    Then Boolean is true, else it is false.Meaning the outcome of the rule is OK if Division is filled and Not OK otherwise.
    Click on Activate.
    Finally click on Back to return to the data quality rule.
  20. Note that the status of the Condition Expression is Active.
  21. As a last action, click on Activate to switch the status of the rule to Active. From now on, the rule is considered in data quality evaluations.

Follow me

After having completed these steps you have a data quality rule that is ready for evaluation. See the next part of this series to see how this is done.

Click on Follow at the top of this page to get informed when the next part is posted.

 

Assigned Tags

      18 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Andreas Seifried
      Andreas Seifried
      Blog Post Author

      part 2 is published:

      https://blogs.sap.com/2018/10/23/how-to-create-and-use-data-quality-rules-with-sap-master-data-governance-on-sap-s4hana-1809-part-2/ 

      Author's profile photo Francisco Gaitan
      Francisco Gaitan

      Hello, it works in the same way when MDG is installed in SAP HANA (not S/4HANA) and we are using SLT to replicate to SAP ERP?

      Thank you.

       

       

      Author's profile photo Andreas Seifried
      Andreas Seifried
      Blog Post Author

      Hi Francisco,

      this functionality is only available in MDG on S/4HANA - it is not possible to use it on ECC. You cannot install MDG on a pure database, like SAP HANA.

      Kind regards

      Andreas

      Author's profile photo Francisco Gaitan
      Francisco Gaitan

      Thank you,

      Author's profile photo Antonio Guzman Trigueros
      Antonio Guzman Trigueros

      Helo Andreas

      I'm working in system version S/4 – 1909. In my case i don’t see the button Create Expression for implement the Data Quality rule

      Also, when I put the rule owner or implementation Expert I have issue “<user> cannot be set”

      Could you help me?

      Regards

       

      Author's profile photo Andreas Seifried
      Andreas Seifried
      Blog Post Author

      Hi Antonio,

      since you are on 1909, please make sure that you are using the correct app version. Check the documentation for that:

      How to Get Master Data Governance Running --> Rule Management

      https://help.sap.com/viewer/6d52de87aa0d4fb6a90924720a5b0549/1909.001/en-US/2435a77764ed400da5a57f5fec3a11cb.html

      If everything is correctly set up, please use support.sap.com to report an incident.

      Thanks and kind regards

      Andreas

      Author's profile photo Michael Calmer Schmidt
      Michael Calmer Schmidt

      Hi Andreas,

      Is it possible to create a rule checking across 2 tables? For example checking email in ADR6 linked with BUT000 for the BP ID.

      We are running 1909

      Best regards

      Michael

      Author's profile photo Andreas Seifried
      Andreas Seifried
      Blog Post Author

      Hi Micheal,

      yes, it is. For example, "A business partner of type person, must have an e-mail address".

      Kind regards
      Andreas

      Author's profile photo Michael Calmer Schmidt
      Michael Calmer Schmidt

      Hi Andreas,

      Thank you for the quick answer. Do you have link to a guide on how that would be done? The examples I have been able to find are all for one table e.g. Search Term 1 & 2.

      Best regards

      Michael

      Author's profile photo Andreas Seifried
      Andreas Seifried
      Blog Post Author

      Hi Michael,

      there is a guide in our collection of How-to papers. It is written using material as the example, but I think you are capable of doing the transfer to the business partner domain by yourself.

      MDG Community -> How-to Guides -> Data Quality Management -> Creating Data Quality Rules and Triggering Data Quality Evaluations

      Ii also explained the concept in the session Deep dive – Master data quality management with SAP Master Data Governance (recording). you can access the contents from SAP Community Call series  SAP Master Data Governance on S/4HANA.

      Best regards
      Andreas

      Author's profile photo EY Functional3
      EY Functional3

      i want to enable Data quality rule for mass processing and consolidation but I am getting option in usage tab, there are only two option for change request and evaluation please help

       

      Author's profile photo Mallika Shaik
      Mallika Shaik

      Hi Andreas Seifried

      I trying to follow same process as per the above blog, in between it is struck and not able to do the implementation  as per the below screenshot
      There is not button to create the implementation.

      Please let me know your inputs on this.

      Thanks in advance.

       

      Author's profile photo Demostenes Segundo
      Demostenes Segundo

      Hello Mallika,

       

      I am facing the same issue.

      I believe that we don't get the button to create "Expression", because we are missing having BRF+ installed, in the system. But I still have to do more research on this.

      Author's profile photo Andreas Seifried
      Andreas Seifried
      Blog Post Author

      Please check the assignment of authorizations to your user as described in the documentation on help.sap.com/mdg. Thanks!

      Author's profile photo Ravikiran Puchalapalli
      Ravikiran Puchalapalli

      Helo Andreas

      I'm working in system version S/4 – 2020. In my case - in the Usage section of 'Data Quality Rules' I add the usage 'Data Quality Evaluation' and status of the usage comes out as 'Not Ready'. Does it require any pre-configuration in the system?

       

       

      Also, In rule owner or implementation Expert search help - I can find any users - does it require separate users to be set up? Doesn't use standard SAP user master user ids?

      Could you help me?

      Regards

      Author's profile photo Andreas Seifried
      Andreas Seifried
      Blog Post Author

      You need to "prepare" the implementation. There should be the action "Prepare" displayed on the UI. If this is not the case, please check the assignment of authorizations to your user as described in the documentation on help.sap.com/mdg. Thanks!

      Author's profile photo Ecem Dokgoz
      Ecem Dokgoz

      Hi, we are using Master Data Quality for EAM 2021 extention by Utopia. We have successfully implement it but we can't find Rule Owner and Implementation Expert roles. Could you please help us?

      rule%20owner

      Author's profile photo Sabine Stellmacher
      Sabine Stellmacher

      Hi, the value help for the implementation expert shows all users that have the authorization object MDQRM_RULE with activity 64 (Generate) or activity * assigned.

      The value help for the rule owner shows all users that have the authorization object MDQRM_RULE with one of the following activities assigned:

      01 Create
      02 Change
      03 Display
      06 Delete
      49 Request
      63 Activate (Obsolete)
      64 Generate
      98 Mark for Release
      H1 Deactivate
      *

      Documentation of the authorization object see here.

      With this approach we want to ensure that the list of users offered in the value help as rule owner or implementation expert is meaningful. Note, that there is no check that only the user entered as rule owner/implementation expert can work on a specific rule. These fields are for information.

      Sabine (Product Management MDG DQM)