0% found this document useful (0 votes)
70 views87 pages

BRF+ Session

User Guide how to use BRF+

Uploaded by

Rajan Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views87 pages

BRF+ Session

User Guide how to use BRF+

Uploaded by

Rajan Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 87

Business Rules Framework (BRF+)

Anindya Chaudhuri, SAP

CONFIDENTIAL
Agenda

Introduction to business rules and BRMS

BRMS in SAP

BRF+ Objects

BRF+ Storage types

Expressions

Rules and Actions

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.

2. Multiple teams to handle different phases.

3. No clarity on works done by other team

Result: Increased cost, no possibility of optimization easily.

CONFIDENTIAL 4
Alternative – A BRMS Application

1. Abstract your business rules from your code


2. Better management of Time from request to implementation
3. Quality of implemented decision-making logic
4. Transparency of decision-making logic applied across SAP
applications
5. Costs of implementation and change

6. Agile approach

CONFIDENTIAL 5
Business Rules
Definition

Definition of a business rule



”Statement that defines or constrains some aspect of the business. It is intended to assert business structure
or to control or influence the behavior of the business.”, Hay and Anderson, The Business Rules Group,
2000

▪ “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

Business rules are


A set of decisions / calculation mechanisms applied to a business process to:
◼ Optimize process output ◼ Adhere to regulations/policies ◼ Automate Processes

CONFIDENTIAL 6
Business Rules
Rules: Example of a business process

Rules in a loan approval process

CONFIDENTIAL 7
A more technical example:

CONFIDENTIAL 8
Business Rules
Rules: Representation

How can rules be represented?

Some common approaches:


– Rules and rulesets

Ruleset

If …
Rule 1
Then ...

If …
Rule 2
Then ...

If …
Rule 3
Then ...

CONFIDENTIAL 9
Business Rules
Rules: Representation

How can rules be represented?

Some common approaches:


– Decision tables

Input 1 Input 2 Input 3 Input 4 Result


Value/Logic … … … Result 1
… … … … Result 2
… … … … Result 3

– Decision trees x

y z

A B C D

CONFIDENTIAL 10
Business Rules
Rules: Representation

How can rules be represented?

Some common approaches:


– Formulas
1 2
h = gt
2
– Scorecards

CONFIDENTIAL 11
Business Rules
Rules: Representation

How can rules be represented?

Some common approaches:


– Rule flows

Case 1
Process step

Process step Rule

Case 2
Process step

CONFIDENTIAL 12
Business Rules Data
Data
Data

Rules: Problems for business rules implementation


Rules Rules Event Event
Rules
Out Reple- Reple-
Out
of
Product nish-
ment
Event of
Product nish-
ment
stock order stock order

Implementing business rules: Problems Out Reple-


Product nish-
15 min of ment 15 min
stock order

15 min

Automated Enforcement No/Semi Automation Process Process


Context Process Context
Rules inside Database Rules as Tacit Knowledge Context
Roles Roles Workflow Workflow
Roles & Task
Create Claim
Workflow & Task
Create Claim

& Task
Create Claim

Sales Commissions Stored Analyze


Budget
Impact
Analyze
Resource
Impact
Analyze
Budget
Impact
Analyze
Resource
Impact

Triggers Premium Calculations


Procedures UI UI
Business
Analyze Analyze


Business
Budget Resource
Impact Impact

User Business Expert UI


Analyst

Rules inside Code Rules in Documents

Problems: Agility, visibility for business, changes? Problems: Costs, archiving, backups, compliance?

CONFIDENTIAL 13
Business Rules
BRMS: Definition

Definition of a Business Rules Management System (BRMS)



“A BRMS is a software system used to define, deploy, execute, monitor, and maintain the variety and
complexity of decision logic in the form of business rules that are used by operational systems within an
organization.”, Ziegler and Albrecht, 2010

▪ A BRMS consists of the following three components:


– Rules Authoring Environment, for the definition and maintenance of business rules
– Rules Repository, for the storage of business rules
– Rules Engine, for the execution of business rules by application code

CONFIDENTIAL 14
Business Rules
BRMS: Elements

Diagram of BRMS components

▪ These components and their relationships can be represented by the following diagram:

Rules Authoring Environment Rules Engine

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

Benefits of a Business Rules Management System


Process
Model Context
Business Rules Management Benefit

Separation of business rules and code Agile and maintainable systems


Roles Workflow
& Task
Modeling of complex business logicCreate Claim Automation of key business decisions
Manage Refine
Analyze Analyze

Central management of business rules Consistent application of corporate


Budget Resource
Impact Impact

UI policy and government regulations

Business Experts can find, change and Visibility, accountability and error-free
test critical business rules business
Automate

Business Rules Management results in:


▪ Flexible & agile business systems ▪ Precise & informed decision making
▪ Faster turnaround times for changes ▪ Improved visibility for the business
▪ Reduced cost for changes

CONFIDENTIAL 17
Business Rules
Rules: Application Architecture

Evolution of Business 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

BRFplus evolved from other products at SAP



BRFplus was born out of the need for a product that could cope with the demand for flexibility and ease of
use of a BRMS. Initially implemented for BusinessByDesign in 2005, it has been adopted in over 100 use
cases across a wide array of SAP Solutions. Relying on the experience made with other rule products, it has
been designed to widen the scope and flexibility while retaining ease of use for business experts.

▪ Some of other products that implement rule logic at SAP are:


– Business Rule Framework
– Condition Technique
– Formula Builder
– Internet Pricing Configurator
– Workflow Rules

CONFIDENTIAL 20
Business Rules
Business rules at SAP

BRFplus as BRMS for SAP products


▪ Using the previously presented concept of BRMS we can express the features of BRFplus within its
elements:

▪ BRFplus Rules Authoring


– BRFplus Workbench as standalone and extensible web based UI. It enables the design, and maintenance of business rules.

▪ BRFplus Rules Engine


– BRFplus provides an ABAP Objects API for rules invocation. Code generation , time-based versioning of rules and a wide array of
methods to invoke them, provide performance and flexibility at runtime.

▪ BRFplus Rules Repository


– Rule objects can be stored using a sophisticated lifecycle concept. Automatic dependency analysis prevents inconsistencies among them.
They can be transported via XML or the usual SAP Change and Transport System.

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

BRFplus objects can


also be accessed
directly through the API.

The inclusion of customized


and role-specific UI elements
is possible.

The Workbench is called


using transaction BRFPLUS/BRF+.

CONFIDENTIAL 23
Introduction to BRFplus: Workbench
Activation

The activation of BRFplus is straightforward:

1. Assign the role SAP_BC_FDT_ADMINISTRATOR to the user of the BRFplus Workbench

2. Activate the WebDynpro services for BRFplus:


– In transaction SICF:
– Activate the following ICF nodes for BRFplus:
▫ /sap/bc/webdynpro/sap/fdt_wd_workbench (FDT Workbench)
/sap/bc/webdynpro/sap/fdt_wd_object_manager (FDT Object Manager)
/sap/bc/webdynpro/sap/fdt_wd_catalog_browser (FDT Catalog Browser)

CONFIDENTIAL 24
BRFplus Objects

Concepts of BRFplus objects

CONFIDENTIAL 25
BRFplus Objects: Basic Object Handling
Object handling

Objects in BRFplus share some basic handling operations

▪ 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

Two ways of creating an element

From a link menu…

… or through the repository (right-click)

CONFIDENTIAL 27
BRFplus Objects: Basic Object Handling
Object selection: Repository search

Scenario 1: Basic object search


With an object ID (directly or search help): or through the repository search dialog:

CONFIDENTIAL 28
BRFplus Objects: Basic Object Handling
Object maintenance: the Object Toolbar

Object Toolbar in change mode

1 2 3 4 5 6 7 8 9

1. Navigates back to the last displayed object


2. Toggles between change and display mode
3. Checks the object for consistency
4. Saves the object
5. Activates the object
6. Writes the object into a transport (object has to be non-local, consistent and activated)
7. Marks the object as obsolete
8. Marks the object for deletion, or deletes it
9. Clicking on „You Can Also“ reveals other actions:
- Copy the object
- Show the usage of the object in other objects

CONFIDENTIAL 29
BRFplus Objects: Basic Object Handling
Object maintenance: Object lifecycle

BRFplus Object Lifecycle

Usable

A lifecycle for BRFplus


objects can be defined Created Obsolete
through their status.

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

▪ There are five access levels:


– Same application: Default setting. Only objects of the same application can access this object.
– Same application component: Only objects of the same application components can access this object (in the case of
standard BRFplus content this would be BC-SRV-BR).
– Same superior application component: Only objects that share the same superior application component can access this
object (continuing the example, the superior component for BC-SRV-BR is BC-SRV).
– Same top application component: Only objects that share the same top application components can access this object (in
the example above this would be BC)
– Global: All objects can access this object, without restrictions.

▪ By default the accessibility is set to the most restrictive type (Same application).

CONFIDENTIAL 31
BRFplus Objects: Common Object Settings
Access levels: Usage

Access levels are defined in the General tab

Drop down list shows the available options:

CONFIDENTIAL 32
BRFplus Objects: Common Object Settings
Versioning: Usage

Versioning enables change tracking and time-dependent use of rules

▪ Generally an object can always have two versions: active and inactive.

▪ Only consistent (error-free) objects can be activated.

▪ Only active objects can be processed.

▪ 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:

Versions tab with object versions:

CONFIDENTIAL 34
BRFplus Objects: Application
Application creation: Usage

▪ Two ways of creating an application

