MDG Derivation (BRF+)

 In this blog, we will see how to derive some attribute based on another attribute in SAP MDG using the BRF+ application. 

So here, we are going to derive language based on country. If the user selects the country as India, then the language field should derive with the value English. 

In the BRF+ application, we can only do single entity derivations. It means that both derived fields and driven fields should be from the same entity.

Steps:

1. Go to USMD_RULE t-code OR MDGIMG -> General Settings -> Data Quality and Search -> Validation and Enrichments -> Define Validation and Derivation Rules. 


2. Enter BP and Continue. Right click on the Derivation node and create function using following path.


3. Give details like below.



4. The naming convention for creating function is 'DERIVE_<Entity Type>'As we are doing derivation on Entity 'AD_POSTAL' we will give this entity name. We should follow this naming convention strictly or else our derivation will not work. Click on 'Create and Navigate to Object' button which takes us inside function.



5. Click on Add Existing Data Object button. Search like below.


6. Select type structure -> Physical address (AD_POSTAL).



7. Go to Assigned Rulesets tab.



8. Create Ruleset.



9. Click on Create and Navigate to Object button.



10. Click on Insert Rule and Select Create.



11. Give description and Click on Assign Condition. Now, we want to Derive the Language based on country key. So, in if condition we have to write like IF Country = IN then Language = EN. For that give Country Attribute in If Condition as below. 



12. Search like below and select Country attribute.



13. After that, in Then condition we have to change the value of Language field as EN. For that give Language attribute in Then condition and assign value as EN.


14.After that, save, check, activate the ruleset as well as function. Now test it on MDG UI.




Comments

Popular posts from this blog

SAP MDG Process Modelling

MDG Derivation (BADI)

MDG Validation (Using BADI)