Hi Lars,
Here you go:
1) I create an Input Parameter in a scripted CalcView:
• 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?
Choose nothing is not allowed, since the input parameter is mandatory:
If one chooses null, ...
... we get an error:
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