2. 21/03/2015SAP Inside Track Frankfurt2
Contents
1. The Business Scenario
2. Solution Options
3. The API Way
4. Summary
3. 21/03/2015SAP Inside Track Frankfurt3
• Policy Management of Industry Insurances
• Focus: Insurance for transportation of goods
• Processes are a little bit different compared to the individual insurance ☺
• Most important question: How is the premium calculated per transport?
The Business Scenario
Image courtesy of ddpavumba at FreeDigitalPhotos.net
4. 21/03/2015SAP Inside Track Frankfurt4
• Premium rate is individually negotiated between the insurer and the insured
• Premium depends on several parameters like:
− value of the transported good
− weight of the transported good
− packing of the transported good
− …
• For each combination of the parameters a premium is defined
• What do we finally have within the individual contracts?
A table consisting of condition columns and a result column … a decision table
Whenever a transport is reported the table gets evaluated and the calculated
premium gets collected
The Business Scenario – Premium Calculation
5. 21/03/2015SAP Inside Track Frankfurt5
Questions
• How do we get the contract individual decision tables into our policy
management system?
• How do we get the table evaluated within the reporting process on a policy?
The Business Scenario – Premium Calculation
6. 21/03/2015SAP Inside Track Frankfurt6
Contents
1. The Business Scenario
2. Solution Options
3. The API Way
4. Summary
7. 21/03/2015SAP Inside Track Frankfurt7
• Use an application table where the values are stored
(including relational operators)
• ABAP coding to evaluated the table and get the right result (hopefully)
Drawbacks
• Coding is Z-coding (or partner coding)
bug fixing!
• Functional features (e. g. check for completeness of table, Excel export/import)
have to be implemented
effort and bug fixing
Let’s see if we find a better approach
Approach One – “Classical” ABAP
8. 21/03/2015SAP Inside Track Frankfurt8
Correct: BRFplus as the ABAP based business rule management system offers
the framework including decision tables!
Approach Two – BRFplus
Image courtesy of stockimages at FreeDigitalPhotos.net
Isn’t there a tool that can help us with
decision tables …
9. 21/03/2015SAP Inside Track Frankfurt9
What does BRFplus offer in detail?
• Modeling environment to create, change, delete and display BRFplus objects
• Functions (decision services) that evaluate rules based on some input and
deliver a result
• Decision table object consisting of condition and result columns incl.
− Check for gaps
− Check for overlap
− Excel ex-/import
− Simulation options
− Optimization option for the table contents
− …
• Tracing e. g. in order to satisfy reporting requirements
Approach Two – BRFplus
10. 21/03/2015SAP Inside Track Frankfurt10
Unfortunately … yes: Storage and transportation of BRFplus objects
Approach Two – BRFplus
Image courtesy of stockimages at FreeDigitalPhotos.net
Are there any drawbacks … ?
11. 21/03/2015SAP Inside Track Frankfurt11
How are BRFplus objects stored and transported?
• System storage – storage in S-tables and transport via workbench requests
• Customizing storage – storage in C-table and transport via customizing requests
Transport is a no go!
We need master data to store the contract individual data
Approach Two – BRFplus
12. 21/03/2015SAP Inside Track Frankfurt12
How are BRFplus objects created?
• Via the BRFplus workbench
• Several modeling steps have to be done in order to have such a contract
individual BRFplus function
But we just want to enter the decision table data!
It is not intended to create the BRFplus function from scratch every time
Approach Two – BRFplus
13. 21/03/2015SAP Inside Track Frankfurt13
But there is a way out:
• Storage type: Master Data No transport
• Usage of the BRFplus API to handle the creation process
Approach Two – BRFplus
Image courtesy of chanpipat at FreeDigitalPhotos.net
14. 21/03/2015SAP Inside Track Frankfurt14
Contents
1. The Business Scenario
2. Solution Options
3. The API Way
4. Summary
15. 21/03/2015SAP Inside Track Frankfurt15
• The complete BRFplus is covered by an API
• The API allows the creation, update and deletion of every BRFplus objects
• In addition there is also a query object for selection of BRFplus objects
• There are several toolkits that simplify the handling of BRFplus objects
• How do we use this to solve the requirement?
− Whenever a new contract for transport insurance is created a new BRFplus application
is created in background (type master data)
− The application contains a function and an empty decision table
− The decision table can then be filled with values using a custom transaction
The API Way
16. 21/03/2015SAP Inside Track Frankfurt16
Step 0 – Creation of ReUse Application (precondition)
• All Data objects that are in use to define the decision table columns are stored
in one central S-type application reused in every master data application
The API Way
23. 21/03/2015SAP Inside Track Frankfurt23
Question: If the user enters the BRFplus workbench he can change anything in
the BRFplus, right?
Answer: Maybe ☺ - we created an application exit class that ensures that only the
decision table can be changed and contains additional authority checks
Question: What about the call of the function in the backend?
Answer: The call is generic. The UUID of the function is stored in the contract
The API Way – Further Aspects
24. 21/03/2015SAP Inside Track Frankfurt24
Contents
1. The Business Scenario
2. Solution Options
3. The API Way
4. Summary
25. 21/03/2015SAP Inside Track Frankfurt25
• BRFplus is far more than just the BRFplus workbench
• BRFplus offers a full blown API in order to create, modify, delete and query each
and every BRFplus object
• The BRFplus API is designed fully object oriented and is very intuitive to use
• Several functionalities are extracted into toolkits/service functionalities in order
to decrease the implementation effort
• BRFplus is very flexible with respect to customer specific adoptions
• Do not forget about the BRFplus storage type master data ☺
Summary
26. 21/03/2015SAP Inside Track Frankfurt26
Questions?
Image courtesy of Master isolated images at FreeDigitalPhotos.net
27. Thank you for your attention.
21/03/2015SAP Inside Track Frankfurt27
Dr. Christian Lechner
Business Unit Development
christian.lechner@msg-systems.com
@lechnerc77
http://scn.sap.com/people/christian.lechner
www.msg-systems.com
28. 21/03/2015SAP Inside Track Frankfurt28
• Overview on API:
BRFplus - Business Rule Management for ABAP Applications
by Thomas Albrecht, Carsten Ziegler (SAP PRESS; 2010)
• Blog posts on API usage (SCN):
− http://scn.sap.com/community/brm/blog/2014/10/23/handling-of-applications-with-the-brf-
api-part-1
− http://scn.sap.com/community/brm/blog/2014/10/26/handling-of-applications-with-the-brf-
api-part-2
• Document on query aspect of API (SCN):
http://scn.sap.com/docs/DOC-4585
Appendix
29. 21/03/2015SAP Inside Track Frankfurt29
Step 0 – Creation of the custom transaction (precondition)
• A custom transaction is created in order to call the BRFplus workbench and
target it to one specific BRFplus object S
Custom Transaction