cancel
Showing results for 
Search instead for 
Did you mean: 

calling HANA view with multiple input parameters within table function

Former Member
0 Kudos

Scenario: I have BW tables storing the huge amount of data, so while fetching the itself I want to restrict the no of lines to avoid memory errors. so for one of the field I have set Input parameter with multiple values. As per requirements I need to use the graphical view with Input Parameters into table function for further processing.

SAP HANA version: SPS 11

I tried passing multiple values with quotes as input parameter to calculation view but fails with instantiation error. Code in table function:

DECLARE VAR_ARRAY_WT VARCHAR(4) ARRAY;

DECLARE VAR_WT_TEXT VARCHAR(3000);

DECLARE I,J INT;

**** below calculation view converts input parameter into table column removing the quotes added while passing****

VAR_WT = SELECT "INPUTPARAM" as "WAGETY" FROM "_SYS_BIC"."XX"(PLACEHOLDER."$_I_INPUT_PARAM$" => :I_WT);

VAR_WT_ROW = select "WAGETY" from :VAR_WT;

VAR_ARRAY_WT := ARRAY_AGG(:VAR_WT_ROW."WAGETY");

J := 1;

FOR I IN 1..CARDINALITY(:VAR_ARRAY_WT) DO

IF(J=1) THEN

VAR_WT_TEXT := :VAR_ARRAY_WT[:J];

ELSE

VAR_WT_TEXT := :VAR_WT_TEXT ||CHAR(39)||CHAR(39) ||',' || CHAR(39)||CHAR(39)|| :VAR_ARRAY_WT[:J];

END IF ;

J := :J + 1;

END FOR;

VAR_WT_TEXT := CHAR(39) || CHAR(39) || CHAR(39) || :VAR_WT_TEXT || CHAR(39) || CHAR(39) || CHAR(39) ;

VAR_BASE2 = SELECT * from "_SYS_BIC"."YY" (PLACEHOLDER."$DATE1$" => :DATE_FROM, PLACEHOLDER."$DATE2$" => :DATE_TO, PLACEHOLDER."$FLAG$" => :I_FLG, PLACEHOLDER."$_I_WT$" => :VAR_WT_TEXT );

I am getting below error: column store error: search table error: [34023] Instantiation of calculation model failed;exception 306002: An internal error occurred

Regards,

Amol

Accepted Solutions (0)

Answers (0)