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.
For starters, general information about the View function can be read here:
Pretty basic isn’t it? Now moving to the main topic, the Advanced tab section has the following settings:
Note: The configuration above for Advanced Tab is just a depiction of what kind of input these fields accept.
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:
As an additional flavor, I’ve used Order by for both fields in the Output tab.
Interim results without TOP setting:
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.
Run Parameter Precondition
For certain requirements that the modeler would need to derive from different data sources for processing, utilizing View’s Run Parameter Precondition is one approach that the modeler can explore.
For instance, I have two data sets: (1) Assumed (2) Actual.
Using Run Parameter Precondition, I can either:
- Derive nothing (no precondition met and/or set)
- Derive only from ‘assumed’ model table (:I_PCOND=’assumed’)
- Derive only from ‘actual’ model table (:I_PCOND=’actual’)
- Derive from both sources (both precondition was met)
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.
Note: Figure shown is from FS-PER 3.0 Visual Modeler. And for easier reference, I’ve indicated the set Parameter precondition on each View function.
Basically, if Run Parameter Precondition is set in a function View, it’s procedure will be executed only when the set parameter value is satisfied. By setting :I_PCOND = ‘assumed’ as package parameter upon run of JO – Data Processing, results will show data coming from MT – Assumed Data:
If the Default Type is set to Default Output, if input empty and the input function’s Y-TABLE is empty, the run result will have a one line of dummy record as shown below.On the other hand, if the input function has records, it will be shown as is. Basically, the exact behavior as setting Default (none) which is the normal View functionality.
Iteration often referred to as ‘looping’ is a process in order to generate a sequence of outcomes which function View is also capable. Iteration type have three options: Default (None) the succeeding settings will be grayed out as shown below:
This is just one (of the simplest) example wherein a user can utilize iteration. From repetitive enrichment and calculation to mass data generation, this feature will certainly be of aid for modelers.
A soft-limit that will end the iteration cycle if a certain condition is met is basically how Early Exit Check works and will fulfill this requirement.
Early Exit Check
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.
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.