If the repository is Through the menu bar


initial or empty: (Workbench-> Create Application):

CONFIDENTIAL 35
BRFplus Objects: Application
Application creation: Usage

▪ Some application settings are defined at creation time

▪ The name is a required field, unlike most


other BRFplus objects.

▪ The storage type defines how the related


BRFplus objects are to be stored in the
database. Three options are available:
– System
– Customizing
– Master Data

▪ An application can be created locally,


and thus cannot be transported
or referenced by non-local objects.

▪ The last two fields, Development Package and Software Component, are explained in the following slide.

CONFIDENTIAL 36
Introduction to BRFplus: Catalogs
Purpose

A catalog defines a structured view on a collection of objects

▪ 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

This is a simple catalog


that offers the user
access to two
objects, a ruleset object
and a Decision Table
expression object.

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

A function determines how rules are processed


▪ A function in BRFplus is in charge of:
– receiving input data
– managing how the input data is processed
– returning the result data

▪ 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 input data is defined in the signature. It is in charge of:


▫ defining what type of data the function is expecting from the caller,
▫ and defining what type of data is made available for the rule processing.

– The result data is also defined in the signature. It defines what is returned to the caller.

Input data Function


ABAP code, other
BRFplus objects

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 need to be assigned to a development package.

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

• It can be overruled by implementing the Application Exit method


GET_CHANGEABILITY.

• 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

Storage Type Client Transport Cross-Application Usage

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

Expression types define the computational power of BRFplus

▪ 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

The Table Settings screen


In this screen it is defined how
the results are derived and how
they are returned. One possibility
is to return a table with all lines
that match the input conditions.
Another possibility is to return an
initial value if no match is found.

The column structure for both


condition and result columns
is defined here as well.

Finally, some check parameters


are set which determine how
rows that have conditions with
overlaps or gaps are reported
in the checks.

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

Detail area: overview

1: Main input area


1
2: Context
parameters

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

The Decision Tree is a binary tree that is traversed in sequence

Each level has a condition that


can be evaluated to True or
False. The next level can be
a condition or the end result.
This result can be a value or
an action.

CONFIDENTIAL 55
BRFplus Objects: Expressions
Search Tree

A Search Tree may have an arbitrary amount of nodes at each level

▪ In contrast to the Decision Tree, the


Search Tree can have nodes with
both conditions and result.

▪ The result match mode determines how


results are evaluated. Multiple Match
mode for example returns all matches
that were found in the tree.

CONFIDENTIAL 56
BRFplus Objects: Expressions
Boolean

Boolean expressions can be built with a template or free-style

▪ A Boolean expression is built


with concatenated boolean
values or conditions, using
boolean operators (AND,
OR, NOT).

▪ Existing templates can be used to


▪ build the expression.

CONFIDENTIAL 57
BRFplus Objects: Expressions
DB Lookup

Database tables can be checked or read with this expression


▪ There are three different modes:
– Data retrieval: Either a single or multiple lines can be read
– Aggregation: A single value is aggregated using one of the following functions: Minimum, Maximum,
Average, Sum or Count
– Existence check: Only the existence of at least on table line is checked. Returns a boolean value.

▪ Several conditions can be


defined for each mode, with both
inclusion and exclusion entries.

CONFIDENTIAL 58
BRFplus Objects: Expressions
Constant

The Constant is the most basic expression type

▪ It returns a fixed value. It does not support structures or tables.

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

The Function Call expression type allows functions to be called

▪ This makes functions reusable


from inside BRFplus. The
function contexts of source
function and target function
can be matched in the
Mapping panel.

▪ When calling functions (or


referencing any BRFplus objects)
that are part of another
application, the access levels
have to be considered.

CONFIDENTIAL 61
BRFplus Objects: Expressions
Loop

Loop expressions repeatedly execute a sequence of rules


▪ There are four different loop modes:
– For each entry in: The rules are executed for all or selected lines of a table
– Repeat <number> times: Repeats the rules a defined number of times
– Do Until <condition>: Cycles the executions of rules until a given condition is met
– While <condition> do: Cycles the executions of rules as long as a given condition is met

CONFIDENTIAL 62
BRFplus Objects: Expressions
Table Operation

Table Operation expressions make it possible to work with table objects and extract information
from them

▪ There are 15 different operations:


▪ Has at least, Has exactly, Has no more than, Count, Minimum, Maximum, Total, Average, First line, Last line, All
lines, Sort, Delete first line, Delete last line, Delete all lines

– Conditions can be
defined for most
operations.
– The result type depends
on the operation

CONFIDENTIAL 63
BRFplus Objects: Expressions
Procedure Call

Procedure Calls can execute ABAP code from within BRFplus


▪ It is possible to call ABAP function modules or static methods. The parameters can be mapped to context
parameters or to the result data object.
▪ Some parameters
cannot be mapped, like
parameters with the
data types RAW, X,
XSTRING and with
references.

