Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

Re: Input Parameters in Scripted Calculation Views

$
0
0

Hi Lars,

 

Here you go:

 

1) I create an Input Parameter in a scripted CalcView:

 

1.PNG

 

Mandatory cannot be unchecked (as opposed to graphical CalcViews)

Default Value cannot be made active (as opposed to graphical CalcViews)

 

2) Script Node

 

/********* Begin Procedure Script ************/

BEGIN

 

            it_data =

            select SESSIONID, ITEM from KXEN"."afm.data::ViewAprioriCusttx_01"                             

            where "Customer" = :in_Customer;                          

 

            var_out = select SESSIONID, ITEM, 2 as TWO from :it_data;      

                 

 

END /********* End Procedure Script ************/

 

 

 

Executing the report works if a customer is chosen (here = 23). But what if the user shall also have the possibility to leave the customer blank?

 

2.PNG

 

Choose nothing is not allowed, since the input parameter is mandatory:

 

3.PNG

 

If one chooses null, ...

 

4.PNG

 

... we get an error:

 

5.PNG

 

3) Try the thing with APPLY_FILTER, but what to pass over, if the value should be blank?

 

/********* Begin Procedure Script ************/

BEGIN

 

declare lv_search_string nvarchar(256);

 

lv_search_string := '"Customer" =' || :in_Customer;

 

it_data = apply_filter("KXEN"."afm.data::ViewAprioriCusttx_01",:lv_search_string);

 

var_out = select SESSIONID, ITEM, 2 as TWO from :it_data;                      

 

END /********* End Procedure Script ************/

 

shows exactly the same behavior as the first code example.

 

I also tried search strings like, but this did not work neither:

 

lv_search_string := '"Customer" !=''';

 

 

Regards and thanks,

Ingo


Viewing all articles
Browse latest Browse all 8581

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>