how to implement the runlogic ph keyword in sap...

31
SAP BusinessObjects EPM How-To Guide How To… Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning & Consolidation, version for NetWeaver Applicable Releases: SAP Business Objects Planning and Consolidation 10.0, version for NetWeaver, SP06 and higher. SAP Business Objects Planning and Consolidation 7.5, version for NetWeaver, SP04 and higher. Version 1.0 January 2013

Upload: phungtruc

Post on 22-Feb-2018

288 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

SAP BusinessObjects EPM

How-To Guide

How To… Implement the

RUNLOGIC_PH Keyword in SAP

Business Objects Planning &

Consolidation, version for

NetWeaver

Applicable Releases:

SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver, SP06 and higher.

SAP Business Objects Planning and Consolidation 7.5, version for

NetWeaver, SP04 and higher.

Version 1.0

January 2013

Page 2: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

© Copyright 2013 SAP AG. All rights reserved.

No part of this publication may be reproduced or

transmitted in any form or for any purpose without the

express permission of SAP AG. The information contained

herein may be changed without prior notice.

Some software products marketed by SAP AG and its

distributors contain proprietary software components of

other software vendors.

Microsoft, Windows, Outlook, and PowerPoint are

registered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, OS/2, Parallel

Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390,

OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP,

Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix,

i5/OS, POWER, POWER5, OpenPower and PowerPC are

trademarks or registered trademarks of IBM Corporation.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader

are either trademarks or registered trademarks of Adobe

Systems Incorporated in the United States and/or other

countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered

trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame,

WinFrame, VideoFrame, and MultiWin are trademarks or

registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or

registered trademarks of W3C®, World Wide Web

Consortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems,

Inc., used under license for technology invented and

implemented by Netscape.

MaxDB is a trademark of MySQL AB, Sweden.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP

NetWeaver, and other SAP products and services

mentioned herein as well as their respective logos are

trademarks or registered trademarks of SAP AG in

Germany and in several other countries all over the world.

All other product and service names mentioned are the

trademarks of their respective companies. Data contained

in this document serves informational purposes only.

National product specifications may vary.

These materials are subject to change without notice.

These materials are provided by SAP AG and its affiliated

companies ("SAP Group") for informational purposes only,

without representation or warranty of any kind, and SAP

Group shall not be liable for errors or omissions with

respect to the materials. The only warranties for SAP

Group products and services are those that are set forth in

the express warranty statements accompanying such

products and services, if any. Nothing herein should be

construed as constituting an additional warranty.

These materials are provided “as is” without a warranty of

any kind, either express or implied, including but not

limited to, the implied warranties of merchantability,

fitness for a particular purpose, or non-infringement.

SAP shall not be liable for damages of any kind including

without limitation direct, special, indirect, or consequential

damages that may result from the use of these materials.

SAP does not warrant the accuracy or completeness of the

information, text, graphics, links or other items contained

within these materials. SAP has no control over the

information that you may access through the use of hot

links contained in these materials and does not endorse

your use of third party web pages nor provide any warranty

whatsoever relating to third party web pages.

SAP NetWeaver “How-to” Guides are intended to simplify

the product implementation. While specific product

features and procedures typically are explained in a

practical business context, it is not implied that those

features and procedures are the only approach in solving a

specific business problem using SAP NetWeaver. Should

you wish to receive additional information, clarification or

support, please refer to SAP Consulting.

Any software coding and/or code lines / strings (“Code”)

included in this documentation are only examples and are

not intended to be used in a productive system

environment. The Code is only intended better explain and

visualize the syntax and phrasing rules of certain coding.

SAP does not warrant the correctness and completeness of

the Code given herein, and SAP shall not be liable for

errors or damages caused by the usage of the Code, except

if such damages were caused by SAP intentionally or

grossly negligent.

Disclaimer

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 SAP’s Support Services and may not be

modified or altered in any way.

Page 3: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

Document History

Document Version Description

1.00 Initial version of this guide

Page 4: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

Typographic Conventions

Type Style Description

Example Text Words or characters quoted

from the screen. These

include field names, screen

titles, pushbuttons labels,

menu names, menu paths,

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

text>

Variable user entry. Angle

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.

Icons

Icon Description

Caution

Note or Important

Example

Recommendation or Tip

Page 5: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

Table of Contents

Document History ...................................................................................................................... 1

Typographic Conventions ....................................................................................................... 1

Icons1

Table of Contents ....................................................................................................................... 1

1. Business Scenario ............................................................................................................... 1

1.1 Calling other Scripts and the Push vs. Pull Concept .................................................... 1

1.2 Improving the Performance of Individual Scripts .......................................................... 2

2. Background Information ..................................................................................................... 4

2.1 More Information on the RUNLOGIC_PH Keyword ..................................................... 4

2.2 BPC NetWeaver RUNLOGIC_PH Keyword Algorithm ................................................. 6

2.2.1 The BAdI “DIMENSION” Parameter ................................................................ 7

2.2.2 The BAdI “CHANGED” Parameter ................................................................... 8

2.2.3 Nesting RUNLOGIC_PH Statements .............................................................. 9

2.2.4 Locking Issues ................................................................................................. 9

Calling Logic:CALLING_LOGIC.LGF ............................................................................................ 9

QUERY = OFF .................................................................................................................................. 9

WRITE = ON ..................................................................................................................................... 9

Called Logic:CALLED_LOGIC.LGF ............................................................................................... 9

ENTITY_3 = ENTITY_1 + ENTITY_2 ............................................................................................... 9

