Saturday 3 October 2020

Introduction to SAP BRF+/BRFplus & why is it so popular in SAP World !!

Introduction:

◉ BRF+ stands for Business Rule Framework Plus which provides a comprehensive application programming interface and user interface for defining business rules

◉ It enables you to define business rules without the need of wiring ABAP code.

◉ The generated Business Rules can be incorporated into other SAP programs or Substitution/Validation rules.

◉ BRF+ is not new and even not directly related to SAP S/4HANA, but with the release of SAP S/4HANA 1610, BRF+ gained more attention since it is launched as the go-to solution for some business processes. The most important ones are the changes in output management for Billing and Purchasing.

◉ It is a part of SAP NetWeaver ABAP stack.

◉ The t-code used is BRF+ or BRFplus.

What is the Significance of BRF+ ? 

◉ Before BRF+ came into existence , still the business was running right ? .

◉ So , It is very much important to understand how it was handled earlier , before we get into SAP BRF+/BRFplus.

◉ The following below are the approaches followed when SAP BRF+ was not into existence or when the developer was not aware of SAP BRF+/BRFplus.

1. Lets say you want to add a condition based on the particular Company Code(BUKRS) & Sales Organization(VKORG) and execute some functionality , this was achieved by simply doing the hardcoding in IF ELSE condition & achieve the functionality to work for a particular Company Code & Sales Organization – & this was handled in program itself , which is the traditional approach.

2. The above approach was little bit difficult – if any changes come in future , as it was time consuming for the developer to do analysis first & do the changes – if the change was done at multiple places . So, the second approach & the little bit better approach which was used to follow is to maintain the Company Code(BUKRS) & Sales Organization(VKORG) in the Customized Table(Z/Y table) and fetch the corresponding value maintained from the Customized Table.

3. The third approach what SAP suggested is to maintain the hardcoded values using table TVARVC and the associated transaction to store parameter data and based on parameter data stored in TVARVC validation was done for a particular Company Code(BUKRS) & Sales Organization(VKORG) and corresponding value was fetched.

So ,even in some standard application or programs SAP is still following the above approaches. But , now SAP is thinking to overcome the approaches mentioned above , by the framework which is known as SAP BRF+/BRFplus.

At least with evolution of SAP S/4HANA , BRF+ has got more prominence and SAP has already started using BRF+ in some standard applications for decision making purpose.

Therefore , BRF+ has not got more prominence & is used to avoid hardcoding and maintain those in the decision tables in order to fetch the values dynamically & to reuse these rules in different applications & also to process the output quickly.

Components of BRF+: 

1. Application

2. Data Object Creation

3. Functions

4. Rule Set

5. Rules

6. Decision Tables

7. Decision Tree

Note:

◉ All SAP applications that are based on SAP NetWeaver can access BRFplus within the boundaries of an SAP system.

◉ In BRF+ terminology , the Input is called Context & the Output is called the Result.

◉ This is available from SAP (ECC) ERP 6.0 onwards.

How does this BRF+ Work/Functions ? 

1. First we will create the Application.

2. Inside the Application , we will create all the other objects like Data Object Creation , Functions , Rule Set and so on.

3. Data Object Creation consists of all the variables used , which will be used for processing. These variables are basically input data to the BRF+ to process and to generate the output/result.

4. Next step , is to create Functions which is the core component – where the actual processing of the functionality gets executed.

5. Inside the Functions we have a Rule Set , which is basically a container which holds all Set of Rules and these Rules are processed based on the decision tables.

6. Here , Rules will be assigned to Rule Set and Rule Set in assigned to Functions and the Function will be tagged to a application.

7. Decision tables are going to hold the data which consists of all possible Inputs & corresponding Output values.

8. Basically , the Data Objects import parameters validate against the Decision Tables and these Decision table will generate the outcome/result.

9. Decision Tree can also be used instead of Decision tables but these would be used when you have very simple – Yes or No type of validation.

Example:

You need to print a Country Information in the adobe form/smart form with certain validation.

  Decision Table  
Company Code Sales Organization   Country 
DE01 0001  Germany 
PK01 0002  Pakistan 
IN01  0003  India 

◉ Lets say , the validation is based on your the Company Code and Sales Organization and the corresponding Country Information is to be displayed.

◉ Company Code & Sales Organization are the Input Parameter and Country is the Output Parameter .

◉ This is nothing but the Decision Table which is maintained in the BRF+ & based on the Rule Set maintained the corresponding output is determined.

How do we call BRF+ in programs , after its being maintained all necessary decision checks ?

◉ In the function component . you have a option called Create Code Template – after selecting this , it shows the generated code template.

◉ The generated code is the one which you need to place in the program – where you pass the Company Code & Sales Organization as Input to the generated code and it gives the corresponding Country Information as the Output as maintained in the Decision Table based on Rule Set maintained. This is one way of calling BRF+ , directly calling with the help of Function Code Template.

◉ The other way is to call with the help of ABAP Function Module , where Function Module needs to be created and the generated logic is wrapped around a Function Module and can directly call the Function Module wherever the validation is required.

Note:

◉ Every generated Function Code Template consists of a Unique Alphanumeric ID associated to it. This will uniquely identify respective function , which should be called for validation.

Use Cases: 

1. Output management for Billing and Purchasing – Output determination ( SAP S/4HANA ).

2. Integration with IMG transaction.

3. SAP business Workflows.

4. Cloud based Environment.

No comments:

Post a Comment