Applications of SAP BRF+ ECC Integrations Examples

Share on Facebook10Share on LinkedIn71Tweet about this on TwitterShare on Google+0
Please Share!!

BRF+ Business Use Case

Today I will talk about an application that is fully integrated with the SAP ECC system BRFplus (Business Rules Framework +). In this article, I will provide an application of BRF+ on a business case from one of my former clients.

BRF+ allows for rules to be modeled in an intuitive way that gives greater flexibility and visibility to the Business users who are not developers with training in ABAP. It is like giving more technical power to the Business users.

Please Note: In order to use BRF+ with your SAP ECC system, your system must be on SAP NetWeaver 7.02 SP6 or above.

T-Code is BRF+ or BRFplus

In your SAP ECC session input either of the above transaction codes, and you will be able to access BRF+ workbench. In the workbench, you will be able to create all objects needed for BRF.

Business Case – Material extension for new materials

There is an existing custom batch program which extends all materials to all storage type. However, not all materials require all storage types. The ABAP logic to account for the custom business rules required to extend the material to the appropriate storage type is complex and difficult to change when each new material attributes are introduced as part of the extension criteria.

BRF+ can manage the business rules in a decision table where it is scalable and transparent to the business analyst making updates per business needs.

Application

This is where all of the components related to your application resides. i.e. Components: (Data Elements, Functions, Rulesets, Expressions, etc)

 

A figure of BRF+ workbench screen (please pardon the haziness of the image)

Also Read: Modify the Run-Time Value of Workflow Containers

A) Define Data Elements: In BRFplus, the functional analyst creating the BRFplus function can create new data elements not included in the SAP ECC system or Bind your data elements to be used in the BRFplus function through the DDIC element (Data Dictionary) from SAP. In this business scenario, I will be using data elements from the DDIC.

Data Elements:

Storage Type

BRFplus made easy

General Item Category Group

sap workflow and brf+

Storage Class

sap workflow and brf+

Hazardous Material Number

workflow and brf

B) Define Decision Table: The decision table is one of the most useful features in BRFplus. It allows for the business rules to be maintained in a table where the business user can easily import and export via excel when changes are required due to business needs.

Decision Table:

TechName: DT_STORCLS_STORTYP DescName: STRTYP by STRCLS storage type (Output) by storage class (Input)

Do you Know? Difference between Logical and Physical Deletion of Work Items in SAP Workflow

C) Define Structure and Tables: Structures need to be created to storage BRF+ function process results for further processing. Tables need to be defined when there are one-to-many (input to output) relationships.

i.e. In this business scenario, there exist multiple storage classes that have multiple types and vice versa.

BRF+ in SAP Workflow

D) Define Ruleset: A ruleset is a series of logic executed everytime the BRF+ function is called. In each ruleset, each rule can be configured with a validity period. This gives the business analyst (power user) a way to expire rules without having to go through an entire development lifecycle as with traditional ABAP development. Also, if the rule is required again at a later time, then the business analyst (power user) could implement the changes to mean business demands in a timely fashion. I will not be covering this feature in this article based on the focus of this article.

i.e. In this business scenario, we have 2 rules which are executed in a sequence within the ruleset.

Rule 1: For any material where the general item category is not blank with the exception of general item categories between ZBN2 to ZBN6, update the results structure with storage types after processing the 1st decision table in the figure below (Storage Type by Item category).

Rule 2: If the material is a hazardous material (indicated by the hazardous material is not initial or in ABAP STOFF IS NOT INITIAL.), update the results structure with storage types after processing the 2nd decision table in the figure below (Storage Type by storage class).

BRF+ in SAP Workflow E) Define Function: The function is where the ruleset houses the sequence of rules executed. This is the BRF+ function that an ABAP application would call to retrieve results. The character string in the ID field is the BRF+ function ID the ABAP program will call on.

Function in BRF+

F) Connect BRF+ function to ECC ABAP backend: See ABAP Report Below

ABAPer would be interested in the below code. 🙂

Note: In the event, duplicates occur, we may need to remove the duplicated values in the table

http://rules793.rssing.com/chan-4338952/all_p5.html

  • The duplicate removal can be implemented by a simple ABAP function using SORT and DELETE ADJACENT DUPLICATES
  • Using generic types for the method parameters makes for efficient procedure calls from BRF+