2.2.5 Background vs. Dialogue Processes ............................................................... 9

2.2.6 Enhancements to the BPC 7.5 version of RUNLOGIC_PH Keyword ........... 10

2.3 More Information on the BAdI Framework ................................................................. 11

3. Prerequisites ...................................................................................................................... 12

4. Step-by-Step Procedure .................................................................................................... 13

4.1 Import the attached ABAP transport ........................................................................... 15

4.2 Parallel Degree Setup ................................................................................................ 15

4.3 Parallelize by a Dimension Combination .................................................................... 18

4.3.1 Identify Original Script .................................................................................... 18

4.3.2 Create a New Script for Testing ..................................................................... 18

4.3.3 Create the Calling Script (RUNLOGIC_PH) .................................................. 19

4.3.4 Run the Calling Script (RUNLOGIC_PH) ....................................................... 19

4.4 Parallelize by a Property ............................................................................................. 20

4.4.1 Create the new Calling Script (RUNLOGIC_PH) ........................................... 20

4.4.2 Run the Calling Script (RUNLOGIC_PH) ....................................................... 21

4.5 Parallelize by a Hierarchy Node ................................................................................. 22

4.5.1 Create the new Calling Script (RUNLOGIC_PH) ........................................... 22

4.5.2 Run the Calling Script (RUNLOGIC_PH) ....................................................... 23

5. Appendix ............................................................................................................................ 24

Page 6: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

NOTE: delivered within an ABAP package named "ZBPC" ..................................................... 24

CALC_SALES.LGF from Section 4.3.2 ....................................................................................... 24

CAL_SALES_DIM_COMBO.LGF from Section 4.3.3 ................................................................. 24

CALC_SALES_PROPERTY.LGF from Section 4.4.1 ................................................................. 24

CALC_SALES_HIERARCHY.LGF from Section 4.5.1 ................................................................ 24

Page 7: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 1

1. Business Scenario

SAP Business Objects Planning & Consolidation can be installed on either a Microsoft or a NetWeaver

platform. While both platforms offer many of the same features and functionalities, there are a few key

differences. One of these differences is the support of Script Logic Keywords that have been

delivered with the installation. Currently, the RUNLOGIC Keyword is not delivered with SAP

BusinessObjects Planning and Consolidation, version for Netweaver (hereafter refered to as: BPC

NetWeaver or BPC).

Fortunately, the BPC NetWeaver Script Logic Business AddIn (BAdI) provides an enhancement option

that allows you to define your own Script Logic Keywords. Using the BAdI implementation in this

guide as an example, we will show you how to define your own custom version of the RUNLOGIC

Keyword in BPC NetWeaver (For more detailed background information about the RUNLOGIC

Keyword, and the SAP BAdI Framework, see Section 2).

1.1 Calling other Scripts and the Push vs. Pull Concept

Many businesses already have some type of central script which contains references or includes to

other scripts in the same Model – allowing them to define the exact order of scripts which are

executed in a single run. This is a very useful feature for organizing and controlling which scripts are

to be executed at what time. In fact, the RUNLOGIC_PH Keyword allows you to do this same action

on a more global scale, giving you the powerful capability of calling any script logic file which has been

defined in the BPC NetWeaver system.

The screenshot below represents a very simple illustration of how you can use RUNLOGIC_PH to call

a script defined in another Model (or Environment):

Executing Script Logic from another BPC Model

DEMAND BPC Model SUPPLY BPC Model

Script Execution takes place from the “SUPPLY” context

Outcome of Script Actions

Business Process

Script

Script

Let’s say you have modeled three different BPC Models in BPC NetWeaver; Supply, Demand, and

Finance (a simplified sales and operational planning scenario). In the Supply Model, the data is

modeled by Product, Raw Material and Capacity Asset (for ex: production_line_1). In the Demand

Model, the data is modeled by Product and Customer. Both Models represent valid but different

business views, each affecting the outcome of projected sales and revenue. For the sake of this

example, we can assume the following:

In the Demand Model, a planner plans Demand Volume (how much the business sells).

Page 8: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 2

In the Supply Model, a planner plans Production Volume (how much the business produces).

During the Production planning process, the planner analyzes both Production Volume and Inventory

of Product in the Supply Model. Inventory can be defined as a calculation in the Supply Model which

is based on Production Volume and Demand Volume:

Ending Inventory = Beginning Inventory + Production Volume – Demand Volume

In order to obtain an accurate calculation of Inventory, the planner will need to know how much

product the business will sell at any point during his/her planning process. It is during this process that

the Production planner would like to pull in the most recent plan of Demand Volume from the Demand

Model in order to review and determine its impact on inventory. Furthermore, the Production Planner

would like to stay in his/her own context while performing this review without any additional steps.

For the purposes of this example, let’s say you have already defined a script in the Demand Model

which sends the Demand Volume to the Supply Model. You can then configure the RUNLOGIC_PH

Keyword in the Supply Model to call this script, so that the user can get the latest Demand Volume

without having to change his/her context to the Demand Model and pushing from there. This is a

subtle but useful technique in designing BPC Models which use data from different areas in order to

obtain up to date and holistic views of the entire BPC Data Model.

1.2 Improving the Performance of Individual Scripts

In addition to providing you with the capability to call script logic files from other Models and

Environments, this custom RUNLOGIC_PH Keyword also gives you the advantage of using a new

parallelization technique that can greatly improve the performance of the script you are calling.

Quite often, businesses have defined their calculations to be executed across similar sets of data. By

changing a few members of certain driver based dimensions like Entity, Time, and so on, the business

could perform a calculation that covers a very large set of data but with very similar semantic

operations. In cases when the data from one set will not affect the data from another set these

operations can run in parallel processes (for example if you are performing the same calculation

across all time periods of a given year). While this can also be achieved by scheduling many Data

Manager Packages to run on different regions of data in parallel, this approach can be tedious and

inflexible.

The screenshot below represents a very simple illustration of how you can use RUNLOGIC_PH to

break up the data sets semantically and execute the script on each one in parallel:

Page 9: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 3

This guide will show you how to use the BPC NetWeaver version of the RUNLOGIC_PH Keyword to

specify different data sets automatically while running these scripts in parallel. Using the approach

described in this guide we can greatly improve the performance of individual scripts. While there are

no doubt many different factors that can contribute to performance, proof of concept testing on a

simple example showed an improvement of more than ten times by using just four parallel processes.

Let’s assume the same Demand Volume planning scenario described above, where the Demand

planner is trying to define how much volume of a product the business is trying to sell. Using the

same Demand Model described above of Customers to Products, we can assume that the data will be

spread across multiple Entities or Business Units. During the planning process, the Demand planner

has already created his/her baseline of Demand Volume as well as the projected Price for each

Product. Now the business needs to calculate a baseline Sales Amount for each Customer and

Product. This sales amount can be defined as a calculation in the Demand Model which is based on

the Projected Price and Demand Volume:

Projected Sales = Demand Volume * Projected Price

Unfortunately, if the number of combinations of Customers by Products by Entities is very high (in the

millions range) such a calculation can take hours to complete (in our internal testing it took more than

five hours to calculate a year’s worth of data across 4 Entities, 50 Customers, and 800 Products).

The solution to this problem can be implemented with the custom RUNLOGIC_PH Keyword delivered

in this guide. By using a driver dimension to semantically break up the data sets (such as Entity or

Business Unit) the RUNLOGIC_PH Keyword can execute the script logic file with multiple data sets,

each using its own dialogue process. The number of dialogue processes used by the new

RUNLOGIC_PH Keyword is determined by a BPC Parameter set either at the Environment level or the

Model level (Note that in case both are set the model parameter prevails). Special care should be

taken when setting this number since using too many processes can be detrimental to overall system

performance (see Section 4.1).

You should be careful when defining the driver/s for parallel execution because incorrect usage of this

feature can lead to negative system impacts. It is highly recommended that you study the algorithm

that this new RUNLOGIC_PH Keyword uses (See Section 2.2).

Be advised that this guide is only intended to provide you with a solution to create the RUNLOGIC_PH

Keyword and is not intended to fix all of your particular performance problems. Individual results will

always vary, and while this guide will show improvement in many different use cases, it may not be the

answer to your exact scenario.

Page 10: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 4

2. Background Information

2.1 More Information on the RUNLOGIC_PH Keyword

BPC provides the powerful option of using a built in Script Logic Engine to perform calculations on

BPC Application data. The Script Logic Engine is a very powerful piece of functionality within BPC.

The Engine is what reads the script written by a BPC Architect/Administrator and transforms it into

Application Logic that is executed on real BPC Model Data. For more detailed documentation of the

supported syntax and Keywords within the BPC NetWeaver Script Logic Framework, please refer to

the SAP Help Site for BPC Script Logic (See Section 3 – Additional Documentation).

Businesses choose to configure various scripts which can run either at the time of input or via the BPC

Data Manager Interface, depending on the business process and the functionality that is desired.

These scripts can be fashioned to perform many different combinations of calculations and formulas,

based on the Keywords and syntax that you use in the scripts. It is important to note that this guide is

only intended to cover a single Script Logic Keyword RUNLOGIC_PH.

SAP BusinessObjects Planning & Consolidation can be installed on either a Microsoft or a NetWeaver

platform. While both platforms offer many of the same features and functionalities, there are a few key

differences. One of these differences is the support of Script Logic Keywords that have been

delivered with the installation.

On the BPC Microsoft platform, the RUNLOGIC_PH Keyword gives you the ability to keep your

business users logged into their representative Application and run script logic files defined in other

Applications. They can execute these other scripts without changing their context to the other

Application model/view.

As described above, the primary function of the RUNLOGIC_PH Keyword gives you the ability to

redirect the execution of a script logic file. You can configure the RUNLOGIC_PH Keyword to call

another script logic file which has already been set up within BPC. This is useful, for example, if you

need to call a script logic file located in a different Model, or even a different Environment altogether.

This functionality allows you to perform your own string of logic calls or even design a “push” vs. “pull”

concept within your application architecture (See Section 1 for a business example).

In addition to changing where the execution of the script actually happens, the BPC Microsoft version

of the RUNLOGIC_PH Keyword also allows you to manipulate the data region passed to that script

logic file. This means you can potentially execute the script on a different data region for which the

logic was originally configured.

With the help of the Script Logic BAdI included in this guide, we can mimic the functionality of the BPC

Microsoft version of RUNLOGIC and also add our own enhancement for breaking up the script into

smaller data sets which can be run in parallel. For a detailed description of the algorithm used in the

custom BAdI version of the RUNLOGIC_PH Keyword, please refer to the next section (See Section

2.2). As in the Microsoft version, all Keyword parameters are optional except LOGIC. Note, however

that in the BPC NetWeaver implementation of RUNLOGIC, QUERY = OFF is highly recommended for

performance purposes (there should be no reason to set QUERY to any other value when using

RUNLOGIC_PH Keyword).

Page 11: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 5

The benefits of using this customized approach within BPC NetWeaver center around two key points:

