Application Development and Automation Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

sumantha_ll_3-1753261496166.png

Enter a name for the formula, e.g., Formula_1, and click Create.

sumantha_ll_4-1753261534625.png

 

Formula Expression is created here we can create formula by two modes Normal mode and Expert mode

sumantha_ll_5-1753261570579.png

 

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.).

sumantha_ll_6-1753261677988.png

sumantha_ll_7-1753261821555.png

 

Add resultant data object

click on result data object click on `Search'
Select required field

sumantha_ll_8-1753261881502.png

sumantha_ll_9-1753261956152.png

sumantha_ll_10-1753261981179.png

 

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

sumantha_ll_11-1753262011820.png

sumantha_ll_12-1753262032043.png

sumantha_ll_13-1753262135993.png

 

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.   

sumantha_ll_14-1753262194636.pngYou should see the calculated Pension Bonus Amount
We get the output

sumantha_ll_15-1753262252214.png

 

 

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.