Show TOC Start of Content Area

Procedure documentation Revaluating Planning Functions (with Analysis Web Item)  Locate the document in its SAP Library structure

Use

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 graphic is explained in the accompanying text

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

Prerequisites

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.

Procedure

Planning Modeler: Creating Planning Functions, Variables, and Filters

...

       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).

Note

More information about creating planning functions, variables, and filters: Modeling Planning Scenarios

BEx Query Designer: Creating Queries

...

       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.

BEx Web Application Designer: Creating Web Templates

...

       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).

Note

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:

This graphic is explained in the accompanying text

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" >
    <html >
        <head >
            <title >
BEx Web Application</title>
            <meta 
http-equiv="Content-Typecontent="text/html; charset=utf-8" />
        </head>
        <body >
            
<bi:QUERY_VIEW_DATA_PROVIDER name="DP_PLAN_DATA>
                <bi:INITIAL_STATE 
type="CHOICEvalue="QUERY>
                    <bi:QUERY 
value="QUERY_REVALUATIONtext="QUERY_REVALUATION/>
                </bi:INITIAL_STATE>
            </bi:QUERY_VIEW_DATA_PROVIDER>
            <bi:SELECTOR_DATA_PROVIDER 
name="DP_FILT_REVALUATION_FUNCTION>
                <bi:SELECTOR_INITIAL_STATE 
type="CHOICEvalue="SELECTION_OBJECT>
                    <bi:SELECTION_OBJECT 
value="ACCOUNT_FILT/>
                </bi:SELECTOR_INITIAL_STATE>
            </bi:SELECTOR_DATA_PROVIDER>
            <bi:TEMPLATE_PARAMETERS 
name="TEMPLATE_PARAMETERS/>
            <bi:CONTAINER_LAYOUT_ITEM 
name="CONTAINER_LAYOUT_ITEM_1designwidth="250designheight="30>
                <bi:WIDTH 
value="250/>
                <bi:HEIGHT 
value="30/>
                <bi:WITH_TRAY 
type="CHOICEvalue="Xtext="" >
                    <bi:TRAY_SETTINGS 
type="COMPOSITE>
                        <bi:CAPTION 
value="Umwertung/>
                    </bi:TRAY_SETTINGS>
                </bi:WITH_TRAY>
                <bi:ROW_LIST 
type="ORDEREDLIST>
                    <bi:ROW 
type="ORDEREDLISTindex="1>
                        <bi:COLUMN 
type="COMPOSITEindex="1>
                            <bi:CHILD_ITEM_REF 
value="INPUT_FIELD_REVALUATION_FACTOR/>
                        </bi:COLUMN>
                        <bi:COLUMN 
type="COMPOSITEindex="2>
                            <bi:CHILD_ITEM_REF 
value="BUTTON_GROUP_REVALUATION/>
                        </bi:COLUMN>
                    </bi:ROW>
                    <bi:ROW 
type="ORDEREDLISTindex="2>
                        <bi:COLUMN 
type="COMPOSITEindex="1>
                            <bi:CHILD_ITEM_REF 
value="ANALYSIS_ITEM_1/>
                            <bi:COLSPAN 
value="2/>
                        </bi:COLUMN>
                    </bi:ROW>
                </bi:ROW_LIST>
                <bi:INPUT_FIELD_ITEM 
name="INPUT_FIELD_REVALUATION_FACTORdesignheight="70designwidth="40>
                    <bi:WIDTH 
value="40/>
                    <bi:TEXT_CONTENT 
value="10/>
                    <bi:TEXT_ALIGNMENT 
value="END/>
                </bi:INPUT_FIELD_ITEM>
                <bi:BUTTON_GROUP_ITEM 
name="BUTTON_GROUP_REVALUATIONdesignheight="70designwidth="50>
                    <bi:WIDTH 
value="50/>
                    <bi:BUTTON_LIST 
type="ORDEREDLIST>
                        <bi:BUTTON 
type="COMPOSITEindex="1>
                            <bi:CAPTION 
value="Umwertung/>
                            <bi:ACTION 
type="CHOICEvalue="INSTRUCTION>
                                <bi:INSTRUCTION >
                                    <bi:SET_SELECTION_STATE_BY_BINDING >
                                        <bi:TARGET_DATA_PROVIDER_REF_LIST 
type="ORDEREDLIST>
                                            <bi:TARGET_DATA_PROVIDER_REF 
index="1value="DP_FILT_REVALUATION_FUNCTION/>
                                        </bi:TARGET_DATA_PROVIDER_REF_LIST>
                                        <bi:SELECTION_BINDINGS 
type="UNORDEREDLIST>
                                            <bi:SELECTION_BINDING 
type="COMPOSITEindex="1>
                                                <bi:CHARACTERISTIC 
value="ZD_ACCNTtext="Account number/>
                                                <bi:SELECTION_BINDING_TYPE 
type="CHOICEvalue="ITEM_CHARACTERISTIC>
                                                    <bi:ITEM_CHARACTERISTIC 
type="COMPOSITE>
                                                        <bi:ITEM_REF 
value="ANALYSIS_ITEM_1/>
                                                        <bi:CHARACTERISTIC 
value="ZD_ACCNTtext="Account number/>
                                                    </bi:ITEM_CHARACTERISTIC>
                                                </bi:SELECTION_BINDING_TYPE>
                                            </bi:SELECTION_BINDING>
                                        </bi:SELECTION_BINDINGS>
                                    </bi:SET_SELECTION_STATE_BY_BINDING>
                                    <bi:EXEC_PLANNING_FUNCTION_SIMPLE >
                                        <bi:SELECTOR_DATA_PROVIDER_REF 
value="DP_FILT_REVALUATION_FUNCTION/>
                                        <bi:PLANNING_FUNCTION 
value="REVALUATEtext="Umwerten/>
                                        <bi:VARIABLE_VALUES 
type="ORDEREDLIST>
                                            <bi:VARIABLE_VALUE 
type="COMPOSITEindex="1>
                                                <bi:VARIABLE 
value="REVAL_FACTORtext="" />
                                                <bi:VARIABLE_TYPE 
type="CHOICEvalue="ITEM_INPUT>
                                                    <bi:ITEM_INPUT 
type="COMPOSITE>
                                                        <bi:ITEM_REF 
value="INPUT_FIELD_REVALUATION_FACTOR/>
                                                    </bi:ITEM_INPUT>
                                                </bi:VARIABLE_TYPE>
                                            </bi:VARIABLE_VALUE>
                                        </bi:VARIABLE_VALUES>
                                    </bi:EXEC_PLANNING_FUNCTION_SIMPLE>
                                </bi:INSTRUCTION>
                            </bi:ACTION>
                        </bi:BUTTON>
                    </bi:BUTTON_LIST>
                </bi:BUTTON_GROUP_ITEM>
                <bi:ANALYSIS_ITEM 
name="ANALYSIS_ITEM_1designwidth="400designheight="200>
                    <bi:DATA_PROVIDER_REF 
value="DP_PLAN_DATA/>
                    <bi:SELECT_ROWS 
type="CHOICEvalue="MULTIPLE/>
                </bi:ANALYSIS_ITEM>
            </bi:CONTAINER_LAYOUT_ITEM>
<!-- insert data providers, items and other template content here -->
        
</body>
    </html>
</bi:bisp>

Execution on the Web

...

       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.

Example

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).

 

End of Content Area