The new Keyword will allow you to execute logic from various applications without logging

onto each one of them individually (i.e. same functionality as Microsoft version)

o This allows you to group and order your business calculations in a simplified and

centralized fashion using various “push” vs. “pull” designs.

The new Keyword can significantly improve the performance of individual scripts

o The script is run on smaller semantic data sets in parallel. This parallelization can

potentially drop the script runtimes down to fractions of the time taken for the

individual script execution.

The performance improvement mentioned here can greatly improve the overall perceived value of the

BPC implementation when used within DEFAULT logic (remember that DEFAULT logic is executed for

every save operation in a BPC Input Form/Schedule).

For example: If a calculation defined in DEFAULT logic takes one minute then every save takes

one minute (even if you are only updating one cell for example). Parallelization of the DEFAULT logic

may take this wait time down to several seconds in an optimal scenario. This means the user

experience has been dramatically improved – instead of waiting one minute for every save, the wait

time has been reduced to several seconds, giving the user a more productive and responsive work

session.

We should also mention that this new version of the RUNLOGIC_PH Keyword in BPC NetWeaver can

be used to speed up batch calculations as well. These batch calculations may take a really long time

to run as data volumes and models change. Normally batch calculations are executed during times

when the system activity is much lower. However, if the business users log in from multiple time

zones the batch time window may be much smaller and harder to meet. Improved script runtimes will

allow the business to schedule batch runs efficiently and in smaller time windows which will help to

increase overall business process efficiency.

Page 12: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 6

2.2 BPC NetWeaver RUNLOGIC_PH Keyword Algorithm

This section describes the algorithm used in the Script Logic BAdI delivered with this guide. It is

intended more as a reference for technical readers and may help you to write your own additions and

enhancements to the code.

1. Determine how many parallel processes can be used (the number of parallel processes can

be set at the Environment level as well as the Model level. If both exist the Model setting

prevails)

For example (applies to step 2 and 3): Model parameter was configured for TWO parallel

processes.

2. Determine the data sets used for parallel execution.

a. Based on Step 1 there are two processes available – Therefore the RUNLOGIC_PH

algorithm will only generate two data sets at a time (the data sets are based on the

RUNLOGIC_PH BAdI “CHANGED” Parameter).

b. This means that the maximum number of data sets that are running in memory at one

time is two.

c. The next data set will only be generated and executed when one of these two

processes becomes available.

For example: The RUNLOGIC_PH BAdI “CHANGED” Parameter has been configured with the

TIME and ENTITY dimensions. In this example, the RUNLOGIC_PH algorithm finds the first

two combinations of TIME and ENTITY members and will dispatch a process to execute the

script for each of those two data sets.

3. Execute the script for each data set from #2 above with the scope restricted to the

specification of the RUNLOGIC_PH BAdI “DIMENSION” Parameter.

a. The RUNLOGIC_PH BAdI will execute the called logic based on the first (or next)

available data set (from step 2).

b. This process will repeat until there are no more “idle” processes available (out of a

maximum of two, based on Step 1). When there are no more “idle” processes the

RUNLOGIC_PH algorithm will wait until another process becomes available. When

another process becomes available, the RUNLOGIC_PH algorithm will generate the

next data set and execute the called logic for that data set.

NOTE: This process will repeat until there are no more data sets available (where the total

number of data sets is the Cartesian product of the members from the dimensions defined in

the BAdI “CHANGED” Parameter). Keep in mind that the Cartesian product is based on the

set of members defined in the BAdI “DIMENSION” Parameters. If that dimension has not

been defined in the BAdI “DIMENSION” Parameter then the Cartesian product is based on the

scope which was passed to the BAdI. When running as a DEFAULT script, the scope is

defined by the current context and preceding *XDIM_... statements. When running the script in

a Data Manager Package, the scope is defined by Data Manager Prompts and preceding

*XDIM_... statements.

Page 13: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 7

2.2.1 The BAdI “DIMENSION” Parameter

The optional BAdI “DIMENSION” Parameter functionality is similar to the BPC Microsoft

RUNLOGIC_PH Keyword in that it will redefine the scope for the called logic. There is, however one

key difference: In BPC NetWeaver, a BAdI is always called wherever it is defined within the script. In

BPC Microsoft, the RUNLOGIC_PH Keyword is always executed at the end of the script.

IMPORTANT NOTE: A BAdI in BPC NetWeaver will commit the data before returning to the script

unless the WRITE Parameter is set to OFF in which case no data is written at all.

In BPC Microsoft, since the RUNLOGIC_PH is always executed at the end of the script, you cannot

run any additional logic afterwards. This is different in BPC NetWeaver, because you can run any

logic you want after the RUNLOGIC_PH BAdI call. So, in BPC NetWeaver, if there is additional logic

written after RUNLOGIC_PH, that logic will run on the newly created BAdI records. The scope for this

additional logic is not defined by the BAdI, but by the scope in the script itself.

IMPORTANT NOTE: Any script defined after (or before) the RUNLOGIC_PH BAdI call will behave

as normal (i.e. will run on the scope defined in the script itself and not the scope from the BAdI

“Dimension” Parameter).

In BPC NetWeaver, each RUNLOGIC_PH BAdI call defines the scope independently. So if you string

multiple RUNLOGIC_PH BAdI calls together they only scope their own calls (not affecting the other

BAdI calls) – this is different from BPC Microsoft RUNLOGIC_PH where you can redefine each

RUNLOGIC_PH call with scope from a previous RUNLOGIC_PH call.

