Sei sulla pagina 1di 11

SAP NetWeaver

SAP NetWeaver
How-To Guide
How-To Guide

How To: DSM-Decision Service


Management / BRFplus in BW-IP

Applicable Releases:
SAP NetWeaver BW 7.40, SP12 and higher

Topic Area:
Business Data Warehousing

Version 1.0
June 2015
Copyright 2015 SAP AG. All rights reserved. These materials are subject to change without notice.
No part of this publication may be reproduced or These materials are provided by SAP AG and its affiliated
transmitted in any form or for any purpose without the companies ("SAP Group") for informational purposes only,
express permission of SAP AG. The information contained without representation or warranty of any kind, and SAP
herein may be changed without prior notice. Group shall not be liable for errors or omissions with
Some software products marketed by SAP AG and its respect to the materials. The only warranties for SAP
distributors contain proprietary software components of Group products and services are those that are set forth in
other software vendors. the express warranty statements accompanying such
products and services, if any. Nothing herein should be
Microsoft, Windows, Outlook, and PowerPoint are
construed as constituting an additional warranty.
registered trademarks of Microsoft Corporation.
These materials are provided as is without a warranty of
IBM, DB2, DB2 Universal Database, OS/2, Parallel
any kind, either express or implied, including but not
Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390,
limited to, the implied warranties of merchantability,
OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP,
fitness for a particular purpose, or non-infringement.
Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix,
i5/OS, POWER, POWER5, OpenPower and PowerPC are SAP shall not be liable for damages of any kind including
trademarks or registered trademarks of IBM Corporation. without limitation direct, special, indirect, or consequential
damages that may result from the use of these materials.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader
are either trademarks or registered trademarks of Adobe SAP does not warrant the accuracy or completeness of the
Systems Incorporated in the United States and/or other information, text, graphics, links or other items contained
countries. within these materials. SAP has no control over the
information that you may access through the use of hot
Oracle is a registered trademark of Oracle Corporation.
links contained in these materials and does not endorse
UNIX, X/Open, OSF/1, and Motif are registered
your use of third party web pages nor provide any warranty
trademarks of the Open Group.
whatsoever relating to third party web pages.
Citrix, ICA, Program Neighborhood, MetaFrame,
SAP NetWeaver How-to Guides are intended to simplify
WinFrame, VideoFrame, and MultiWin are trademarks or
the product implementation. While specific product
registered trademarks of Citrix Systems, Inc.
features and procedures typically are explained in a
HTML, XML, XHTML and W3C are trademarks or practical business context, it is not implied that those
registered trademarks of W3C, World Wide Web features and procedures are the only approach in solving a
Consortium, Massachusetts Institute of Technology. specific business problem using SAP NetWeaver. Should
Java is a registered trademark of Sun Microsystems, Inc. you wish to receive additional information, clarification or
JavaScript is a registered trademark of Sun Microsystems, support, please refer to SAP Consulting.
Inc., used under license for technology invented and Any software coding and/or code lines / strings (Code)
implemented by Netscape. included in this documentation are only examples and are
MaxDB is a trademark of MySQL AB, Sweden. not intended to be used in a productive system
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP environment. The Code is only intended better explain and
NetWeaver, and other SAP products and services visualize the syntax and phrasing rules of certain coding.
mentioned herein as well as their respective logos are SAP does not warrant the correctness and completeness of
trademarks or registered trademarks of SAP AG in the Code given herein, and SAP shall not be liable for
Germany and in several other countries all over the world. errors or damages caused by the usage of the Code, except
All other product and service names mentioned are the if such damages were caused by SAP intentionally or
trademarks of their respective companies. Data contained grossly negligent.
in this document serves informational purposes only. Disclaimer
National product specifications may vary. Some components of this product are based on Java. Any
code change in these components may cause unpredictable
and severe malfunctions and is therefore expressively
prohibited, as is any decompilation of these components.
Any Java Source Code delivered with this product is only
to be used by SAPs Support Services and may not be
modified or altered in any way.
Document History
Document Version Description

