Mapping SAP HANA input parameters to data source query subject parameters
Framework Manager includes a data source query subject that can have parameters corresponding to input parameters that are defined in an SAP HANA analytic or calculation view.
If objects are imported from the SAP HANA _SYS_BIC schema, a query is performed against _SYS_BI.BIMC_VARIABLE_VIEW to obtain input parameter metadata. If the modeler's signon for SAP HANA does not have access to _SYS_BI.BIMC_VARIABLE_VIEW, an exception is returned by SAP HANA. If this occurs, the signon must be granted access or the modeler should not select objects from the _SYS_BI schema. The signon that it used to query the SAP HANA analytic or calculated views must have the appropriate privileges to query those objects.
SAP HANA views that include input parameters appear as data source query subjects in Framework Manager. The data source query subject editor includes a tab that displays the set of input parameters that are returned from the BIMC_VARIABLE_VIEW. Each data source query subject parameter has a name, data type, and a prompt that is used to receive values as queries are executed. The parameter name is identical to the name that is assigned to the SAP HANA view input parameter. The name is used in an SAP HANA PLACEHOLDER clause that is included in the SQL statement executed by SAP HANA.
The data type of the parameter is based on the following mapping of data types that are returned from _SYS_BI.BIMC_VARIABLE_VIEW:
SAP HANA | Framework Manager |
---|---|
STRING, ALPHANUM | Character32 |
SECONDDATE, LONGDATE | dateTime |
SECONDTIME | Time |
DAYDATE | Date |
SDFLOAT, FIXED, DECIMAL_FLOAT | Decimal |
FLOAT, DOUBLE | Float64 |
INTEGER, INT | Int32 |
Values can be passed to each parameter by using prompt macros specified in the value definition. The prompt can be assigned a name that is not the same as the parameter name. The data type of the prompt can be defined as shown in the following table:
Framework Manager | Prompt |
---|---|
CharacterLength16 | string |
dateTime | timestamp |
Time | time |
Date | date |
Decimal | decimal |
Float 64 | double |
Int32 | integer |
SAP HANA parameters can be defined as mandatory or optional. If the prompt macro is defined with
a default value, the parameter is treated as optional. At run time, if a report does not pass a
value to the prompt, the parameter is not included in the set of placeholders in the SQL statement
that is passed to SAP HANA. If a promptmany
macro is used, multiple values provided
to the prompt are combined into a delimited list of values that are passed to the SAP HANA
placeholder.
Parameters can be defined with constants or macro expressions that do not include prompts. The constant value must be supported by the associated logic in the SAP HANA view that references the SAP HANA input parameter.
When a data source query subject is created by an import, it is assigned a logical SQL query. This query should not be edited. Predicates can be defined by using detail filters. Additional calculated fields can be defined by using calculated fields that are associated with the data source query subject or with the model query subjects that refer to the data source query subject.
Framework Manager does not import SAP variables. Detail filters can be defined in a query subject that include predicates in the SQL statement that is passed to SAP HANA.
The data source query subject can be updated by using the Update Object action. This action recreates the set of parameters associated to the data source query subject. Alternatively, the data source query subject parameters can be maintained by adding, deleting, renaming, or updating the parameters properties to align them with the SAP HANA view parameters.
- If the imported SAP HANA views contain identical names for SAP input parameters with different data type and optionality properties, ensure that you assign unique prompt names in the parameter value definitions in the data source query subject.
- If the SAP HANA input parameters can have multiple values, the prompt macro function must be
#promptmany
. Otherwise, an incorrect syntax is generated and the query fails.An example of such input parameter is one that is used as an argument to an IN operator in a filter expression.
The modeler must manually change the prompt function from
#prompt
to#promptmany
.
Examples of Framework Manager parameter value definitions
The following parameter value is defined to accept a single input value. If no value is provided, the parameter is treated as optional.
#prompt('optional_prompt', 'string', '0')#
The following parameter value is defined to accept a single input value, and is not optional.
#prompt('mandatory_prompt', 'integer')#
The following parameter value is defined to accept one or more input values.
#promptmany('multi_value_prompt', 'date')#
The following parameter value is defined as a macro. Please note that there is a space inside the quotation mark.
#’ ‘#
The following parameter value is defined as a constant.
123