In BPC NetWeaver, the BAdI “DIMENSION” Parameter will force the scope in the called logic for that

dimension. However, any additional scoping commands (such as XDIM_MEMBERSET) which have

been configured for that dimension in the called logic will then override the BAdI “DIMENSION”

Parameter.

IMPORTANT NOTE: If you want to force the scope of the called logic by using the BAdI

“DIMENSION” Parameter, you must make sure that you do not redefine the scope on that

dimension in the called script.

In BPC Microsoft, the RUNLOGIC_PH Keyword uses a special case for dimensions which are not in

the target script data area:

DIMENSION dim_name =

In BPC NetWeaver the equivalent of this syntax is the following:

DIMENSION dim_name = <NONE>

For example, this syntax is used when you are calling logic in a separate Application which does not

contain dim_name. This is similar to the SKIP parameter in the *DESTINATION_APP command.

Syntax examples of the DIMENSION Parameter:

DIMENSION dim_name = <ALL>

DIMENSION dim_name = <NONE>

DIMENSION dim_name = bas(node_name)

Page 14: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 8

2.2.2 The BAdI “CHANGED” Parameter

This optional BAdI parameter is only used when running the called script in parallel mode. It is used

to determine the data sets used for parallel execution. For information on how the data sets are

generated, please refer to the RUNLOGIC_PH Keyword algorithm section (See Section 2.2). If you do

not wish to use any form of parallelization then you can remove this BAdI Parameter completely.

The key to optimizing the parallelization of RUNLOGIC_PH is making sure that you split the data sets

up as equally as possible. The new Property and Hierarchy capabilities provide more flexibility in

achieving this goal.

Syntax of the CHANGED parameter:

CHANGED = dim_name

CHANGED = dim_name.property_name

CHANGED = dim_name(node_name)

IMPORTANT NOTE on the CHANGED parameter:

You cannot specify a Dimension more than once in the CHANGED parameter unless you are

use the new Hierarchy Node specification

o WARNING: Special care must be taken by the user that the nodes do not overlap

since this condition is not checked!

Allowed:

CHANGED = ENTITY(NODE1), ENTITY(NODE2)

Not Allowed:

CHANGED = ENTITY(NODE), ENTITY.PROPERTY

CHANGED = ENTITY, ENTITY(NODE)

CHANGED = ENTITY, ENTITY.PROPERTY

Page 15: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 9

2.2.3 Nesting RUNLOGIC_PH Statements

In BPC Microsoft the RUNLOGIC Keyword cannot be nested. However, in BPC NetWeaver the

RUNLOGIC_PH BAdI can call other scripts which contain RUNLOGIC_PH BAdI calls. These nested

RUNLOGIC_PH BAdI calls will not support more than one BAdI “Changed” Parameter and any

attempt to do so may result in unintentional consequences.

NOTE: The technical reason behind this is that each nested call will be competing for the total

number of defined parallel processes without knowing when the original processes actually finish

– which could result in performance degradation, locking issues, and incorrect data.

2.2.4 Locking Issues

When dealing with parallelization in the RUNLOGIC_PH BAdI, you must be very careful how you

define the data sets you are sending to the called logic and the data sets you are writing to within the

called logic.

IMPORTANT NOTE: The general rule of thumb is: don’t put dimensions in the BAdI “CHANGED”

parameter if you are collapsing/aggregating on those dimensions in your called logic.

The example given on the next page can help explain when a locking scenario might occur:

Calling Logic:CALLING_LOGIC.LGF

START_BAdI RUNLOGIC_PH

QUERY = OFF

WRITE = ON

LOGIC = CALLED_LOGIC.LGF

APPSET = APSHELL

APP = PLANNING

DIMENSION ENTITY = ENTITY_1, ENTITY_2

CHANGED = ENTITY

DEBUG = OFF

END_BAdI

Called Logic:CALLED_LOGIC.LGF

XDIM_ADDMEMBERSET ENTITY = ENTITY_3

//Aggregating/Summarizing data to ENTITY_3 could result in a locking situation:

ENTITY_3 = ENTITY_1 + ENTITY_2

2.2.5 Background vs. Dialogue Processes

In NetWeaver you can choose to kick off a process in the background or in dialogue.

IMPORTANT NOTE: The new RUNLOGIC_PH Keyword delivered in this guide always kicks off

the parallel executions in dialogue mode – specifically so that the controlling RUNLOGIC_PH

program knows when the dialogue process has finished executing.

This is an important distinction for Basis administrators, since dialogue processes behave slightly

different than background processes. Most importantly for the readers of this guide, is that dialogue

processes have a timeout setting and background processes do not. For this reason, the

parallelization technique described in this guide should be tested properly on the system so that each

data set will be able to finish its job within the time that has been allocated for a dialogue process in

your system.

Page 16: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 10

2.2.6 Enhancements to the BPC 7.5 version of

RUNLOGIC_PH Keyword

The Script Logic Keyword has been renamed to RUNLOGIC_PH (PH stands for Properties

and Hierarchies)

DEBUG = ON/OFF

Setting DEBUG to ON now makes a 1 second delay between starts of processes allowing for

analysis of logs that are time stamp based. This can be important for example, when running

the script with parallel processing. When the script is executed within a single process the

entire log will be shown as a single log. When the script is executed in multiple processes,

only the main log will be shown. If you want to see the logs of each separate process you

must locate them in UJFS.

RUNLOGIC_PH can now process Data Manager User Defined Prompts: $...$

CHANGED = dim_name.property_name

(See Section 4.3.4)

CHANGED = dim_name(node_name)

