You want to build a planning application with which you can enter turnover amounts for certain account numbers and revaluate them using a factor that can be set. If you select a row of the table, only the amount in this row is to be revaluated. If you do not select any rows, all values are to be revaluated. The planning application is to look roughly as follows on execution:
This example serves in particular to clarify the interaction between a planning function and an Analysis Web item. Special properties here are:
● Variable handling in the planning function
● Row selection in the Analysis Web item
In the planning modeler, you have created an aggregation level that contains the following InfoObjects: unit Currency Key, time characteristics Quarter and Calendar Year, key figure Amount, characteristics Version, Account Number, Cost Center.
The planning function and the query are to use the same data of this aggregation level.
...
1. Choose the Planning Functions tab page and create a planning function of the type Revaluate with technical name REVALUATE and description Revaluate for your aggregation level.
2. On the To the Parameters tab page, use the input help for the revaluation factor to create the REVAL_FACTOR variable with the Revaluation Factor description. The variable is to be specified in detail as follows: The variable is to be a required variable and is to be input ready; it is to be of type Number, but is not to contain a standard default value.
3. Choose the Filter tab page and create a filter with technical name ACCOUNT_FILT and description Revaluation Selection for your aggregation level.
Select the characteristics one after another and choose the input help icon in the column after Characteristic Restrictions. The dialog box for specifying characteristic restriction appears. Specify the required restrictions (in our example, Version = VERSION 1, Quarter = QUARTER 1, Calendar Year = 2007; Cost Center = 100002, Currency = Euro; for Account Number, all values are taken over), choose Add, and save the selections by clicking OK.
Choose Show Extended Settings and ensure that the Version characteristic cannot be changed on execution. (It must be possible to change the Amount key figure).
More information about creating planning functions, variables, and filters: Modeling Planning Scenarios
...
1. In the BEx Query Designer, create a query Revaluate (technical name: QUERY_REVALUATION) for your aggregation level.
2. Drag and drop the ACCOUNT_FILT filter into the Characteristic Restrictions area for filter values. In doing so, all characteristics are restricted to single values.
Drag and drop the Account Number characteristic into the area for default values.
3. Specify that the Account Number characteristic is in the rows. The values for this come from the master data.
Specify that the Amount key figure is in the columns. The values for this can be changed; on the Planning tab page, choose the Data Can be Changed Using User Input or Planning Functions option.
4. Save your query definition.
...
1. In the BEx Web Application Designer, create a Web template with technical name REVALUATION.
2. Create the following data providers:
○ DP_PLAN_DATA of the type Query View Data Provider, based on query QUERY_REVALUATION
○ DP_FILT_REVALUATION_FUNCTION of the type Filter. The data binding should come from the ACCOUNT_FILT filter.
3. Create the following Web items:
○ INPUT_FIELD_REVALUATION_FACTOR. Specify 10 as the default value (Internal Display → Text: 10).
○ BUTTON_GROUP_ REVALUATION. Using Internal Display, create pushbutton1 with label Revaluation and, as Action, use the command wizard to assign the following commands (INSTRUCTION):
Table of Commands
Command |
Parameters |
Data provider-specific command: SET_SELECTION_STATE BY BINDING (Set Filter Values According to Different Sources) |
● Command target: target data provider DP_FILT_REVALUATION_FUNCTION ● Data binding: selection binding using the Account Number (ZD_ACCNT) characteristic, where the value of the Web Item Selection binding type is to come from the ANALYSIS_ITEM_1 Web item, characteristic Account Number (ZD_ACCNT). |
Planning-specific command EXEC_PLANNING_FUNCTION_SIMPLE (Execute Planning Function [Simple]) |
● Data binding: Reference to data providers of type Filter DP_FILT_REVALUATE_FUNCTION, where the value from variable REVAL_FACTOR of connection type Web Item with Manual Input (ITEM_INPUT) is to come from INPUT_FIELD_REVALUATION_FACTOR. ● Command-specific parameter: planning function REVALUATE |
○ ANALYSIS_ITEM_1. Data provider DP_PLAN_DATA is assigned to the analysis grid as the (source) data provider.
Choose Behavior → Row Selection → Multiple (MULTIPLE).
In this case, it must be possible to select multiple rows and to execute the revaluation command on all selected rows. It is not therefore possible to give the command along with the row selection; the command must instead be given using pushbuttons.
4. Create a CONTAINER_LAYOUT_ITEM_1 (Web Items → Enhanced → Container).
Divide the container into columns, choose the With Tray display option, and enter label Revaluation under Tray Settings.
Add the following Web items to the container:
○ 1st row, 1st column: INPUT_FIELD_REVALUATION_FACTOR
1st row, 2nd column BUTTON_GROUP_ REVALUATION
○ 2nd row, 1st column (with option Colspan=2, that is, with a merge of columns 1 and 2): ANALYSIS_ITEM_1
The following figure illustrates the layout of the REVALUATION Web template:
The table below contains the XHTML source text of the REVALUATION Web template:
XHTML Source Text of the REVALUATION Web Template
<bi:bisp xmlns="http://www.w3.org/TR/REC-html40" xmlns:bi="http://xml.sap.com/2005/01/bi/wad/bisp" xmlns:jsp="http://java.sun.com/JSP/Page" > |
...
1. Execute the Web template on the Web.
2. For testing, extend the URL to include parameter &debug=X.
If you have set this parameter, the selection is shown in the Executing Planning Function section.
3. Enter amounts for one or more account numbers, change the revaluation factor if necessary (default value = 10), select the required rows, and choose Revaluation.
For example, enter amount 100 in the first row, retain revaluation factor 10, and choose Revaluation. The query outputs an amount of 110 in both the selected row as well as in the overall result (as long as you have not entered any other values).