BRF+ Session
BRF+ Session
CONFIDENTIAL
Agenda
BRMS in SAP
BRF+ Objects
Expressions
Tools
CONFIDENTIAL 2
Business Rules
▪ Business rules
o Definition
o Business Rules Management Systems
o Rules
▪ Business rules at SAP
o Other products
o BRFplus as a BRMS
o Business rules strategy at SAP
o BRFplus in SAP Applications
CONFIDENTIAL 3
Drawback of traditional Development Model
1. Majority of customers follow waterfall model.
CONFIDENTIAL 4
Alternative – A BRMS Application
6. Agile approach
CONFIDENTIAL 5
Business Rules
Definition
▪ “Business rules are a formal expression of knowledge or preference, a guidance system for steering
behavior (a transaction) in a desired direction. On the grand scale, business rules, then, are the guidance
system that influences the collective behavior of an organization’s people and information systems.”, von
Halle, The Data Administration Newsletter, 2002
CONFIDENTIAL 6
Business Rules
Rules: Example of a business process
CONFIDENTIAL 7
A more technical example:
CONFIDENTIAL 8
Business Rules
Rules: Representation
Ruleset
If …
Rule 1
Then ...
If …
Rule 2
Then ...
If …
Rule 3
Then ...
CONFIDENTIAL 9
Business Rules
Rules: Representation
– Decision trees x
y z
A B C D
CONFIDENTIAL 10
Business Rules
Rules: Representation
CONFIDENTIAL 11
Business Rules
Rules: Representation
Case 1
Process step
Case 2
Process step
CONFIDENTIAL 12
Business Rules Data
Data
Data
15 min
& Task
Create Claim
…
Business
Budget Resource
Impact Impact
Problems: Agility, visibility for business, changes? Problems: Costs, archiving, backups, compliance?
CONFIDENTIAL 13
Business Rules
BRMS: Definition
CONFIDENTIAL 14
Business Rules
BRMS: Elements
▪ These components and their relationships can be represented by the following diagram:
Rules Repository
CONFIDENTIAL 15
Rule Authoring in BRF+
CONFIDENTIAL 16
Data
Business Rules
Rules
BRMS: Benefits Event
Reple-
Out
Product nish-
of ment
stock order
15 min
Business Experts can find, change and Visibility, accountability and error-free
test critical business rules business
Automate
CONFIDENTIAL 17
Business Rules
Rules: Application Architecture
CONFIDENTIAL 18
Business Rules
▪ Business rules
o Definition
o Business Rules Management Systems
o Rules
▪ Business rules at SAP
o Other products
o BRFplus as a BRMS
o Business rules strategy at SAP
o BRFplus in SAP Applications
CONFIDENTIAL 19
Business Rules
Business rules at SAP
CONFIDENTIAL 20
Business Rules
Business rules at SAP
CONFIDENTIAL 21
Common BRF+ usage categories
Often tasks are related to one of the following:
• Validations
• Derivations
• Defaulting
• Classification
• Calculation
• Mapping
• Boolean decisions
Typically these are micro decisions. Micro decisions occur very frequently.
CONFIDENTIAL 22
Introduction to BRFplus: Workbench
Purpose
The BRFplus Workbench is a graphical user interface for the design and maintenance of business
rules
▪ It is:
– Web based
– User specific
– and enhance able
CONFIDENTIAL 23
Introduction to BRFplus: Workbench
Activation
CONFIDENTIAL 24
BRFplus Objects
CONFIDENTIAL 25
BRFplus Objects: Basic Object Handling
Object handling
▪ Rules in BRFplus are composed of objects. These objects can be handled and managed using some
common operations.
▪ These common actions contribute to the usability of BRFplus. They can be categorized as follows:
– Object creation
– Object selection
– Object maintenance
CONFIDENTIAL 26
BRFplus Objects: Basic Object Handling
Object creation
CONFIDENTIAL 27
BRFplus Objects: Basic Object Handling
Object selection: Repository search
CONFIDENTIAL 28
BRFplus Objects: Basic Object Handling
Object maintenance: the Object Toolbar
1 2 3 4 5 6 7 8 9
CONFIDENTIAL 29
BRFplus Objects: Basic Object Handling
Object maintenance: Object lifecycle
Usable
Removed
Marked for
from
deletion
database
Deleted
CONFIDENTIAL 30
BRFplus Objects: Common Object Settings
Access levels: Usage
Access levels determine how the object can be accessed by other objects
▪ By default the accessibility is set to the most restrictive type (Same application).
CONFIDENTIAL 31
BRFplus Objects: Common Object Settings
Access levels: Usage
CONFIDENTIAL 32
BRFplus Objects: Common Object Settings
Versioning: Usage
▪ Generally an object can always have two versions: active and inactive.
▪ Versioning can be individually switched on or off for all BRFplus objects. It can also be switched for the
objects contained in an application. If versioning is switched on, activating an object saves a version for the
time of activation. This version can be processed at runtime using a timestamp.
▪ The General section allows to toggle the versioning. The tab Versions displays further information, including
an overview of all versions.
CONFIDENTIAL 33
BRFplus Objects: Common Object Settings
Versioning: Usage
Versioning
Switching on versioning for an object:
CONFIDENTIAL 34
BRFplus Objects: Application
Application creation: Usage
CONFIDENTIAL 35
BRFplus Objects: Application
Application creation: Usage
▪ The last two fields, Development Package and Software Component, are explained in the following slide.
CONFIDENTIAL 36
Introduction to BRFplus: Catalogs
Purpose
▪ The navigation bar of the Workbench contains the so called repository, which offers an unrestricted view of
BRFplus objects. A catalog makes it possible to select a defined collection of objects and to structure them
as needed.
▪ This can be used for example to build user-specific or content-specific views. More details on catalogs will be
presented on a subsequent chapter.
CONFIDENTIAL 37
Introduction to BRFplus: Catalogs
Example
Simple catalog
CONFIDENTIAL 38
Introduction to BRFplus: Data Object
Purpose
Data objects determine the type of data that can be handled by other BRFplus objects
– This makes it possible to differentiate data into identifiable entities such as dates, numbers, currencies or
strings.
– This in turn enables other functionalities to process that data, such as date calculations, arithmetic
operations for numbers or conversion of currencies.
– More complex data types can be used in BRFplus, such as structures or even tables. These can be nested
in various combinations within each other, enabling the use of deeply nested data objects.
– Some types of generic data objects are: Number, Date, Currency, Quantity, String.
CONFIDENTIAL 39
Introduction to BRFplus: Function
Purpose
▪ To set this in motion, a function can be called from the following sources:
– ABAP API
Input data Function
– RFC
ABAP code, other
– Web Services BRFplus objects
– Other BRFplus
objects Result data
CONFIDENTIAL 40
Introduction to BRFplus: Function
Signature
The signature defines what types of data will be processed by the function
– The result data is also defined in the signature. It defines what is returned to the caller.
Result data
CONFIDENTIAL 41
Context and Result
• Context and result define the input and output parameter interface. In BRFplus, input parameters are
referred to as context while output parameters are referred to as result. Context and result are data
carriers.
• Both context and result are a set of data objects, such as an element, structure, or a table. A context or a
result of type element can be a text, number, Boolean, quantity, amount, and timepoint.
Context Overview
• For each object that has a context, you can easily inform yourself of the available context data objects. To
accomplish this, navigate to the object in question in the BRFplus workbench and choose Context
Overview.
CONFIDENTIAL 42
Context Overview
If an expression, action, or rule is assigned to more than one function, the list of available context data objects
represents the intersection of the context data objects of all involved functions.
Example: A decision table expression DT is used by three different functions F1, F2, and F3, either directly as
the function's top expression or indirectly as a nested expression. The following table shows the context data
objects for each of these functions:
Function Parameters
F1 NUM1, TXT1, BOOL1
F2 NUM1, TXT1
F3 NUM1, BOOL1
In this scenario, there is only one context data object that all three functions have in common, namely NUM1.
Consequently, an expression like decision table DT that is used in all three functions can only access this one
common context data object.
CONFIDENTIAL 43
Storage Types
System Objects
• System objects behave like repository objects that are assigned to this development package
with respect to changeability control.
• Technically, the metadata for system objects is stored in client independent tables of delivery
class S (e. g. FDT_ADMN_0030S). This metadata can only be transported via a workbench
transport.
CONFIDENTIAL 44
Storage Types
Customizing Objects
• Customizing objects are transported to the customer via the customizing client.
• At the customer side they can be copied to other clients via transaction SCC1.
• The changeability control for customizing objects is done via the client settings
defined in transaction SCC4.
• Technically, the meta data for customizing objects at the customer side is always
stored in client dependent tables of delivery class C.
CONFIDENTIAL 45
Storage Types
Master Data Objects
• Master Data objects are always local objects. The customer is allowed to create or change
but there is no transport as usual with local objects.
• Technically, the meta data for master data object is stored in client dependent tables of
delivery class A (e.g. FDT_ADMIN_0030A).
CONFIDENTIAL 46
Storage Types
System
client-independent transportable or local Can use system objects.
Customizing
client-dependent transportable or local Can use system and customizing
objects.
Master Data
client-dependent local Can use system, customizing, and
master data objects.
CONFIDENTIAL 47
BRFplus Objects: Expressions
Expression and expression types
▪ They express the logic for a value derivation or calculation. Each expression type defines a self-contained
computational unit with a well-defined logic. The following slides describe some of the standard expression
types available in BRFplus.
▪ An expression is an instance of an expression type, with references to the actual data and values to be used.
Expressions
expressions
Input
ABAP code, data Function
other BRFplus
objects
Result data
CONFIDENTIAL 48
BRFplus Objects: Expressions
Decision Table
The Decision Table expression type offers a powerful way to express business rules
Decision Tables consist primarily of rows and columns. The columns are further divided in condition columns
and result columns.
When a Decision Table expression is called, every row is processed in sequence. In each row, every condition
column cell is processed from left to right. If the condition in each input column cell of a row is met, the field
values defined in the result columns are returned.
It is possible to enter expressions or direct values in these cells. This enables the use of deep, or nested,
decision tables.
It is also possible to evaluate the values in each cell by using comparison operators, value ranges and
patterns.
CONFIDENTIAL 49
BRFplus Objects: Expressions
Decision Table: Example
Example of a Decision Table
The Detail section gives access to table operations with which rows can be inserted, copied, edited and removed. The table
rows can be moved and arranged as well, so that the most specific conditions are tested first. Finally, tables can be exported
and imported to and from excel, and the table settings screen can be accessed.
CONFIDENTIAL 50
BRFplus Objects: Expressions
Decision Table: Table settings
CONFIDENTIAL 51
BRFplus Objects: Expressions
Formula expression
• A wide array of calculations on data objects is made possible with the Formula expression type. This
includes mathematical operations as well as a large selection of formula functions. Context parameters,
expression results and direct values can be used as well in these formulas.
▪ A formula can be created with building blocks, or using direct text entry in expert mode.
▪ The available formula functions can be filtered by categories or search patterns, and are documented with an
explanation on purpose and syntax of the function. It is possible to define own formula functions.
CONFIDENTIAL 52
BRFplus Objects: Expressions
Formula expression
3: Operators and
input objects
4: Formula
4
functions 2 3
CONFIDENTIAL 53
BRFplus Objects: Expressions
Case expression
The Case expression type maps input values to a defined set of output values
▪ This expression tests for the value of an expression or context parameter among a list of defined cases. If
one of these cases applies, its corresponding return value is given back.
CONFIDENTIAL 54
BRFplus Objects: Expressions
Decision Tree
CONFIDENTIAL 55
BRFplus Objects: Expressions
Search Tree
CONFIDENTIAL 56
BRFplus Objects: Expressions
Boolean
CONFIDENTIAL 57
BRFplus Objects: Expressions
DB Lookup
CONFIDENTIAL 58
BRFplus Objects: Expressions
Constant
CONFIDENTIAL 59
BRFplus Objects: Expressions
Value Range
Value Range expressions are used to check if a value lies in a defined range
▪ It is possible to define ranges where a value is included, and ranges where the value is excluded. For each type, several
conditions can be entered.
▪ In the case of structures and tables, it is only possible to check if they are initial.
▪ If one of the inclusion conditions apply, and none of the exclusion conditions, the expression returns True.
CONFIDENTIAL 60
BRFplus Objects: Expressions
Function Call
CONFIDENTIAL 61
BRFplus Objects: Expressions
Loop
CONFIDENTIAL 62
BRFplus Objects: Expressions
Table Operation
Table Operation expressions make it possible to work with table objects and extract information
from them
– Conditions can be
defined for most
operations.
– The result type depends
on the operation
CONFIDENTIAL 63
BRFplus Objects: Expressions
Procedure Call
CONFIDENTIAL 64
BRFplus Objects: Expressions
Random number
CONFIDENTIAL 65
BRFplus Objects: Rulesets
Ruleset: Purpose
– A ruleset is the link between the function and the expressions that implement
the business rule
CONFIDENTIAL 66
BRFplus Objects: Rulesets
Ruleset Header
The Ruleset Header handles information that is relevant to all contained rules
– Ruleset can be enabled or disabled. This affects the processing of all the contained rules.
– Additionally, a precondition can be assigned, even if the ruleset is enabled. This can be based on the
context parameters or other values such as the system status.
– The Ruleset Header can define additional ruleset variables, which are made available to the contained
rules as temporary context parameters.
CONFIDENTIAL 67
BRFplus Objects: Rulesets
Rules in the ruleset
▪ A single rule consists of a Rule Header and the Rule Detail. The Rule Header acts similarly as the Ruleset
Header, but on rule level. It has the following settings:
– Status: determines whether a rule is enabled
– Description
– Interval of validity: determines a timeframe in which the rule is processed
– Precondition: (visible in “Other Operations”) determines a precondition for rule processing)
▪ It is also possible to add new rules and to define an exit condition, which defines if and when the processing
of the rules should be interrupted or restarted.
CONFIDENTIAL 68
BRFplus Objects: Rulesets
Rules in the ruleset
CONFIDENTIAL 69
BRFplus Objects: Rules
Rules: Rule detail
CONFIDENTIAL 70
BRFplus Objects: Actions
Actions
CONFIDENTIAL 71
BRFplus Objects: Actions
Send Email
CONFIDENTIAL 72
BRFplus Objects: Actions
Start Workflow
Workflows are a sequence of tasks that can run automatically or with the interaction of persons
CONFIDENTIAL 73
BRFplus Objects: Actions
Log Message
This action type can add one or multiple messages to an application log
▪ These messages can be written to logs defined by an object and a subobject in transaction SLG0. They can be persisted
or kept temporarily in memory. It is possible to define the type of message (“Information”, “Status”, “Warning”, “Error”,
“Abort” or “Exit”).
CONFIDENTIAL 74
BRFplus tools: Simulation and Testing
Simulation tool
▪ The tool is opened from the Tools menu or directly from the Detail section of the function.
CONFIDENTIAL 75
BRFplus tools: Simulation and Testing
Simulation tool
Simulation results
CONFIDENTIAL 77
BRFplus tools: Simulation and Testing
Simulation tool
CONFIDENTIAL 78
BRFplus tools: XML Export and Import
XML Export and Import
▪ These files are created in the source system and can have one of the following formats:
– Internal schema: Selected as default, uses technical names and abbreviations
– External schema: Improved readability, but takes more space
▪ Additionally a version can be defined, which depends on the systems that exchange the XML files. It is
recommended to select the highest available version.
CONFIDENTIAL 79
XML Export and Import Reports
XML export and import reports provide an easy and user-friendly way to export and import BRFplus
objects. The following reports are available for XML export and import:
CONFIDENTIAL 80
BRFplus tools: Application Administration
Purpose and usage
▪ The purpose of this tool is primarily to remove unwanted objects that reside within the application.
CONFIDENTIAL 81
BRFplus tools: Application Administration
Other operations in the Application Administration tool
Other operations
The drop down box shows other operation for this tool:
CONFIDENTIAL 82
BRF+ tools: Debug a function
CONFIDENTIAL 83
BRF+ tools: Debug a function
CONFIDENTIAL 84
BRF+ tools: Debug a function
CONFIDENTIAL 85
Generating Web Services and RFC
• The generation tool for web services and RFC-enabled function modules helps an application developer as
well as a third-party user to process the rules defined in BRFplus.
• The tool helps to create web services and function modules in a highly automated fashion with minimal
interaction.
CONFIDENTIAL 86
Thank you.
Contact information:
Anindya Chaudhuri
[email protected]
© 2022 SAP SE or an SAP affiliate company. All rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to SAP Materials for general audiences.