Also Check: How to Debug any Work Item in SAP Workflow?

 Example of BRF+ function for material extension execution:

Based on Decision table entries:

LVS_LAGKL LGTYP
AERO 120
AERO 220
CORAI 140
CORAI 240
CORAO 140
CORAO 240
CORBI 140
CORBI 240
CORBO 140
CORBO 240
FL 130
FL 230
FLAO 130
FLAO 230
FLBO 130
FLBO 230
FLG 190
FLG 290
FLGMP 120
FLGMP 220
FLS 130
FLS 230
NFG 160
NFG 260
OGNFG 160
OGNFG 260
OTHER 100
OTHER 120
OTHER 130
OTHER 140
OTHER 150
OTHER 160
OTHER 170
OTHER 180
OTHER 190
OTHER 200
OTHER 220
OTHER 230
OTHER 240
OTHER 250
OTHER 260
OTHER 270
OTHER 280
OTHER 290
OTHER 300
OTHER 350
OTHER 360
OTHER 400
OTHER 410
OTHER 420
OXAI 150
OXAI 250
OXAI 350
OXAI 410
OXAO 150
OXAO 250
OXAO 350
OXBI 150
OXBI 250
OXBI 410
OXBO 150
OXBO 250
OXBO 410
URCAI 180
URCAI 280
URCAO 180
URCAO 280
URCBI 180
URCBI 280
URCBO 180
URCBO 280
WRAI 170
WRAI 270
WRAO 170
WRAO 270
WRBI 170
WRBI 270
WRBO 170
WRBO 270

Summary of series of events in creating a BRF+ function for ABAP Applications

This is what all working in BRF need to know and follow.

  1. Find/Create a new application folder in your BRF+ workbench
  2. Identify/Define Data Elements
  3. Create Decision Table(s)
  4. Assign Data Elements to Decision Table(s)
  5. Create Structures and Tables for Processing as needed
  6. If Structures and Tables are created, then assign the appropriate data elements to them respectively
  7. Create ruleset for function process
  8. Create rules within the ruleset
  9. Assign Tables, Structures, and Decision Tables for each rule processed as appropriate
  10. Create BRF+ Function
  11. Assign Ruleset to BRF+ Function
  12. Create ABAP program to call BRF+ Function

Hope, I have not overwhelmed you with too much information. My idea was to share a real project case where we implemented the Business Framework Rule. When there are exceptions in the normal process, instead of handling it in complex ABAP program, it is a better idea to make use of Rule Sets and Function in BRF+.

If you need any other information regarding BRF+, please feel free to leave it in the comment section below. We would be happy to revert.

Please browse our page for Fiori, SAPUI5, OData, HANA-ABAP, OOPs, Workflow, Web Dynpro etc tutorials.

Now we want to hear from you.

Have you used BRF+? Would you like to share your experience?

Please leave some quick comments below.

Please Subscribe, Like and Share our Page.

Share on Facebook10Share on LinkedIn71Tweet about this on TwitterShare on Google+0
Please Share!!

About the Author

Kei Hau
Kei Hau
Kei Hau is an ERP systems analyst. He has worked as Sr. SAP Functional Lead for Pricing in Sales and Distribution for 7 years. During his time on dedicated SAP technology, he has studied In-memory data management (HANA), learned variant configuration for fabricated goods, and experimented with Business Rule Framework plus (BRF+) development for SAP ECC applications. Other interests outside of SAP include Data analytics, Data Visualization, Risk Management, Game Theory, and other Data science-related topics. He is a fierce challenger. Do not dare him to do anything. :) Find more about Kei on LinkedIn.

2 Comments on "Applications of SAP BRF+ ECC Integrations Examples"

  1. Praveen Kumar Bindla | September 23, 2017 at 10:37 am | Reply

    This is an awesome tutorial.
    But images are not clear.
    In my project, we use BRF+, but am very new to brf.
    Hence I was happy to see ur post.
    In my project, they will call brf plus by using get badi and call badi.
    By sending some script id and Getting the methods to be executed from brf desicion tables.

    Thanks,
    Praveen Bindla,

    • Thank you. I will have to find a way to clean up the images. I am very pleased to see I wasn’t the only one to use brf+.

Leave a Reply to Praveen Kumar Bindla Cancel reply

Your email address will not be published.


*