
Planning functions are used in BW-Integrated Planning for system-supported editing and generating data.
A planning function describes how the transaction data of a specific aggregation level is changed. This entails making a number of settings:
The name of the aggregation level
The planning function type
How characteristics are used
The parameter values
The planning function type determines how data is changed by a planning function. The BW system offers you a number of standard planning function types :
Unit Conversion
Generating Combinations
Formula
Copy
Delete
Delete Invalid Combinations
Forecast
Reposting
Reposting by Characteristic Relationships
Revaluation
Distribute by reference data
Distribution by keys
Currency translation
You can also implement customer-specific planning function types. More information: Implementing Planning Function Types .
The system contains the following objects:
Aggregation levels that planning functions are created on (see Aggregation Levels ). Planning functions can be created and executed on each active aggregation level.
Filters that are required when the planning function is executed. Filters determine the data that the planning function is performed for. The planning function locks the data defined in the filter in the planning-relevant InfoProviders belonging to the aggregation level. The filter has to be defined on the same aggregation level as the planning function (see Filters ).
You determine the planning function type and the aggregation level that you want the planning function to work on. You can also change the characteristic usage, the conditions and the parameter sets. You can define how the changed data will be processed.
The following section explains the functionality using an example of creating a planning function of type Repost .
The table below shows the data for the InfoProvider before the planning function is executed:
Before execution of the planning function
|
Product |
Product Group |
Version |
Year |
Revenue |
|---|---|---|---|---|
|
P1 |
PG1 |
V1 |
2007 |
10 |
|
P2 |
PG1 |
V1 |
2007 |
20 |
All records in version V1 need to be reposted to version V2. You can do this by reposting all key figures. The table below shows the status after the planning function has been executed:
After execution of the planning function
|
Product |
Product Group |
Version |
Year |
Revenue |
|---|---|---|---|---|
|
P1 |
PG1 |
V1 |
2007 |
0 |
|
P2 |
PG1 |
V1 |
2007 |
0 |
|
P1 |
PG1 |
V2 |
2007 |
10 |
|
P2 |
PG1 |
V2 |
2007 |
20 |
After reposting, records that contain zeros only (empty records) remain in V1, while the required records appear in V2.
Characteristic Usage
The planning function type defines the options for using characteristics and the parameters of the planning function. Together, the parameters of the planning function type define the parameter set.
With characteristic usage , the characteristics of the aggregation level are divided into Characteristics to Be Changed and Block Characteristics (characteristics that are not used). This allows you to specify the characteristic values that are changed when the planning function processes a data record. Block characteristics remain constant.
When you create a planning function of type Repost for the case described above, you first check which characteristic values should be changed and set the to be changed flag accordingly. Since you want to repost the data from version V1 to version V2, you set the flag for the Version characteristic as To Be Changed (which in this case means to be reposted ).
You can also select block characteristics as condition characteristics.
Parameter Sets and Conditions
You can now change the parameter records . With most planning functions, all transaction data is processed with the same set of parameters. In this case, a block characteristic has not been selected as a condition characteristic, and only one parameter set has to be entered.
The parameter set for planning function type Repost includes a table for selecting the key figures to be reposted and a table where you can enter the From-To Value Pairs for the characteristics to be reposted. In key figure selection, you set the flag for Select All Key Figures . In the From and To Values for Reposting table, you choose Create Row and enter the value V1 under From and V2 under To . The planning function is ready for reposting.
If you want to use different parameter sets to execute different transaction data records, you have to work with conditions . You have to select at least one block characteristic as a condition characteristic.
If you want to increase the planned production for products in product group PG1 by 5% and the products of product group PG2 by 10%, choose the product group as the condition characteristic.
In the parameters, you can create multiple pairs of conditions and parameter sets. For each pair, use a filter to select condition characteristics. You can change the associated parameter set for each pair.
From a technical viewpoint, the method that the planning function actually executes is called more than once. The data that was selected with the filter is divided into blocks. Each combination of characteristic values in the block characteristic forms a separate block (which explains the name block characteristics ). Planning function types that work with reference data can also have additional blocks (such as Copy ). The method is then called once for each block with a table of records. The table includes data records that correspond to the characteristic combination for the block in the block characteristics.
For each block, the system checks for a condition/parameter set pair so that the block meets the condition. The system tests the block against the conditions along the sequence of pairs. The system uses the first pair where the block meets the condition. The method for the planning function type is executed for the block and the parameter set that meets the condition. Subsequent pairs are ignored. The method is therefore executed just once for each block.
Variables in Planning Functions
The usual BW variable types are available in many planning function types (see Variables ).
Working with Empty Records
Almost all planning function types do not read empty records and do not write empty delta records to the buffer. Exceptions to this are Copy and Generate Combinations . These two function types read empty records and write empty delta records.
Processing Changed Data
The selected planning function type determines whether the planning function processes the data in blocks or processes all the data at once. A planning function, that processes data blocks, can be parameterized so that blocks are only processed, if they contain data that has been changed by the user in the same session. These planning functions only process small quantities of data. This significantly reduces the runtime.
Here the user may have changed data in the filter or data that is used as reference data.
An example of this is the copy function that copies data from version V1 to V2. In this example, the data blocks are constructed so that all the data is grouped into blocks that have the same characteristic value in all characteristics (except in the version characteristic). The reference data originates from version V1. The data to be changed is in version V2. The function only processes the blocks in which data from version V1 or version V2 has been changed.
With a planning function, the filter defines the data that is allowed to be changed. You can tell from the parameters which reference data is required. Now the changed data is also read. The characteristic values of the block characteristics are collected for every changed data record in the filter and in the reference data. These values replace the original selection.
The changes made since the data was last saved are processed. The planning function identifies which data has already been processed. If this data is changed again, it is not processed again.
The system usually determines on the aggregation level of the planning function which data has been changed. It is also possible to specify a different aggregation level, for example the aggregation level of the query that was used to change the data.
The behavior can also be configured for a planning sequence.
We recommend that you use the setting, where only blocks with changed data are processed, in the following scenario:
At the start of the session, the user's data is in a consistent state. This is guaranteed by the administrator. During the session, the user changes some of the data. The user then executes planning functions that check whether the data is consistent or perform calculations that convert the data to a consistent state. Planning functions can be used where the data is not changed from the second execution onwards. The filter should be restricted so that it includes data that the user is allowed to edit during the session. The planning function should be able to edit all data. The way that the selection is made ensures that the system always processes the smallest possible quantity of blocks. However, it may be the case with the resulting intersections that a quantity larger than the minimum quantity is processed.
The filter of the planning function should not contain any variables that change during the session. Otherwise, the system might only process changed data with the previous variable assignment in the filter. Therefore there is a danger that not all of the changed data is recorded.
It is advisable to set this type of planning function for the Save pushbutton, as changes are only stored up to the previous save.
More information
For more information on creating, checking, saving and executing planning functions in Planning Modeler , see Editing the Planning Function .
For more information about how you can trigger the execution of planning functions or sequences in the front end tools BEx Analyzer and BEx Web Application Designer, see the documentation for the commands Execute Planning Function (Simple) , Execute Planning Function and Execute Planning Sequence (Simple) in the front end tool in question:
BEx Analyzer : Command wizard
BEx Web Application Designer :
You can find an example of a planning function under Process Flow of Planning Function: Distribution by Key ..