SAP HANA Scripted Calculation View variables
Welcome to the new tutorial on SAP HANA scripted calculation view variables. When the filters need to be applied after the end of execution of the entire logic in a dynamic manner, variables are used. This means that when you apply a variable filter on a field, there will be a pop-up window whenever the data preview is done which asks for value(s) to the user on which the filter needs to be applied.
Since variables are applied after the end of script logic, it can only be created on the Semantics node. Due to this fact, variables in SAP HANA Scripted calculation views are created in the same ways as they are done in Graphical calculation views.
Creating an SAP HANA Scripted Calculation view variable
To create one, first click on the Semantics node to select it and then click on the green Plus button marked below.
This brings up the below window which asks for some details like the technical name and description of this variable, the attribute(field) on which it is applied to and more.
We provide the name and description both as V_MATERIAL and also apply it to the field MATERIAL_NR.
We allow multiple entries and make it non-mandatory. This means that any number of values can be entered in the variable pop-up for this material number filter at runtime but even if you don’t enter any values, the view would still execute since the variable is not mandatory. Press Ok when done.
Save and activate the view.
Run a data preview on the view. Now, instead of the data preview options, you would get a pop-up window asking for a material number as filter.
A filter value is entered as HT-1011 as an example. Press Ok.
In the raw data tab of the data preview, you can now see that only 7 rows were retrieved because there were only these rows corresponded to the material number we selected in the variable filter screen.
Hopefully, the concept of SAP HANA Scripted Calculation view variables is clear to you now. Read on to the next tutorial to learn more about Input parameters in SAP HANA.
If you liked the tutorial, please share it on social media using the share buttons below and make sure you subscribe to our newsletter to get the latest updates when new tutorials are added.