Business Scenario
We want to determine the Pension Bonus Amount based on:
Employee Service Years
Pension Bonus Base Amount
The formula might look like:
Pension Bonus Amount = Pension Bonus Base Amount x Service Years
Step-by-Step: Creating the Formula Expression in BRF+
Step 1: Create a Formula Expression
Navigate to your BRF+ Application.
Click on Create -> Expression -> Formula.
Enter a name for the formula, e.g., Formula_1, and click Create.
Formula Expression is created here we can create formula by two modes Normal mode and Expert mode
Normal Mode and Expert Mode
Normal Mode
User-Friendly Interface: Designed for users who prefer a simplified, guided way of creating formulas.
Predefined Options: You select from predefined functions, operators, and variables.
Limited Flexibility: Less control over complex logic; suitable for straightforward formulas.
Use Case: Ideal for users who want to quickly create formulas without delving into intricate details or custom logic.
Expert Mode
Advanced Features: Offers a more powerful and flexible environment.
Direct Formula Editing: You can directly write and edit the formula expressions, often in a text-based way.
Greater Control: Supports complex logic, nested functions, and custom expressions.
Customization: Allows more detailed and precise formula definitions.
Use Case: Suitable for advanced users or scenarios requiring complex logic that cannot be easily achieved in normal mode.
Step 2: Define Data Elements (Mass Creation)
We need to define three key data elements:
Pension Bonus Amount (Result)
Pension Bonus Base Amount
Service Years
To create these:
Go to Application -> Create -> Data Object -> Element (Mass Creation).
Define each required element with the appropriate data type (e.g., Amount, Integer, etc.).
Add resultant data object
click on result data object click on `Search'
Select required field
Step 3: Build the Formula
Place your cursor after the | next to the Result Data Object.
Click on Insert Data Object and select:
Pension Bonus Base Amount and Service Years
Step 4: Test the Expression (Simulation)
Click Start Simulation.
Enter test values for:
Pension Bonus Base Amount (e.g., 300)
Service Years (e.g., 10)
Click Execute.
You should see the calculated Pension Bonus Amount
We get the output
Conclusion
Formula Expressions in BRF+ are a powerful tool for creating dynamic business rules and performing calculations using business context data. With both Normal and Expert modes available, users at any skill level can build and manage rules effectively—often without needing to write custom ABAP code.
In our example, we used a Formula Expression to calculate the Pension Bonus Amount based on an employee’s years of service and a base bonus value—something commonly needed in HR and payroll systems.