1.00 First official release of this guide


Icons
Typographic Conventions
Icon Description
Type Style Description
Caution
Example Text Words or characters quoted
from the screen. These Note or Important
include field names, screen Example
titles, pushbuttons labels,
menu names, menu paths, Recommendation or Tip
and menu options.
Cross-references to other
documentation
Example text Emphasized words or
phrases in body text, graphic
titles, and table titles
Example text File and directory names and
their paths, messages,
names of variables and
parameters, source text, and
names of installation,
upgrade and database tools.
Example text User entry texts. These are
words or characters that you
enter in the system exactly as
they appear in the
documentation.
<Example Variable user entry. Angle
text> brackets indicate that you
replace these words and
characters with appropriate
entries to make entries in the
system.
EXAMPLE TEXT Keys on the keyboard, for
example, F2 or ENTER.
How To: DSM-Decision Service Management/BRFplus in BW-IP

Table of Contents
1. Scenario ...........................................................................................................................2

2. Example ...........................................................................................................................2

3. General Description of the Solution ...............................................................................2


3.1 Planning function type...............................................................................................2
3.2 Planning data in BRFplus..........................................................................................3
3.3 Reference data .........................................................................................................3
3.4 Data Mapping ...........................................................................................................3
Block Values planning data ....................................................................................3
Special Data Types: Amount, Quantity, Time ............................................................3

4. Tool to Create BRFplus Functions: Program RSPLS_BRFPLUS_TOOL.......................3

5. Lists .................................................................................................................................4
5.1 List of Parameters of the Planning Function Type with Special Meaning ....................4
5.2 List of BRFplus Data objects with Special Meaning ...................................................5

6. SAP-HANA .......................................................................................................................6

7. Additional information on DSM-Decision Service Management / BRFplus ..................6

8. Availability .......................................................................................................................6

June 2015 1
How To: DSM-Decision Service Management/BRFplus in BW-IP

1. Scenario
Existing planning function types allow implementing a wide range of planning scenarios. Nethertheless
you might look for an easy way to define additional planning functionality using DSM-Decision Service
Management / BRFplus.
BRFplus is SAPs rule engine which is widely used in the Business Suite for customer defined
validations, derivations and calculations. More information on BRFplus can be found below.

2. Example
An example for such a planning function type is a validation, where you want to return messages
when the planned values are not in an expected range. Such functionality can be easily implemented
with the rule engine BRFplus.
BRFplus allows defining a wide range of functionality like using decision tables, decision trees,
calculations, triggering Workflow events, and several other rules.
Typically you will create one or more rulesets for the BRFplus function and add a rule which performs
a loop on C_TH_DATA. Inside the loop you can evaluate the data row wise. You can also use such a
loop to calculate aggregated data or add new rows in C_TH_DATA or C_TH_RESULT_DATA or
E_T_MESSAGE. If you need variables for your calculations you can define them as part of the ruleset
or if you need them in several rulesets as additional context variables in the BRFplus function.

3. General Description of the Solution


3.1 Planning function type
If you want to use BRFplus in a planning function type you can create a planning function type which
refers to the utility class CL_RSPLFC_BRFPLUS_SRVTP.
Such a planning function type must have parameters to identify the BRFplus function which shall be
called when the planning function is executed. These parameters are 'IP_BRF_APPLICATION'
(identifying the BRFplus application in which the BRFplus function lies) and 'IP_BRF_FUNCTION'
(identifying the BRFplus function).
For more details and other parameters which steer the BRFplus Adapter functionality, please refer to
the List of Parameters of the Planning Function Type with Special Meaning below.
In addition to these parameters you can define parameters of type elementary and structure (flat or as
tables). These parameters will be transferred to BRFplus as context during BRFplus execution.
BRFplus context elements for these parameters must have the same name as the parameters in the
planning function type definition.
The names of parameters that you define must not start with IP_. Such names are reserved for some
additional features for such planning function types, which might be developed in future.
Also the names given in the List of BRFplus Data objects with Special Meaning must not be used as
parameter names in the planning function type.

