With the help of BRFplus or BRF+ (SAP Business Rule Framework plus), complex business rules can be mapped in SAP without programming knowledge. Users can flexibly maintain the business rules in different formats that best suit their requirements. The framework can be used universally – in an SAP ERP system, in SAP S/4HANA or in SAP MDG. In another blog post, we have looked at BRFplus from a business perspective. Below, we take a closer look at the technical implementation of BRFplus.
Structure of BRFplus
The BRFplus interface is divided into three areas:
The following components are required to create business rules:
An application in which all business rules are stored.
A function that serves as the main component and in which input and output parameters are defined
A rule set for the individual business rules
If necessary, expressions such as:
a decision table, in which the business rules can also be mapped in bundles
a formula for performing calculations or time determinations
database queries to extract information quickly and easily from SAP tables
loops to check and process table entries line by line
A data object that has a reference to a data dictionary object
After all objects have been created, the navigation section may look like the following:
We are in the transaction “brf+”. First we create a new application including a description and a development package.
Via “Create And Navigate To Object” you immediately get to the created object. In addition, the objects can be called up via the navigation bar. All objects must be activated, if they are ready for use. This is done via the “Activate” button. Next, a function is created.
Again, “Create And Navigate To Object” is used to get to the desired object. If desired, additional data objects can be included to serve as input and output parameters. A rule set is now created in this function. This is done in the function via the “Assigned rulesets” tab.
The rules are created in the ruleset. Example rules may look like the following:
- If Country = “DE” and Street empty = Error “Check street, field must not be empty”.
- If type = “Person” and date of birth empty = error “Check date of birth, field must not be empty”.
- If entry date > current date = error “entry date is in the future”.
Rules can be implemented and checked in several ways:
Creating a rule in the rule set
Creation of an entry in a decision table followed by a check in the rule set
Generation of the BRFplus function
After all the information has been mapped into BRFplus, the function code must be generated and implemented in the desired location.
Implementation in BDT
In our example, we implement the BRFplus function in the Business Data Toolset (BDT). The BDT is a central tool for maintaining master data and simple transaction data. When pressing the “Save” button, the corresponding functionality is executed.
Communication between BRF+ and SAP
BRFplus can be used universally and is not bound to a specific SAP system (SAP S/4HANA, SAP ERP, SAP MDG). Using the BDT as an example, the Save button is executed. When pressing Save, a module is interposed to execute the BRFplus functionality. In the BRFplus application, all data is validated and the validated data is returned to the module.