(See Section 4.3.5)

VALIDATION = ON/OFF

The default behavior of RUNLOGIC_PH is to check the syntax of the called script before

running it. Setting this parameter to OFF will turn the validation off. This allows for faster

execution if you have already verified that your script will run. This can be useful if a validation

of the script fails but it can still be executed successfully.

DIMENSION dim_name = <ALL>

The default behavior of BPC 10 (before SAP Note 1774371) is that even if you don’t specify

XDIM_MEMBERSET on a Dimension, all Dimension IDs are still used in the Selection criteria

on the database. After Implementing SAP Note 1774371, only those Dimensions with actual

restrictions are used in the Selection criteria on the database. This improves performance in

general. NOTE: The impact of this change is that you cannot specify these Dimensions in the

CHANGED parameter of the RUNLOGIC_PH Keyword.

The RUNLOGIC_PH Parameter for defining the number of parallel processes can now be set

at either the Model Level or the Environment Level (Note that the Model Parameter always

wins – if neither are set or the parameter has a value of 0 or 1, then RUNLOGIC_PH will run

the script in a single process).

RUNLOGIC_PH will always run on the background server defined in the BPC Global

Parameter “PARALLEL_SERVER_GROUP” (NOTE this was “EXECSERVER” for the BPC 7.5

Version). If this is not set, the logic will try to run on background server group “default”, and if

that does not exist and error will be raised.

Page 17: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 11

2.3 More Information on the BAdI Framework

SAP Business Add-Ins (BAdIs) are arguably one of the most important technologies used to adapt

SAP software to specific requirements. As of Release 7.0 of the SAP NetWeaver Application Server

ABAP, BAdIs are part of the Enhancement Framework, where they represent explicit enhancement

options. BAdIs are the basis for Object Plug-Ins that can enhance the functions in ABAP programs

without having to make core software modifications. As such, BAdI calls can be integrated into

customer applications (like BusinessObjects Planning and Consolidation, version for SAP NetWeaver

for example) to allow enhanced customization of standard application functionality.

This guide describes the procedure for implementing a BadI for the BPC NW version of the script logic

Keyword RUNLOGIC_PH. The Step-By-Step section will outline the tasks needed in order to create

the BAdI itself in addition to the configuration required within BPC NW to actually execute the BAdI.

The Appendix section contains the ABAP transport that goes along with this guide’s Business

Scenario. This code is only meant as an example and while it will perform the actions described in

this guide it may not match the exact needs of your own particular Business Scenario – it is only

intended to guide you in the creation of your own BAdI Implementation.

For more detailed documentation of the BAdI Framework, please refer to the SAP Help Site for BAdIs

(see Section 3 – Additional Documentation).

Page 18: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 12

3. Prerequisites

Required/recommended expertise or prior knowledge

SAP BusinessObjects Planning and Consolidation 10, version for SAP NetWeaver

BPC NetWeaver Script Logic

BPC NetWeaver Script Logic BAdI Framework

ABAP programming skills

Access to SAP NetWeaver transaction codes: SE20, SE19, SE37, SE80, SE24, STMS

Relevant SAP Notes:

SAP Note 1774371 – User specified dimensions in START_BADI is not correct

See Section 2.2.5, (DIMENSION dim_name = <ALL>)

Additional Documentation:

Other EPM How-To Guides

http://wiki.sdn.sap.com/wiki/display/BPX/Enterprise+Performance+Management+%28EP

M%29+How-to+Guides

SAP Help Library – Business Add Ins (BAdI)

http://help.sap.com/saphelp_nw73/helpdata/en/8f/f2e540f8648431e10000000a1550b0/fr

ameset.htm

SAP Help Library – BPC NetWeaver Script Logic

http://help.sap.com/saphelp_bpc10_nw/helpdata/en/a6/69182aed2c4df78e3f7b9d58673

5ac/frameset.htm

Page 19: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 13

4. Step-by-Step Procedure

This How-To guide outlines the procedure for implementing the RUNLOGIC_PH Keyword in BPC

10.0, version for NetWeaver. The ABAP code attached to this guide is intended to be implemented on

a BPC 10.0 system. In some cases you may want or need to use this new RUNLOGIC_PH Keyword

on a BPC 7.5 system. Therefore, it has been made technically possible to use the same code

delivered in this guide on a BPC 7.5 system.

The step-by-step procedure we describe in this guide shows you how to use the RUNLOGIC_PH

Keyword to execute a single script with three different parallelization techniques. These steps are only

meant to demonstrate the new syntax and functionality of the RUNLOGIC_PH Keyword. The

underlying script we are using represents a simple Sales calculation using Volume and Price as

described in Section 1.2 and Section 4.3.1.

1) Import the ABAP transport from Appendix A into a BPC 10.0, Version for NetWeaver System

2) Set the number of Parallel Processes to be used

3) Parallelize by a Dimension Combination

4) Parallelize by a Property

5) Parallelize by a Hierachy Node

This guide provides you with three different examples of how to use the RUNLOGIC_PH Keyword;

one which was possible in the older version (Dimension Combination), and two which are new

features (Properties and Hierarchy Nodes).

Parallelize by a Dimension Combination

Parallelize by a Property

Parallelize by a Hierarchy Node

Note that in this newer updated guide for BPC 10.0 we are only showing the new syntax examples for

using the RUNLOGIC_PH Keyword. To analyze the results, you may want to refer to the previous

version of this How To Guide (BPC 7.5 version) where we walk you through a simple series of

benchmark tests you can perform using different Script syntaxes and different parallelization drivers.

