BRFplus - Training Material
Transcript of BRFplus - Training Material
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 1/127
SAP Technical
Business Rule Framework plus
This presentation is for internal use only and not intended for external distribution. Its contents must be held in confidence.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 2/127
2
Course Objectives
Overview
Business Rule
BRFplus – Workbench
Expressions
Action Types
Tools and AdministrationTips and Tricks
Appendix
Hands on exercises
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 3/127
3
Business Rules
What are business rules?1. Business rules represent corporate policies or business guidelines2. Business rules are owned by the business, not by IT
Example:- 1. If you buy three items you get one free.2. Discounts for premium customers
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 4/127
4
Business Rules - Examples of Business Process
1. Figure Shows a simplified diagram for loan approval process.2. For Each Steps, the business rules are depicted.3. Quality and efficiency of the management of the rules becomes crucial for
organization’s success
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 5/127
5
Business Rules - Examples from Across Industries
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 6/127
6
Business Rules - Types of Business Rules — A Compilation
No matter how simple or complex the business rules are, being able to create,maintain and track the business rules that are governing the operationalprocesses of an organization is critical to its success.
An Effective way of managing business rules is a Business Rule Management
System (BRMS)
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 7/127
7
Business Rules - Representation
Separating the business rules lifecycle from the application developmentcycle enables more timely responses to business Changes
For Transparency to non technical users and to enable to perform changesthemselves, the BRMS needs to provide a collection of rule representationthat can be understood by all users groups.
The most common approaches are:
1. Rules and Rulesets2. Rule Flows3. Decision Tables4. Decision Trees5. Formulas6. Scorecards
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 8/127
8
Business Rules - Representation
1. Pain Rules are also called IF-THEN rules. They are set of textual statements.
2. They contain a condition part introduce by IF term, and an action part, connected tothe THEN term. When condition is true action is executed.
3. Rulesets allow grouping of rules for better organization, structuring, and management
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 9/127
9
Business Rules - Representation
1. Decision Tables provide a very structured and organized view of interrelated businessrules.
2. Contain condition columns with each cell in the column being part a particularcondition.
3. If all conditions of a row match, the results from the corresponding result column cellsare returned or actions are performed.
4. Decision tables are very popular because of their spreadsheet like nature and theability to exchange data easily with office applications such as Microsoft excel.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 10/127
10
Business Rules - Representation
1. Formulas are business rules that produce a value according to a specifiedmathematical algorithm.
2. BRMS usually provides a set of built-in functions for usage in formulas such asfor financial mathematics.
3. A scorecard is a special form of table that examines different properties orcharacteristics or an object or transaction and assigns weights based on thevalues.
4. All underlying weights are added to arrive at an overall score, which can becompared to other scores for a rank based decision.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 11/127
11
Business Rules - Representation
1. Rule Flows define the graphically maintained sequence of execution steps in adecision process, using tasks, branching, and iterations.
2. Tasks hold collection of rules or other representation formats such as decision tablesand decision trees.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 12/127
12
Enforcing Business Rules — Conventional Methods
1. To Solve this conflict, business rules needs to be considered in the architecture of theapplication at the early stage.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 13/127
13
BRMS - Overview
Definition of a Business Rule Management System (BRMS)
“A BRMS is a software system used to define, deploy, execute, monitor, and maintain the variety and complexity of decision logic inthe form of business rules that are used by operational systems withan organization”.
A BRMS Consists of the following three components:
• Rule Authoring Environment, for defining and maintaining business rules• Rule Repository, for the storage of business rules• Rules Engines, for the execution of business rules by application code
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 14/127
14
BRMS - Benefits of Business Rule Management System
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 15/127
15
Business Rules - Evolution of Business Application Architecture
1. Use of a database management system (DBMS) helps separate application data
and application logic
Tools optimized for data management
2. Use of a business rule management system (BRMS) Business rules should be considered early in the application lifecycle Tools optimized for business rules management, targeting also non-technical user
groups Once the BRMS services are defined and plugged into the application, rules changes
do not require programming skills Programmers continue to develop the remaining application logic, while business
experts are empowered to create and maintain the business rules
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 16/127
16
SAP’s Business Rules strategy and Recommendations
Recommendation For Best Performance
“A Rule engine that integrates deeply into the execution stack of the business application is generally recommended”.
For ABAP Stack use cases, BRFplus shipped with the business suiteis best suited.
For JAVA Stack use cases, BRM usually is best suited.
Example:-1. Customer wants to leverage business rules in a business suite application or add
flexibility to a business suite process, BRFplus is a ideal choice.2. Customer creating composite applications and process using SAP NetWeaver
CR, BRM would be usually appropriate.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 17/127
17
Alignment NW BRM / BRFplus Alignment Themes
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 18/127
18
BRFplus Workbench - Overview
“The term BRFplus workbench refers to the web-enabled ruleauthoring and management tool that provides an environment withcommon paradigms for the maintenance, testing, and managementOf business rules content in BRFplus”.
Workbench Includes:-1. Search and navigation capabilities to find specific BRFplus objects.
2. Editors to create & change all the different types of BRFplus objects.(Such as
Functions, Data Objects, and Rulesets, expressions).3. Objects can be transported and deleted.
4. Additional Tools such as simulation of rules, detection of unused objects, creationof web services and XML export and import.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 19/127
19
BRFplus Workbench - Prerequisites
Activation of BRFplus is straightforward:-
Authorization1. Assign the role SAP_BC_FDT_ADMINISTRATOR to the user of the BRFplus
workbench.
WD Configuration1. Activate the following ICF nodes for BRFplus:2. Activate the WebDynpro services for BRFplus in transaction SICF
/sap/bc/webdynpro/sap/fdt_wd_workbench /sap/bc/webdynpro/sap/fdt_wd_object_manager /sap/bc/webdynpro/sap/fdt_wd_catalog_browser
SAP NetWeaver 7.0 enhancement pack 2 or higher
Note: In SAP note 1088717, you will find more information on how toactivate a node.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 20/127
20
Benefits
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 21/127
21
Challenges
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 22/127
22
Benefits of BRFPlus
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 23/127
23
BRFplus Workbench - Starting the BRFplus workbench
1. Transaction BRF+ and BRFplus were introduced in SAP NetWeaver 7.0Enhancement Package 2.
2. The Old Transaction was FDT_WORKBENCH used in earlier releases.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 24/127
24
BRFplus Workbench - Starting the BRFplus workbench
1. The BRFplus workbench is agraphical user interface for thedesign and maintenance of businessrules
2. It is:-Web based-User Specific and enhance able
3. BRFplus objects can also beaccessed directly through API.
4. The Inclusion of customized and rolespecific UI elements is possible.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 25/127
25
BRFplus Workbench - Elements of Workbench
The BRFplus workbench consist of four areas
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 26/127
26
BRFplus Workbench - Navigation Panel
The Navigation Panel Offers four views:-
1. Repository View: it provides access to all BRFplus objects2. Recently used View: Provides access to last 20 objects which have recently been
displayed or edited.
3. Favorites View: it makes it possible to maintain and access a list of favoriteobjects.
4. Catalog View: It gives access to the catalog objects selected by the user
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 27/127
27
BRFplus Workbench - Object Manager
An Object can be always be visualized in two modes, change or Display Mode.
1. In change mode the object can be modified, and it becomes inaccessible forother users and certain activities. The Display mode doesn’t lock the object and itis not possible to change it.
2. Furthermore each object can have an inactive or active status. Only activeobjects can be used in rule determination
3. This Information is Displayed in the Object Header as shown below.
4. Other Common Activities are displayed in the Object Toolbar.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 28/127
28
BRFplus Workbench - Object Toolbar
1. Navigate Back to the last displayed object2. Toggles between change and display mode3. Checks the object for consistency4. Saves the object
5. Activates the object6. Writes the object into a transport (object has to be non local, consistent and
activated)7. Marks the object as obsolete8. Marks the object for deletion, or deletes it9. Click on.. You can also “reveals other actions:
Copy the object Show the usage of the object in other objects
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 29/127
29
BRFplus Workbench - Object Lifecycle
BRFplus object Lifecycle can be defined through their status
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 30/127
30
Rule Creation Process
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 31/127
31
Rule Creation Process – Application Creation
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 32/127
32
BRFplus Workbench - Application Purpose
An Application is a container to group related BRFplus objects.
Rule logic that is implemented in BRFplus consists of severalBRFplus objects. In Order to group and manage them, they mustbelong to an application
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 33/127
33
BRFplus Workbench – Application Creation
Two ways of creating an application
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 34/127
34
BRFplus Workbench – Application Creation
Name of the application
Short Text
As a local or transportable
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 35/127
35
BRFplus Workbench – Application Creation
Customizing (Client dependent) object or
workbench (client Independent) objectOr System
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 36/127
36
BRFplus Workbench – 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 ). Access Levelsare defined in General Tab
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 37/127
37
BRFplus Workbench Versioning: Usage
Versioning enables change tracking and time dependant use of rules.
1. Generally an object can always have two versions active and inactive2. Only Consistent (error-free) objects can be activated.3. Only active objects can be processed.4. Versioning can be individually switched on or off for all BRFplus objects. It can
also be switched for the objects contained in an application5. 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 timestamp6. General Section allows to toggle the versioning7. The Tab version displays further information including an overview of all versions
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 38/127
38
BRFplus Workbench Versioning: Usage
Switch On Versioning
Versions Tab with Object Versions
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 39/127
39
Rule Creation Process – Function Creation
Next is to Create Function and define Signature
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 40/127
40
BRFplus Workbench - Function Overview
1. A Function is the Link between Application Code & the Business Rule.
2. A Function determines how rules are processed. It serves as an entry point thatcalls assigned Rulesets
3. To set this in motion. A function can be called from following sources:
4. It can be run directly in the BRFplus Workbench (Button “Start Simulation”) or becalled programmatically from any application using ABAP API RFC Web Services Other BRFplus objects
5. A Function takes parameters from a call and processes the rule logic throughother BRFplus objects to return a value. Functions can be called directly fromapplication code or from certain BRFplus objects.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 41/127
41
BRFplus Workbench - Function Signature
The Signature defines what type of data will be processed by theFunction.
The Input data is defined in the signature. It is in charge of:- Define 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 thecalled.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 42/127
42
BRFplus Workbench - Signature Purpose
1. The Signature Defines Input and output parameters of the function2. The Signature consists of the context and the result data object.
3. The context consists of data objects that are passed from the caller as primarilyoptional parameter. Subsequent rule logic can be read and write on these dataobjects.
4. The Result data object contains the results of the rules processing. It is possible toreturn a single element, a structure or a table.
Importing
Exporting
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 43/127
43
BRFplus Workbench - Function Mode of Operations
The Mode of operation of functions determine how the rules areprocessed.
Requires top expression;used for more simple cases
Uses rule sets to triggerprocessing
instead of top expression
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 44/127
44
BRFplus Workbench - Event Mode
1.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 45/127
45
BRFplus Workbench - Functional Mode
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 46/127
46
BRFplus Workbench - Function Execution Mode
Functions can be executed using generated code.
1. BRFplus has a powerful feature of code generation. This means that the rule logicis generated as code. This results in high performance at runtime. BRFplus tries togenerate functions an their related objects whenever possible.
2. The alternative execution mode is called interpretation mode. Where each object iscalled at runtime and interpreted individually. This mode is usually slower ( One ortwo orders of magnitude )and is only executed when code generation is not
available ( e:g when simulated )
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 47/127
47
Rule Creation Process – Rule Set Creation
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 48/127
48
BRFplus Workbench – Rulesets Purpose
1. A ruleset is a collection of rules.2. A ruleset bundles a set of sequential rules into a logical unit.
3. A ruleset is the link between the function and the expression that implement thebusiness rule.
4. It contains information on when to trigger the rules.5. A rule is a condition structure that can process actions and expressions among
others, for each condition.6. It is associated to a function, and can be enrich the function context with
additional variables.
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 49/127
49
BRFplus Workbench – Rulesets Header
The ruleset Header handles information that is relevant to allcontained rules
The ruleset Header has the following features:-
1. It can be enabled or disabled. This affects the processing of all the containedrules.
2. Additionally, a precondition can be assigned, even if the ruleset is enabled. Thiscan be based on the context parameters or other values such as the systemstatus.
3. The Ruleset Header can define additional ruleset variables, which are madeavailable to the contained rules as temporary context parameters.
BRF l W kb h R l V i bl
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 50/127
50
BRFplus Workbench – Rulesets Variables
Examples of Ruleset Header and Ruleset Variables
BRF l W kb h R l i R l t
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 51/127
51
BRFplus Workbench – Rules in a Ruleset
Rules in a ruleset are executed top-down, one after the other
Example : Rules
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 52/127
52
Example : Rules
BRF l W kb h B i Obj t H dli
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 53/127
53
BRFplus Workbench – Basic Object Handling
Objects in BRFplus share some basic handling operations.
Rules in BRFplus are composed of objects. These objects can behandled and managed using some common operations.
These common actions contribute to the usability of BRFplus. Theycan be categorized as follows:
1. Object creation
2. Object selection3. Object maintenance
BRF l W kb h Obj t C ti
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 54/127
54
BRFplus Workbench – Object Creation
Two ways for creating an element
From Link MENU….
Or through repository right click….
BRFplus Workbench Object Selection
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 55/127
55
BRFplus Workbench – Object Selection
There are several ways to select an object.
Scenario 1:Searching and selecting an object to be displayed or edited
Scenario 2:Searching and selecting an object to be linked to another
Either scenario ends up opening a search and selection screen. SelectionCriteria make it possible to refine the search.
BRFplus Workbench Object Selection Repository Search
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 56/127
56
BRFplus Workbench – Object Selection Repository Search
Scenario1: Basic Object Search
With an Object ID or (Search help) or through repository search
BRFplus Workbench Object Selection Object Linking
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 57/127
57
BRFplus Workbench – Object Selection Object Linking
Scenario 2: Linking an object to another
From Link Menu…….
Using Default Objects….
Query Dialog: it is possible to refine the search
parameter.For example by searching in a particularapplication
BRFplus Workbench Attributes and properties
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 58/127
58
BRFplus Workbench – Attributes and properties
BRFplus objects share a common set of attributes and properties
Attributes are generated or derived at creation time and cannot be changed.
Properties might be derived from the associated application, but can bechanged.
Both attributes and properties are displayed in the “General” section of the screen.This section can be expanded to show more attributes andproperties.
BRFplus Workbench Attributes
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 59/127
59
BRFplus Workbench – Attributes
General Section
Reduce View
Extended View
BRFplus Workbench Names: Usage
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 60/127
60
BRFplus Workbench – Names: Usage
Objects can generally be unnamed1. Unnamed objects have exactly one host object and cannot be reused by other
objects2. Some objects like functions and applications are reusable by definition, so they
must be named.3. Object names can generally be non-unique. Application and function names must
be unique, However objects can be renamed
BRFplus Workbench Text and Documentation Usage
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 61/127
61
BRFplus Workbench Text and Documentation Usage
BRFplus objects can be enriched with texts and documentation
Text up to 20 charactersText up to 80 characters
BRFplus Workbench - Data Objects
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 62/127
62
BRFplus Workbench - Data Objects
1. Data objects make it possible to keep track of values during rule processing.
2. Data objects carry values in BRFplus. They can be bound to existing DDIC-types,from which they derive characteristics such as type, size and texts. Thesecharacteristics can also be set individually in case that no DDIC binding is needed.
3. In Some cases the creation of a data object is not needed. Instead a default dataobject can be used.
4. Different Kinds of data objects make it possible to tailor the design of a ruleapplication.
5. Data Object determines the type of data that can be handled by other BRFplusobjects and serve as data carriers.
BRFplus Workbench - Data Objects: Types of Elements
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 63/127
63
BRFplus Workbench - Data Objects: Types of Elements
There are three different kinds of data object:
Elements
Structures
Tables
BRFplus Workbench - Data Objects: Element Properties
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 64/127
64
BRFplus Workbench Data Objects: Element Properties
Text Element as an Example data object
This screen shows the Element properties tab for the Text element.It is divided into three sections1. The first section enables the binding Of a DDIC type.
2. The second section defines the element type and what comparisons are allowedfor this element (For example: it might not be allowed to use a “Larger than… “operator for a specific number element).
3. The last section defines length of the Data element.
BRFplus Workbench - Data Objects: Element – Domain Values
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 65/127
65
BRFplus Workbench Data Objects: Element Domain Values
1. Unbound Elements can be enhanced with Domain Values.
2. These domain values become available whenever this element is displayed in theBRFplus workbench
BRFplus Workbench - Data Objects: Element – Message Check
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 66/127
66
BRFplus Workbench Data Objects: Element Message Check
1. Check Message behavior can be adjusted for each element.
2. Whenever a BRFplus object is checked for consistency, a message is displayedfor the check results. The type for these messages can be defined in theadditional properties tab.
3. This can apply for :Existence checks (whether a value is among the domain values for the element)Comparison checks ( whether the used operator is allowed for the element)
BRFplus Workbench - Data Objects: Structure
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 67/127
67
BRFplus Workbench Data Objects: Structure
Example of Structure
BRFplus Workbench - Data Objects: Table
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 68/127
68
BRFplus Workbench Data Objects: Table
Example of Table
Calling BRFPlus From Backend
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 69/127
69
g
• Calling a BRF Function from ABAP1. The ABAP environment can be used to call a BRFPlus Function.
2. A Possible way to code this is presented below using BADI’s, Program exits,Function Modules can be used as needed3. Use Standard Program FDT_TEMPLATE_FUNCTION_PROCESS to
generate the BRFPlus code
• Calling BRFPlus Function via web service.
BRFplus Workbench - Calling Function from Backend
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 70/127
70
p g
• Calling BRFplus Function via an ABAP Function Module
1. A Function Module for a RFC can also be generated using the web servicegeneration feature. This function module can be called from other systems orapplications using the RFC protocol
BRFplus Workbench – Sample Expressions
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 71/127
71
p p p
Procedure CallThe procedure call expression type enables the execution of an ABAP static method
or function module. The expression is thus able to pass the parameters, as well asreceive the results, making it possible to implement powerful logic.
DB LookupThe DB Lookup expression type enables the access to database tables to check orretrieve data according to a flexible construct of parameters.
Table operation
The table operation expression type allows the handling of table objects through theexecution of common operations such as deletions, row count determination, sortingand the determination of averages, among many others.
BRFplus Workbench – Predefined Expressions Types
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 72/127
72
p p yp
Boolean Expression
BRMS Connector Expression Case Expression Constant Expression DB Lookup Expression Decision Table Expression Decision Tree Expression Dynamic Expression Formula Expression
Function Call Expression Loop Expression Procedure Call Expression Random Number Expression Search Tree Expression Step Sequence Expression Table Operation Expression Value Range Expression XSL Transformation Expression
BRFplus Workbench – Commonly Used Expressions
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 73/127
73
p y p
Expressions
Static
MethodCall
DecisionTable
Decision
Tree
Formula
DatabaseLookup
FunctionCall
Loop
Rule
TableOperations
BRFplus Workbench – Decision Table
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 74/127
74
The Decision Table expression type offers a powerful way to Expressbusiness rules:
1. Decision tables primarily consists of rows and columns. The columns are furtherdivided in condition columns and results columns.
2. When a Decision table expression is called, every row is processed in sequence.In each row, every condition column is processed from left to right. If the conditionin each input column cell of a row is met, the field values in the result columns arereturned.
3. It is possible to enter expressions of direct values in these cells. This enables theuse of deep, or nested, decision tables.
4. If is also possible to evaluate the values in each cell by using comparisonoperators, value ranges and pattern.
BRFplus Workbench – Decision Table Example
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 75/127
75
The Detailed section gives access to table operators with which rowscan be inserted, copied, edited and removed. The Table rows can be
moved and arranged as well, so that the most specific conditionare tested first. Finally table can be exported and imported to andfrom excel, and the table settings screen can be accessed.
BRFplus Workbench – Decision Table: Table settings
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 76/127
76
BRFplus Workbench – Decision Table
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 77/127
77
p
BRFplus Workbench – Formula
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 78/127
78
A wide array of calculations on data objects is made possiblewith the formula expression type
1. This includes mathematical operations as well as a large selection of formulafunctions. Context parameters, expressions results and direct values can be usedas well in these formulas.
2. A formula can be created with building blocks, or using direct text entry in expertmode.
3. 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, itis possible to define own formula functions.
BRFplus Workbench – Formula: Detail Area overview
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 79/127
79
Detail are overview:
1. Main Input Area
2. Context Parameters
3. Operators and input objects
4. Formula functions
BRFplus Workbench – Formula: Detail Area overview
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 80/127
80
Main Input area
1. A result data object can be defined for the formula expression. The input areshows the formula itself. In simple mode, the input cursor can be moved to insertnew operators and operands. These can also be deleted.
2. A switch to expert mode is also possible. In Expert mode it is possible to puttogether formulas using the object IDs and parameters in free text mode.
BRFplus Workbench – Formula: Detail Area overview
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 81/127
81
Context and Panel Button
1. The context panel contains all available context data objects that can bemanipulated in the formula.
2. The button panel inserts the displayed object or operand at the cursor location inthe input box.
3. The formula functions panel shows the available formula functions, which can befiltered by category and text.
BRFplus Workbench – Formula: Example
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 82/127
82
BRFplus Workbench – Case Expression
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 83/127
83
The case expression type maps input values to a defined set ofoutput values
1. This expression tests for the value of an expression or context parameters amonga list of defined cases. If one of these cases applies, its corresponding returnvalue is given back
BRFplus Workbench – Decision Tree
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 84/127
84
The Decision Tree is a binary tree that is traversed in sequence.
1. Each level has a condition that can be evaluated to true or false. The next levelcan be a condition or the end result. This result can be a value or an action
BRFplus Workbench – Search Tree
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 85/127
85
A Search tree may have an arbitrary amount nodes at each level.
1. In contrast to the decision tree, the search tree can have nodes with bothconditions and result.
2. The results match node determines how results are evaluated. Multiple matchmode for example returns all matches that were found in the tree.
BRFplus Workbench – Boolean
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 86/127
86
Boolean expressions can be built with a template or free style.
1. A Boolean expression is built with concatenated Boolean values or conditions,using Boolean operators ( AND, OR, NOT).
2. Existing templates can be used to build the expression.
BRFplus Workbench – DB Lookup
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 87/127
87
Database tables can be checked or read with this expression.
There are three different modes:
1. Data retrieval: Either single or multiple lines can be read.
2. Aggregation: A single value is aggregated using one of the following functions:Minimum, Maximum, Average, Sum or count.
3. Existence check: Only the existence of at least one table line is checked. Returnsa Boolean value.
4. Several conditions can be defined for each mode, with both inclusion andexclusion entries.
BRFplus Workbench – Procedure Call Example
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 88/127
88
BRFplus Workbench – Action Types
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 89/127
89
Action are special type of expressions that are similar toexpressions, but do not return a result value
1. They trigger changes and notifications outside of BRFplus, using contextparameters or nested expressions as inputs.
2. The execution of action can trigger the execution of subsequent actions.3. Action are instances of action types.4. Action can define follow-up actions that will be executed in the defined order.
BRFplus Workbench – Action Types
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 90/127
90
Actions
ContextChange
Message
Log
StaticMethod
CallSend Mail
Start
Workflow
BRFplus Workbench – Action Types: Send Email
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 91/127
91
Send Email: The send email action type makes it possible to createand send an email when being executed. Elements like the
recipients, the subject and the body can be enriched with the valuesderived from context parameters or nested expressions.
1. It is possible to include placeholders in the texts to include variables such ascontext parameters
2. The addressees can be determined dynamically as well.
BRFplus Workbench – Action Types: Send Email
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 92/127
92
Start Workflow: The start workflow action type enables the rule to trigger a specificworkflow in the system. A workflow can then be used to trigger other tasks or invoke
the decisions of persons or agents.
Functional Mode Function : Example
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 93/127
93
Go to Properties Tab
Change the mode as Functional Mode
Enter the Top Expression for the Function byclicking on Create
Functional Mode Function : Example
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 94/127
94
First Screen of Formula
Specify Result data Object as EV_SYSID
Write Formula in the space
and activate the formula
Go back to the function
Functional Mode Function : Example
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 95/127
95
Activate the Functionas well
Simulate the Function to test itsfunctionality
Click on Start Simulation Button
Functional Mode Function : Example
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 96/127
96
Trace Result
BRFplus Workbench – Tools and Administration
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 97/127
97
1. BRFplus provides a set off supportive tools that is accessible via the tools menu.2. To Access specific tool, the user must have the required authorization.
Authorization object FDT_WORKB, field FDT_WB_ACT is used for this purpose.3. Each tool corresponds to specific numeric value for this field. The values arelisted in the documentation for the field in the transaction SU21, Alternatively theycan be retrieved from the domain FDT_WORKBENCH_ACTIVITY.
Rule Creation Process – Simulation
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 98/127
98
BRFplus Workbench – Tools and Administration
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 99/127
99
1. Simulation – Testing and debugging purpose
2. Application Administration – Manager Objects
3. Application Usage – Interrelationships among applications
4. Transport Analysis – Transports can be analyzed and corrected
5. Web service – web service call for a function can be generated
6. XML Export – BRF plus objects can be exported into XML file
7. XML Import – BRF plus objects can be imported from an XML file
BRFplus Workbench – Simulation Tool
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 100/127
100
1. With the Simulation tool a function can be processed for testing or Debuggingpurpose.
2. Only Last active version of the function and its referenced objects will besimulated.
3. The tool can be invoked either from TOOLS menu or also directly from the tool barin the DETAIL section of the function UI as depicted below.
4. When simulating the Function, you can enter respective input parameters
5. The simulation mode can be either show only result or show also results ofintermediate steps
BRFplus Workbench – Simulation Tool
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 101/127
101
BRFplus Workbench – Show only Result
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 102/127
102
BRFplus Workbench – Show also results of intermediate steps
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 103/127
103
BRFplus Workbench – Mass Testing
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 104/127
104
1. The simulation tool can also be used for mass testing.2. It supports import test data for the context parameters from a Microsoft excel
sheet.3. For importing there is a limitation that table data objects are not supported. Iftable data objects are part of the function context the import button is disabled.
4. When Button is clicked on , the section CONTEXT EXPORT/IMPORT that isdepicted as shown below
BRFplus Workbench – Mass Testing
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 105/127
105
BRFplus Workbench – Web service Generation tool
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 106/127
106
A BRFplus function can be regarded as a local interface to abusiness rule service.
If need arises to call such a service from external system, you couldmanually develop a web service that acts as a connector to theBRFplus function.
The Web service generation tool allows you to create such a Webservice without having to program a single line of code.
Pre-requisites:-1. Starting with SAP NetWeaver 7.02, SAP_BC_WEBSERVICE_ADMIN_TEC rolecan be assigned for Web service creation.
2. First, the tool creates a Remote Function Call module(RFC) in ABAP with aninterface that matches the intended BRFplus function.
3. The function context is mapped to importing parameters, whereas the result dataobject is mapped to an exporting parameter.
4. Second, a Web service definition that connects to the RFC is generated.
Note: Can be used only for BRFplus functions with flat context and results.
BRFplus Workbench – Invocation
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 107/127
107
The Web service generation tool can be invoked in the workbencheither from the TOOLS menu or in the function UI from the toolbarof the DETAIL section as shown below
BRFplus Workbench – Web service Generation tool
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 108/127
108
BRFplus Workbench – XML Export and Import
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 109/127
109
1. The BRFplus XML export and import functionality lets you transfer one or moreBRFplus objects from one system to another, assuming that both systems supportBRFplus.
2. Only the current active version of the BRFplus objects can be exported.3. An XML file is generated for the exported objects. From this file, the objects can be
imported to the target system.
Need for XML Export and Import Although BRFplus provides transport functionality, the need for XML exportand import arises in the following scenarios:
BRFplus content needs to be transferred to other SAP systems that arenot connected to the SAP transport system.
BRFplus content needs to be published to non-SAP systems.BRFplus content needs to be corrected with the use of an SAP note.
BRFplus Workbench – XML Export and Import
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 110/127
110
SchemaExternal and internal schema types are supported by BRFplus. The schematype information is stored in the root element FDT in the attribute
BRFplusSchema.Internal Schema Type
This is the default schema type. The names are capitalized and anunderscore is used as a word separator. Also, the values are abbreviationsof the actual description. For example,
<FDTNS:DATA_OBJECT_TYPE>E</FDTNS:DATA_OBJECT_TYPE><FDTNS:ELEMENT_TYPE>T</FDTNS:ELEMENT_TYPE>
External Schema Type
The names are formatted according to the upper camel case scheme. Thereis no underscore separating the words. The values are actual description ofabbreviations. For example,
<FDTNS:DataObjectTypeFixedValue="E">Element</FDTNS:DataObjectType><FDTNS:ElementType FixedValue="T">Text</FDTNS:ElementType>
BRFplus Workbench – XML Export
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 111/127
111
The XML export tool allow you to generate an XML file for selected Objects or even awhole application.
The file will contain all data that is required to recreate the last active versions of theobject.
Previous versions of inactive versions cannot be exported with the tool. This can onlybe achieved via the API.
Together with the XML import tool it is possible to move or copy objects from one
system to another without using ABAP transports.
The XML export tool needs to be run in the source system.
Exporting Process is divided into three major steps:-1. Select an object2. Generate XML File3. Download XML File
BRFplus Workbench – XML Export
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 112/127
112
BRFplus Workbench – XML Export: Select an object
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 113/127
113
BRFplus Workbench – XML Export: Generate XML file
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 114/127
114
BRFplus Workbench – XML Export: Generate XML file
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 115/127
115
BRFplus Workbench – XML Export: Download XML file
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 116/127
116
BRFplus Workbench – XML Import Tool
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 117/127
117
The XML import tool needs to be run in the target system. it requires first an XML filethat contains the desired, previously exported BRFplus objects.
The XML version of the file must be lower than or equal to the highest supportedversion which is displayed just above the button UPLOAD FILE.
BRFplus Workbench – XML Import Tool
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 118/127
118
BRFplus Workbench – XML Import Tool: Test Run
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 119/127
119
BRFplus Workbench – XML Import Tool: Imported
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 120/127
120
1. The XML import is internally handled similar to import of a transportrequest.
2. An ID starting with $X2 for a virtual transport request will be generatedand displayed in the success message.3. The ID allows tracking the origin of the imported object version.4. An Alternative to the tool in the workbench is report
FDT_XML_IMPORT.5. In addition to the standard XML import, it supports a “repair mode” to fix
corrupt objects.
Rule Creation Process – Simulation
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 121/127
121
BRFplus Workbench - Implement Function Call
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 122/127
122
BRFplus Workbench - Implement Function Call
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 123/127
123
Tips and Tricks
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 124/127
124
The following naming conventions apply in the BRF
A remote function call always cause some overhead with respect to resources and
Runtime. Data has to be packaged, sent over a network with unknown traffic andunpackaged again
Calling remote function module asynchronously usually causes further delays
Web services require more memory and processing resources than remote functionCalls
Note: The overhead for remote communication can be reduced significantly if it ispossible to bundle multiple BRFplus function calls into one remote call.
Objects SAP Namesspace Customer/Parter Namespace
Application classes0 to 9 (such as 0FLIGHT)
A to WX to Z
Namespace prefix /MY_COMPANY/
BRF events0 to 9
A to W X to Z
Other BRF objects Prefix from 0 to 9 A to Z
Tips and Tricks
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 125/127
125
If the Functions is called Locally, there are two different approaches that mainlyinfluence the performance.
1. Method IF_FDT_FUNCTION~PROCESS can be called for an object instance ofthe corresponding function.
Advantage: This is easy to implement and understand.Disadvantage: It requires loading the function and possibly the also related dataObjects from the database. Thus performs worst than the second approach.
2. The static Method CL_FDT_FUNCTION_PROCESS=>PROCESS can be calledwithout instantiating any objects. Context data can be passed by referencevariables. If the context data is formatted according to BRFplus specific data types,the rule processing can start with almost no delay
Difference call types roughly be ordered with respect to decreasing performance1. Local, Static method call2. Local method call on a function instance
3. Remote Function call4. Web service
Hands on exercises
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 126/127
126
1. Set Delivery Block(VBAK-FAKSK) to “01” for Sales Orders of document type“OR”
2. Set up below rule based on input parameters to calculate SKU.
Input
PRODUCT AG
OCCASION Wedding
PLAN ART UNITS 1000
BUDGET ARTUNITS 1500
Decision Table
Product Line Occasion Complexity Percent
AG Wedding Complex 30%
AG Wedding Medium 20%
AG Wedding Simple 10%
condition output
OutputComplexity Percent Budget Plan
Complex 30 300 450
Medium 20 200 300
Simple 10 100 150
Th k Y
8/10/2019 BRFplus - Training Material
http://slidepdf.com/reader/full/brfplus-training-material 127/127
Thank You