Input Parameters in HANA


In SAP HANA, input parameters are used to filter the data by passing an input from the user and to perform additional calculations at run time. The data is fetched based on the input value, when a view is executed.

Example

Consider a scenario where an Input parameter is applied on the "Sold_Qty", i.e. when the Sold_Qty is greater than 20, then there is 10% discount on Total_Price. Otherwise, it remains the same.

Input parameters are created in HANA Modeling views using SAP HANA Studio. When these views are used in any BO reporting tool and the report is refreshed, users are prompted to pass an input value for a particular field. To create a new parameter, navigate to the Semantic section of HANA Modeling view.

HANA Modeling View

Navigate to Parameters/Variables tab in the Semantic layer and click the "+" sign. Select Create Input Parameter as shown in the following screenshot.

Create Input Parameter

This will open a new dialog box. Enter the technical name and description of the Input parameter. Select the Input Parameter type from the dropdown list.

Input Parameter

We have the following input parameter types in HANA −

Note − You can also select the checkbox to make an Input Parameter a mandatory option.

You can select the data type of the input value, so that the system only accepts allowed value type for this field. This option varies as per parameter type. Following data type options are available −

Data Type Options

You can also pass Input parameter using SQL query. To view SQL query, navigate to the Data Preview tab of HANA Modeling view. Input parameter using SQL is passed using "PLACEHOLDER".

Next, click the "Show Log" and then double-click the message highlighted below. This will open a new window with the following SQL query.

('PLACEHOLDER' = ('$$ Sold_Qty $$', '20'))
   WHERE ("REGION_NAME" IN ('NA') )
   GROUP BY "NET_AMOUNT", "PROFIT";