June 2015 2
How To: DSM-Decision Service Management/BRFplus in BW-IP

3.2 Planning data in BRFplus


Planning data, reference data, and block-values are transferred to BRFplus processing in context
elements with fixed names. Please refer to the List of BRFplus Data objects with Special Meaning
below.
Messages you create in BRFplus (see parameter IP_MESSAGE_CONTEXT) are also returned in
such a context element (name E_T_MESSAGE).
All key figures are transferred as numbers to BRFplus.
If you use the parameter IP_RESULT_IS_DELTA with value X then the delta has to be returned in
the BRFplus result table with name C_TH_RESULT_DATA. If you do not use the parameter or the
parameter is set to value or # then the changes you calculate in the plan data have to be done in
context element C_TH_DATA.

3.3 Reference data


If you want to use reference data in the BRFplus function then you have to create an own class which
may inherit from class CL_RSPLFC_BRFPLUS_SRVTP. In your own class you need to redefine the
implementation of the interface IF_RSPLFA_SRVTYPE_IMP_EXEC_REF. Quite likely it will be
sufficient to redefine the methods GET_REF_DATA_SEL and ADD_NEW_BLOCKS.
The reference data are transferred to BRFplus in context element I_TH_REF_DATA.

3.4 Data Mapping

Block Values planning data


The block values are transferred to BRFplus in the context element I_S_BLOCK_VALUES. The
block characteristics (the characteristics which are not marked as to be changed) are not part of the
structure of C_TH_DATA.
In case you can (from a functional point of view) choose, whether you mark a characteristic as block
value please keep in mind: Making a characteristic as block value increases the number of BRF-plus
calls and decreases the data volume transferred and the required memory.

Special Data Types: Amount, Quantity, Time, Key Figures


The types of BRFplus data elements must fit to the types of the characteristics and the key figures.
BRFplus data elements for most types of characteristics must be created as BRFplus-text elements.
The key figures must be created as BRFplus-numbers. So the BRFplus concept of amount and
quantity is not supported by this BRFplus adaption - currencies and units for amounts and quantities
are transferred as BRFplus text elements.
The only special treatment of Info Objects is available for time characteristics of type DATS. These are
mapped to BRFplus data elements of type time point with time-point-type data. This is a result of the
DDIC-binding.

4. Tool to Create BRFplus Functions: Program


RSPLS_BRFPLUS_TOOL
It is recommended to create all required BRFplus objects with the tool report
RSPLS_BRFPLUS_TOOL

June 2015 3
How To: DSM-Decision Service Management/BRFplus in BW-IP

If you want to use the tool program RSPLS_BRFPLUS_TOOL in order to create a fitting BRFplus
function you need to create the planning function first. In particular you need to define, which
characteristics shall be changeable by the planning function and the values of the parameters
IP_MESSAGE_CONTEXT and IP_RESULT_IS_DELTA. These settings influence the required
interface of the BRFplus function.
The program will create the required BRFplus data objects (for aggregation level data, reference data
if required, block values if required, message table if required, result data if required and the
parameters from the planning function type). Additionally a function with these data objects as context
elements and, if required, the result data object is created.
The BRFplus application and BRFplus function can be assigned to the planning function afterwards.
If you change the setting, which characteristics can be changed, or the value of one of the parameters
IP_MESSAGE_CONTEXT and IP_RESULT_IS_DELTA after you created the BRFplus function you
need to adjust the BRFplus function manually or create a new BRFplus function. Please keep in mind
that all the BRFplus data objects will get new GUIDs if you create a new function and therefore the
BRFplus expressions and rulesets you create for the old BRFplus function will not be callable by a
new function.
Also changes in the planning function type might cause inconsistencies between the planning function
and the BRFplus function.
If there are characteristics used for conditions and you have defined several conditions then several
BRFplus functions will be created at once.
The program RSPLS_BRFPLUS_TOOL has a creation and a check mode.
For the creation mode the following program parameters are relevant:
Planning function

