Top Banner
BRFplus – The API Way
29
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: sitFRA_ BRFplus_TheAPIWay

BRFplus – The API Way

Page 2: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 2

Contents

1. The Business Scenario

2. Solution Options

3. The API Way

4. Summary

Page 3: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 3

• 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

Page 4: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 4

• 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

Page 5: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 5

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

Page 6: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 6

Contents

1. The Business Scenario

2. Solution Options

3. The API Way

4. Summary

Page 7: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 7

• 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

Page 8: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 8

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 …

Page 9: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 9

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

Page 10: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 10

Unfortunately … yes: Storage and transportation of BRFplus objects

Approach Two – BRFplus

Image courtesy of stockimages at FreeDigitalPhotos.net

Are there any drawbacks … ?

Page 11: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 11

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

Page 12: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 12

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

Page 13: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 13

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

Page 14: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 14

Contents

1. The Business Scenario

2. Solution Options

3. The API Way

4. Summary

Page 15: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 15

• 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

Page 16: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 16

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

Page 17: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 17

Step 1 – Creation of the application

The API Way

Page 18: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 18

Step 2a – Fetching of reusable data elements

The API Way

Page 19: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 19

Step 2b – Creation of the empty decision table

The API Way

Page 20: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 20

Step 2b – Creation of the empty decision table

The API Way

Page 21: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 21

Step 3 – Creation of the function and linking decision table

The API Way

Page 22: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 22

The API Way – System Demo

Page 23: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 23

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

Page 24: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 24

Contents

1. The Business Scenario

2. Solution Options

3. The API Way

4. Summary

Page 25: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 25

• 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

Page 26: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 26

Questions?

Image courtesy of Master isolated images at FreeDigitalPhotos.net

Page 27: sitFRA_ BRFplus_TheAPIWay

Thank you for your attention.

21/03/2015SAP Inside Track Frankfurt 27

Dr. Christian Lechner

Business Unit Development

[email protected]@lechnerc77

http://scn.sap.com/people/christian.lechner

www.msg-systems.com

Page 28: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 28

• Overview on API: BRFplus - Business Rule Management for ABAP Applicationsby 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

Page 29: sitFRA_ BRFplus_TheAPIWay

21/03/2015SAP Inside Track Frankfurt 29

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