If you are one of the modelers exploring the array of functions offered by SAP Profitability and Performance Management and stumbled upon a seemingly plain function called View; curious of its functionality besides the usual ones such as projection and aggregation – then this blog post is for you.
As view is one of the most straightforward functions offered by the solution, in which I concur. In the sense that: the modeler can simply just indicate an input function with optional input selection criteria, activate and run the function then you will have your desired result projection – in addition to the manipulation that the modeler could do from the output tab. However, as much as these tabs (input and output) are essential, the real-deal can be found in View’s Advanced Tab – wherein I will be focusing on.
Pretty basic isn’t it? Now moving to the main topic, the Advanced tab section has the following settings:
I will try my best to explain each Advanced tab settings in the next section using simple scenarios that will show their relevance and behavior when properly configured:
This one is pretty direct, by indicating a number or parameter will restrict the output records coming from the input. For example, I have the following input records:
And finally, results with Top value set to 3:
The result will consider the set ordering and will respect the sequential order of the records coming from the input.
A View function on top of these model tables will do the trick by specifying the precondition for example as shown in Figure A above. These two view functions are then called using From and Union All rules inside a Join function (JO - Data Processing) which serves as the main function to be executed.
To help you imagine what I am talking about, the function tree structure looks like this:
And by setting :I_PCOND = ‘actual’ as package parameter, the MT – Actual Data is used:
You might want to also check another blog post citing another scenario wherein Run Parameter Precondition feature was found essential by andrey.fedorin:
While both For Loop and For Loop Reverse enables the looping capability of the View function. The difference using the latter is that it switches the Low and High effect in the iteration. As for Low and High fields, its values can be set using static integer value or an environment parameter.
To show you that the iteration values can be reused, I’ve assigned the Iteration Parameter I_ITER to an output field ZE_ITERATION.
After successful activation and run, each iteration value are passed on to the output field ZE_ITERATION and shown completely in the image below:
As additional reference of Iteration's capability, I’ve added a flowchart showing one View function that performs multiplication of ZE_AMT to the current value of the Iteration Parameter I_ITER, which goes on until the total number of iterations reaches the High value of 3.
Moreover, View can also be used as a caller for a repetitive process and/or enrichment in a chain of functions such as below:
In this scenario, as long as the Iteration logic is satisfied, the View Function will trigger the Writer that calls its child functions until the iteration parameter reaches the High limit set and will end the iteration process. But what if I am already satisfied with the enriched data mid-way before reaching the value I have set for High – which is the upper limit of my set iteration?
Another functionality coming from the View’s Advanced Tab is the Early Exit Check. Wherein a condition can be configured in the environment through ‘checks’ which the View function can use as constraint. And once this condition is met, the iteration process will be terminated.
As reference, I’ll be showing a very straightforward example on how Early Exit Check kicks-in and this just one of the many ways to use this specific functionality.
Using the first iteration example from the previous section, I have created a check with condition ZE_ITERATION = 6.
And have set this as the Early Exit Check under the Advanced Tab of the View function:
Upon running of the function, the result shows that the last value of ZE_ITERATION is 5:
As such, this feature will be useful for scenarios that requires a certain condition or fulfillment of a field’s record, without having to rely specifically on the number specified in the Low and High fields for iteration.
If you have noticed in my previous iteration examples, each iteration is being reflected in the results. This is because I have opted to use the All Iterations as the Iteration Result setting, but of course, an alternative is available which I will be discussing in a second.
Given the general idea for All iterations which is a more transparent option than of its counterpart. For modeling users who prefer to see only the final processing result and do not really care about the full picture, this is where Iteration Result: Last Iteration fit. Once chosen, only the last iteration result will be shown.
I have removed the early exit check from our previous example to make it simpler (similar to our the Iteration section example). As such, the last iteration which is the value of 10 is shown as a result:
As you’ve already reached the end of my blog post, I hope that you’ve learned how SAP Profitability and Performance Management’s View Function – Advanced Tab works and find this helpful with your modeling requirements.
Thank you for taking the time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |