cancel
Showing results for 
Search instead for 
Did you mean: 

sent input parameters two times to the same procedure. Is it possible ?

0 Kudos

Hi experts, I need your help

The fact is that a we need that when you put a year we have to store the previous 4 all of them as an input parameter. For example, to 2017 we need to get 2016, 2015, 2014 and 2013. In order to do this we have an input parameter that we put the 2017 and we call in the graphical view to a procedure that gets this value and returns its previous year to a new inputparameter. The problem that I have is that if I want to do the same now i can't send the 2016 year that i have in the new ip because it doesn't appear.

I'm thinking on 2 solutions but I need your experiencie and knowledge experts because I don't know if they are possible solutions or not.

One es is to go throguth calculation views and call it manually with the returned values (I don't know if this would work)

Second is to see if the procedure can return more than one value

Maybe a third would be to send this years to a table and get them from there.

What do you think ?

The script is the following:

CREATE PROCEDURE "_SYS_BIC".".HanaStudioSystemProject::ZGET_PREVIOUS_DATE" ( in ac_date varchar(4) , out prev_date varchar(4))
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
--DEFAULT SCHEMA <default_schema_name>
READS SQL DATA AS
BEGIN
/*****************************
Write your procedure logic
*****************************/
prev_date := to_char(to_int(ac_date)-1);
END;

Thanks for your attention.

0 Kudos

The option of multiple outputs is not working cause I cant map de exit that I want.

I'm going to test the other option like a script view. I imagine that in a script view i will be able to create input parameters and call the functions all times i want Am I right ?

View Entire Topic
kapil_tilwani
Explorer
0 Kudos

Hi Hector,

If the intention is to pass the value provided to the Input Parameter to be converted into 4 previous years, you may not really need a procedure for it. You could fire a select from M_TIME_DIMENSION_YEAR and fetch the last 3 values entered.

So, there shall be no procedures required but as a simple wrapper on the original view itself.

Use this tabular output as a JOIN instead of onward parameter passing to yield the desired results.

Regards,

Kapil