Using the examples provided in both of these guides, you can easily set up your own benchmark tests

to demonstrate the performance benefits you can acheive using the RUNLOGIC_PH Keyword

parallelization technique.

One can experiment with different Dimensions and even multiple Dimensions for splitting Data. When

running such trials it makes sense to set the WRITE Parameter to OFF, in which case all the

calculations are executed but the data is not written back to the Application (unless of course, the

script calls a BADI that itself writes data). In this way we can see which data split works more

efficiently and use that configuration for the final RUNLOGIC script.

In general, parallelization is the most efficient when each piece of data takes approximately the same

time for processing.

IMPORTANT NOTE: The general rule of thumb is: don’t put dimensions in the BAdI “CHANGED”

parameter if you are collapsing/aggregating on those dimensions in your called logic. For more

information, see Section 2.2.4 on Locking Issues.

Page 20: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 14

As always, it is important to remember that all performance results will depend on many different

factors. One suggestion when analyzing your results and adjusting configuration are the number of

combinations for the distinct data sets, the volume of data calculated, and the number of processes

available. Remember that in some cases the overhead of splitting up and dispatching the calculations

into smaller sets may outweigh the benefit of breaking them up in the first place. In that situation, you

may want to consider using less combinations and bigger sets of data. In most cases there will be an

optimal configuration but it is very important to keep in mind that a proper amount of testing and

benchmarking should be completed before deploying system-wide: If you are not careful you could

potentially cause too many processes to be consumed in a high user load setting, so you should be

very cautious with defining the proper number of parallel processes to be used and the number of

users executing the actual script.

Page 21: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 15

4.1 Import the attached ABAP transport

Make sure you import the transport from Appendix A into a BPC 10.0, Version for NetWeaver system.

Follow the standard procedure for importing an ABAP transport.

IMPORTANT NOTE: The ABAP code delivered with this transport belongs to a Package named

"ZBPC".

4.2 Parallel Degree Setup ...

1. Log onto the BPC 10.0, version for NetWeaver system with SAP Gui:

2. Navigate to transaction “SPRO” and click on the “SAP Reference IMG” button:

3. First verify that the RFC Server Group has been configured correctly in the BPC Global

Parameters. This parameter is called “PARALLEL_SERVER_GROUP”. You can use this

parameter to designate a specific Server Group you want the processes to be executed on.

Page 22: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 16

4. Typically, the default value is “parallel_generators” which can be changed in transaction “RZ12”:

5. Now go back to the SAP Customizing IMG screen and find the Environment/Model combination

you want to set the “PARALLELSCRIPT” parameter for. This parameter will control the total

number of processes the RUNLOGIC_PH Keyword can run at one time per Environment/Model

combination. (NOTE: If both parameters exist the Model setting prevails)

6. Create the “PARALLELSCRIPT” parameter and set the number of desired Parallel Processes in

the box labeled “Value” as shown below.

NOTE: This number will depend on many different factors related to the system hardware, such

as the available number of CPUs and RAM, in addition to how many other processes will be

running at the same time and how many active users in the system at the time of script

execution.

Page 23: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 17

7. Be sure to save your settings:

8. This configuration will only need to be done once. You can change it later as needed.

Page 24: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 18

4.3 Parallelize by a Dimension Combination

The script used in this example attempts to reflect the business scenario described in Section 1.2. It

multiplies a Volume account by a Price account and stores the result in a Sales account using a

