Visibility of variable in IP functionality
Use of Variables :
Variables are used to parameterize a query, a planning function, a filter, a characteristic relationship or a data slice. When a query, planning function or Web application is executed, they are filled with values.
Variables act as placeholders for characteristic values, hierarchies, hierarchy nodes, texts, and formula elements, and can be processed in many different ways.
A person should have knowledge of below topics-
- What is a Planning sequence?
- What is a Planning function and planning function type?
- What is WAD?
- What are parameters?
- What is a user input query?
We want to make available a complete planning application that would help the sales force to plan data for 2014. One of the requirements is to create a query that can be used for entering the plan data. Although the actual sales data for 2013 will be used as reference data for planning for 2014, the company expects to make manual changes to reflect the demand for the period.
Here we had the Quantity sold for the specified year. The user inputs the fiscal year and gets the desired output. At the same time when we want to do planning on this data through planning function, even if the variable was not binded, it was giving the result by taking the value from memory buffer. But this cannot be assumed and we have to properly bind the variables to get the desired output.
The above requirement can be met by
- Passing variables through filters in planning function
Variables “Order ID” and “Depth Structure” passed as user input.These filters are a part of user input query.These were specified at the time of query creation and are inputs from the user.
On execution of the query with filters passed for the desired user inputs we will get the desired output for year 2014.
There is one major drawback with this method.
By using filters we block our database for use and there is a lock on the data.
This can be seen through transacation-RSPLSE.Here you can see lock for both the variables used-‘order id’ and ‘depth structure’. (as shown below).
- Passing variables through parameters in planning function.
Here we will pass the values through parameters instead of filters
Here we have used a ‘copy’ planning function type with ‘from’ and ‘to’ parameters.We want to copy 2014 data to 2013.
The following rules apply for copy function:
- The From values are read as reference data and do not need to be part of the filter that is transferred to the planning function.
- The To values are changed; they have to be included in the transferred filter.
- The key figure values for the To values are always overwritten during copying. This is also valid when the From values are empty.
- If a target has been specified in one or more subprocesses, the function is executed and as a result, the target contains the appropriate totals.
Also the variable used needs to be binded for fetching the user input values.Without binding the inputs cannot be tracked for the variables used in Planning sequnce.
Binding of variable will be done as shown below..
Also we need to link planning sequence with the variables used.-
On user’s action of COPY data the planning sequence will be executed and in turn the planning function is executed and through parameters the to column gets populated through copy function.
the desired output as copied data in 2013-
Here the from value was passed as 2014.
The advantage of using parameters over filters is that it claims no lock on the data base.The whole data is still accessible for other usage without any hinderance.
The same can be seen in below screenshots-
Using transaction RSPLSE , we can see there is no lock on the variable used fro parameters.