How to Create a Decision Tree in BRF+
1. Introduction
The Business Rule Framework Plus (BRF+) in SAP allows business users and developers to define and maintain business rules without extensive ABAP coding.
A Decision Tree is a graphical way of modeling conditional logic where each branch represents a decision point.
This manual explains how to create and test a Decision Tree in BRF+.
2. Launch BRF+ Workbench
Open SAP GUI.
Enter Transaction Code: BRF+ (or BRFPLUS).
The BRF+ Workbench opens in a browser-based window.
3. Create an Application
In the Workarea, select Create → Application.
Enter details such as:
Application Name: Z_DEMO_APP
Description: Demo application for decision tree
Package: $TMP (for local) or assign to a transport request
Save the application.
4. Create a Function
Inside the application, right-click and choose Create → Function.
Maintain the following:
Name: Z_DECISION_TREE_FUNC
Mode: Event Mode
Save the function.
5. Create a Decision Tree Object
Right-click on the function.
Select Create → Expression → Decision Tree.
Provide details:
Name: Z_DECISION_TREE
Description: Example for discount calculation
Save the object.
6. Define Input and Output Data Objects
Create input data objects for decision making, for example:
Order_Type (Data Type: CHAR)
Customer_Category (Data Type: CHAR)
Define an output object to hold the decision result, for example:
Discount_Value (Data Type: NUMC).
7. Model the Decision Tree Logic
Open the Decision Tree in the graphical editor.
Add branches and maintain conditions:
IF Order_Type = ‘ONLINE’ → Assign Discount_Value = 10.
IF Order_Type = ‘RETAIL’ → Assign Discount_Value = 5.
ELSE → Assign Discount_Value = 0.
Save and activate the decision tree.
8. Test the Decision Tree
Right-click on the decision tree and choose Test.
Enter test values, for example:
Order_Type = ONLINE
Customer_Category = GOLD
Execute and verify the result returned in Discount_Value.
9. Conclusion
We have successfully created a Decision Tree in BRF+.
This object can now be used in business functions to replace hard-coded logic, making it easier to maintain and update rules without changing ABAP code.
For complex business rules, you may also explore Decision Tables or Formulas in BRF+.
How to Create a Decision Tree in BRF+1. IntroductionThe Business Rule Framework Plus (BRF+) in SAP allows business users and developers to define and maintain business rules without extensive ABAP coding.A Decision Tree is a graphical way of modeling conditional logic where each branch represents a decision point.This manual explains how to create and test a Decision Tree in BRF+.2. Launch BRF+ WorkbenchOpen SAP GUI.Enter Transaction Code: BRF+ (or BRFPLUS).The BRF+ Workbench opens in a browser-based window.3. Create an ApplicationIn the Workarea, select Create → Application.Enter details such as:Application Name: Z_DEMO_APPDescription: Demo application for decision treePackage: $TMP (for local) or assign to a transport requestSave the application.4. Create a FunctionInside the application, right-click and choose Create → Function.Maintain the following:Name: Z_DECISION_TREE_FUNCMode: Event ModeSave the function.5. Create a Decision Tree ObjectRight-click on the function.Select Create → Expression → Decision Tree.Provide details:Name: Z_DECISION_TREEDescription: Example for discount calculationSave the object.6. Define Input and Output Data ObjectsCreate input data objects for decision making, for example:Order_Type (Data Type: CHAR)Customer_Category (Data Type: CHAR)Define an output object to hold the decision result, for example:Discount_Value (Data Type: NUMC).7. Model the Decision Tree LogicOpen the Decision Tree in the graphical editor.Add branches and maintain conditions:IF Order_Type = ‘ONLINE’ → Assign Discount_Value = 10.IF Order_Type = ‘RETAIL’ → Assign Discount_Value = 5.ELSE → Assign Discount_Value = 0.Save and activate the decision tree.8. Test the Decision TreeRight-click on the decision tree and choose Test.Enter test values, for example:Order_Type = ONLINECustomer_Category = GOLDExecute and verify the result returned in Discount_Value.9. ConclusionWe have successfully created a Decision Tree in BRF+.This object can now be used in business functions to replace hard-coded logic, making it easier to maintain and update rules without changing ABAP code.For complex business rules, you may also explore Decision Tables or Formulas in BRF+. Read More Application Development and Automation Blog Posts articles
#SAP