CONFIDENTIAL 64
BRFplus Objects: Expressions
Random number

This expression returns a random number that is generated dynamically at runtime

▪ The returned number can have two modes:

– Bounded number: The minimum and maximum


can be defined, including a number of
decimals

– Boolean value: Returns True or False,


depending on a defined probability from 0
to 1 that is evaluated at runtime.

CONFIDENTIAL 65
BRFplus Objects: Rulesets
Ruleset: Purpose

A ruleset has three purposes

– A ruleset bundles a set of sequential rules into a logical unit

– A ruleset is the link between the function and the expressions that implement
the business rule

– A ruleset can enrich the existing context with new variables

CONFIDENTIAL 66
BRFplus Objects: Rulesets
Ruleset Header

The Ruleset Header handles information that is relevant to all contained rules

▪ The Ruleset Header has the following features:

– 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

Rules in a ruleset are executed top-down, one after the other

▪ 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

Example of rules in a ruleset

▪ These are two enabled rules with unlimited validity.

CONFIDENTIAL 69
BRFplus Objects: Rules
Rules: Rule detail

The Rule Detail defines the rule logic


▪ The rule logic is for example context parameters, ruleset variables or results from expressions between each other are
encapsulated in a If-Then-Else structure. The If-Section can contain one or more conditions, which can be implemented by
comparing with fixed values.
▪ If these comparisons hold true,
the Then-Section is processed.
Otherwise the Else-Section is
processed.
▪ The Then- and Else-Sections
can carry one or more instructions
that can trigger actions or
expressions, or change context
parameters or ruleset variables.
▪ If no condition is entered in the
If-Section, the Then-Section is
automatically processed.

CONFIDENTIAL 70
BRFplus Objects: Actions
Actions

Actions are special types of expressions that do not return a value

They usually manipulate data


instead. Expressions Actions
Expressions Expressions

They can use context parameters


and nested expressions as well. Input
ABAP code, data Function
other BRFplus
Actions can define follow-up objects
actions that will be executed Result data

in the defined order.

CONFIDENTIAL 71
BRFplus Objects: Actions
Send Email

The standard BRFplus shipment includes several action types

This is a Send Email action. It


is possible to include placeholders
in the texts to include variables
such as context parameters.

The addressees can be determined


dynamically as well.

CONFIDENTIAL 72
BRFplus Objects: Actions
Start Workflow

Workflows are a sequence of tasks that can run automatically or with the interaction of persons

▪ This action type enables


BRFplus to start such
a workflow. It is possible
to access the workflow
elements (which are
stored in the workflow
container) to control
the initial conditions
of the workflow.
▪ In the case of single
tasks, it is also possible
to define Agents that
will be involved in the
execution of the task.

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

▪ The texts can be supplied with values


taken from expressions, context parameters or
defined values and inserted into the text
by using placeholders.

▪ The log can then be analysed with transaction


SLG1 and using the object parameters.

CONFIDENTIAL 74
BRFplus tools: Simulation and Testing
Simulation tool

The Simulation tool is used primarily for testing or debugging functions

▪ The last active version of the function is simulated.

▪ The tool is opened from the Tools menu or directly from the Detail section of the function.

From the Tools menu (the .. or directly from the function


function has to be specified),

CONFIDENTIAL 75
BRFplus tools: Simulation and Testing
Simulation tool

Context values can be entered manually or imported

or import/export with an Excel file. This is


specially useful for mass testing.

Manual direct entry of context values,


CONFIDENTIAL 76
BRFplus tools: Simulation and Testing
Simulation tool

Simulation results

▪ Simulation runs can be


executed in two modes:

– Showing only the result


– Showing the intermediate
steps as well

CONFIDENTIAL 77
BRFplus tools: Simulation and Testing
Simulation tool

Simulation results, continued



The intermediate steps show
a detailed row view with every
processing step displayed.

▪ Both successful and


unsuccessful evaluations
are shown. Relevant values
are displayed in the rightmost
column

▪ The structure is nested


according to context objects
and the processing level of
the displayed object.

CONFIDENTIAL 78
BRFplus tools: XML Export and Import
XML Export and Import

XML files make it possible to transport rules between systems

▪ 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 Application Administration tool facilitates object management

▪ The purpose of this tool is primarily to remove unwanted objects that reside within the application.

▪ The Application Administration can


be accessed with a button in the
Detail section of the application object.

▪ Another way of accessing the application


is through the Tools menu, where the
application can be searched for and
selected.

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:

– Deletion of objects marked for deletion: enables


the deletion of objects that have been marked for
some time.

– Discarding of object versions: determines older


object versions that are not needed and discards
them.

– Clean up of the database: irreversibly removes


deleted or discarded objects from the database

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.

You might also like