*WHEN/*REC/*ENDWHEN based syntax in the BPC NetWeaver Script Logic editor. Let’s assume

that we want to run it with a combination of ENTITY and TIME, with all the other dimensions remaining

the same as they were in the original script.

4.3.1 Identify Original Script

We assume the business has already defined this calculation, let’s take a look at an example script

named CALC_SALES_ORIG.LGF

NOTE: This script assumes that Volumes are populated for some Customer-Product combination

and that the Price is populated for all Products where Customer = NO_CUSTOMER. It will multiply

Volume by Price per Product and places the result on an account named SALES.

4.3.2 Create a New Script for Testing

Now let’s copy CALC_SALES_ORIG.LGF to a new script that will be called by RUNLOGIC_PH and split across data sets provided by the RUNLOGIC_PH “CHANGED” Parameter.

Name the new script CALC_SALES.LGF (See APPENDIX B for the Script used in this Step):

NOTE: The only thing we changed in this new script is the XDIM specification for TIME and ENTITY, using the special keys %TIME_SET% and %ENTITY_SET%, i.e. members provided through the current view. The RUNLOGIC_PH Keyword will provide these values to the calling script based on the DIMENSION and CHANGED parameters.

Page 25: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 19

4.3.3 Create the Calling Script (RUNLOGIC_PH)

Now we create the calling script CALC_SALES_DIM_COMBO.LGF (See APPENDIX C for the Script

used in this Step). This script calls RUNLOGIC_PH and specifies the script to be called in addition to

the data set (DIMENSION Parameter) and on what dimension to split the data set (CHANGED

Parameter). For the CHANGED Parameter, we want to run it with a combination of ENTITY and

TIME, with all the other dimensions remaining the same as they were in the original script. This

specification means that the data set (base members of TIME for “2011” and “2012” and base

members of ENTITY for the “AMER” node) will be split according to unique combinations of TIME and

ENTITY.

4.3.4 Run the Calling Script (RUNLOGIC_PH)

Execute the calling script (CALC_SALES_DIM_COMBO.LGF) from a Data Manager Package. You

can monitor the backend server activity by using transaction “SM50”, where you can see 1

background process (running the BAdI) and 4 dialog processes (each running a different combination

of ENTITY and TIME).

NOTE: In order to make the run times comparable, you must delete all postings from the target

Sales Account first.

Page 26: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 20

4.4 Parallelize by a Property

Let’s rewrite the calling Script from Section 4.3 using the CHANGED syntax for Properties. The new

syntax will still perform the same calculation of multiplying a Volume account by a Price account and

storing the result in a Sales account, but will group the data sets to be executed based on a Property

in TIME (such as “Year”). Here we show you the TIME dimension member list used in this example:

When would this work better than splitting the data by ID?

This might work better in cases when you have a significant difference in the number of records for each month (seasonal activity), but the number of records year over year is pretty stable. Instead of running the script in each process by month, you would run the script in each process by year. This allows the parallelization to take place on even amounts of data per process instead of too much data in one process and not enough data in others.

4.4.1 Create the new Calling Script (RUNLOGIC_PH)

Now we create the calling script CALC_SALES_PROPERTY.LGF (See APPENDIX D for the Script

used in this Step). This script calls RUNLOGIC_PH and specifies the script to be called in addition to

the data set (DIMENSION Parameter) and on what dimension to split the data set (CHANGED

Parameter). For the CHANGED Parameter, we want to run it based on the Property value of TIME,

with all the other dimensions remaining the same as they were in the original script. This specification

means that the data set (base members for 2011 and 2012) will be split according to unique values of

Property “YEAR” resulting in two processes executed with a year’s worth of data in each.

Page 27: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 21

4.4.2 Run the Calling Script (RUNLOGIC_PH)

Execute the calling script (CALC_SALES_PROPERTY.LGF) from a Data Manager Package. You can

monitor the backend server activity by using transaction “SM50”, where you can see 1 background

process (running BAdI) and 2 dialog processes (running one year’s worth of data each).

NOTE: In order to make the run times comparable, you must delete all postings from the target

Sales Account first.

Page 28: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 22

4.5 Parallelize by a Hierarchy Node

Let’s rewrite the calling Script from Section 4.3 using the CHANGED syntax for Hierarchy Nodes. The

new syntax will still perform the same calculation of multiplying a Volume account by a Price account

and storing the result in a Sales account, but will group the data sets to be executed based on a

Hierarchy Node.

For this example, it’s important to know what the Hierarchy looks like. Let’s assume the following

Hierarchy for ENTITY:

4.5.1 Create the new Calling Script (RUNLOGIC_PH)

Now we create the calling script CALC_SALES_HIERARCHY.LGF (See APPENDIX E for the Script

used in this Step). This script calls RUNLOGIC_PH and specifies the script to be called in addition to

the data set (DIMENSION Parameter) and on what dimension to split the data set (CHANGED

Parameter). For the CHANGED Parameter, we want to run it based on a Hierarchy Node of ENTITY,

with all the other dimensions remaining the same as they were in the original script. This specification

means that the data set (base members of ENTITY for the “AMER” node) will be split according to the

children of the node values specified in the CHANGED parameter. This will result in four processes

being executed (the first with the children of ENTITY node “USA”, the second with the children of

ENTITY node “CANADA”, the third with the children of ENTITY node “CHILE”, and the forth with the

children of ENTITY node “MEXICO”).

Page 29: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 23

When would this work better than splitting the data by ID?

This might work better in the case when each of the base members (different sized entities) has a significant difference in the number of records to be processed, but the number of records at node level (evenly sized countries) is pretty stable. Instead of running the script in each process by entity, you would run the script in each process by country. This allows the parallelization to take place on even amounts of data per process instead of too much data in one process and not enough data in others.

4.5.2 Run the Calling Script (RUNLOGIC_PH)

Execute the calling script (CALC_SALES_HIERARCHY.LGF) from a Data Manager Package. You can

monitor the backend server activity by using transaction “SM50”, where you can see 1 background

process (running BAdI) and 4 dialog processes (the first process running for Entities under the “USA”

node, the second process running for Entities under the “CANADA” node, the third process running for

Entities under the “CHILE” node, and the fourth process running for Entities under the “MEXICO”

node).

NOTE: In order to make the run times comparable, you must delete all postings from the target

Sales Account first.

Page 30: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

How To Implement the RUNLOGIC_PH Keyword in SAP Business Objects Planning and Consolidation 10.0, version for

NetWeaver

May 2013 24

5. Appendix

Appendix A – ABAP Transport for BPC NetWeaver RUNLOGIC_PH

Keyword

This ABAP transport contains the Classes / Function Modules / Enhancement Objects needed for the BPC NetWeaver RUNLOGIC_PH Keyword. NOTE: delivered within an ABAP package named "ZBPC"

(Ask your Basis Administrator to import the R and K files as a transport)

Appendix B – CALC_SALES.LGF

CALC_SALES.LGF from Section 4.3.2

Appendix C – CAL_SALES_DIM_COMBO.LGF

CAL_SALES_DIM_COMBO.LGF from Section 4.3.3

Appendix D – CALC_SALES_PROPERTY.LGF

CALC_SALES_PROPERTY.LGF from Section 4.4.1

Appendix E – CALC_SALES_HIERARCHY.LGF

CALC_SALES_HIERARCHY.LGF from Section 4.5.1

Page 31: How To Implement the RUNLOGIC PH Keyword in SAP …a248.g.akamai.net/n/248/420835/ee59edcf1448740ecb046a544ab13c4c... · SAP BusinessObjects EPM How-To Guide How To… Implement the

www.sdn.sap.com/irj/sdn/howtoguides