Name of an existing BRFplus application

Name for the new BRFplus function

If a BRFplus function exists with the given name or the planning function has a BRFplus function
assigned then the program does not create a new function but returns the function name. With a
double click on the name you can navigate to the BRFplus function.
The BRFplus function name and the BRFplus Application have to be assigned to the planning function
manually.
In the check mode you can check whether the planning function type is suitably defined or whether the
context elements of the BRFplus function assigned to planning function and the planning function fit to
each other.
So you can use this program in order to check whether the planning function and the BRFplus function
do still fit to each other, after changes of the Aggregation level, some parameters of the planning
function or the context definition of the BRFplus function have been done.

5. Lists
5.1 List of Parameters of the Planning Function Type
with Special Meaning
Parameter Name Mandat Description Constant Name in Class
ory CL_RSPLFC_BRFPLUS_SRV
TP

June 2015 4
How To: DSM-Decision Service Management/BRFplus in BW-IP

IP_BRF_APPLICATION Yes Parameter name for BRFplus G_C_PARAM_BRFPLUS_AP


Application Name PL
The Parameter type must be
Elementary. It is recommended to
define this parameter with the Info
Object 0RSPL_BRFAP.
IP_BRF_FUNCTION Yes Parameter Name for BRFplus G_C_PARAM_BRFPLUS_FU
Function Name NC
The Parameter type must be
Elementary. It is recommended to
define this parameter with the Info
Object 0RSPL_BRFFC.
IP_RESULT_IS_DELTA Optional BRFplus Result is a delta G_C_PARAM_DELTA_RESUL
The Parameter type must be T
Elementary. It is recommended to
define this parameter with the Info
Object 0BOOL.
IP_MESSAGE_CONTE Optional Function returns Messages. G_C_PARAM_MESSAGE_CO
XT The Parameter type must be NTEXT
Elementary. It is recommended to
define this parameter with the Info
Object 0BOOL.

5.2 List of BRFplus Data objects with Special


Meaning
BRFplus Data Object Remark Constant Name in Class:
Name CL_RSPLFC_BRFPLUS_SRV
TP
I_S_BLOCK_VALUES Block Values G_C_S_BLOCK_VALUES
S_DATA Structure for C_TH_DATA G_C_S_DATA
FDT_S_MESSAGE Structure for E_T_MESSAGE G_C_S_MESSAGE
S_REF_DATA Structure for I_TH_REF_DATA G_C_S_REF_DATA
S_RESULT Structure for C_TH_RESULT_DATA G_C_S_RESULT
C_TH_DATA Planning Data G_C_TH_DATA
E_T_MESSAGE Message Table G_C_TH_MESSAGE
I_TH_REF_DATA Reference Data G_C_TH_REF_DATA
C_TH_RESULT_DATA Result Data G_C_TH_RESULT

June 2015 5
How To: DSM-Decision Service Management/BRFplus in BW-IP

6. SAP-HANA
Planning function types build on this type will not run in memory.

7. Additional information on DSM-Decision


Service Management / BRFplus
You can find additional information on DSM-Decision Service Management / BRFplus here:
http://scn.sap.com/docs/DOC-29158
E-Book: https://websmp208.sap-ag.de/~sapidb/011000358700000002312012E/index.htm
A quite old but still informative blog on basics of BRFplus can be found here:
http://scn.sap.com/community/brm/blog/2008/05/15/about-business-rules
Please check also the documentation on DSM-Decision Service Management / BRFplus.

http://scn.sap.com/community/brm/blog/2013/09/27/sap-netweaver-decision-service-management-
let-s-talk-features

http://scn.sap.com/docs/DOC-8824

https://help.sap.com/saphelp_dsm10/helpdata/de/9a/6b67ce7c26446483af079719edf679/content.h
tm?current_toc=/de/cc/85414842c8470bb19b53038c4b5259/plain.htm&show_children=true

8. Availability
This functionality is available from
NW 7.40 SP
BRFplus is part of NetWeaver.

June 2015 6
www.sdn.sap.com