Skip to Content
0
Former Member
Aug 10, 2016 at 12:28 PM

Calculated views with multiple input parameters and XS OData

609 Views

Hi everyone !

I know there are thousands of topics on the subject, which have all been really helpful (especially this one : REST your Models on SAP HANA XS), but here's my problem :

I'm working on SAP Hana Web-Based Development Workbench. I have created a scripted calculation view which relies on two optional input parameters IP_APPID and IP_USERNAME. They are both defined as NVARCHAR(255). Here's the code of my calculation view :

BEGIN
   var_out = SELECT avg( workflows."DURATION" ) AS "AVG_TIME", max( workflows."DURATION") AS "MAX_TIME", sum( workflows."NBERRORS" ) AS "NBERRORS"
    FROM "DPAnalytics"."dp::WORKFLOWS" AS workflows
    WHERE workflows.APPID LIKE '%'||COALESCE(:IP_APPID,'%')||'%'
    AND workflows.USERNAME LIKE '%'||COALESCE(:IP_USERNAME, '%')||'%';
END



Pretty straightforward. This view works fine when I call it myself.
I have an XS OData service with the following definition in it :

"dp::FLOWS_ANALYTICS" as "Stats"
    keys generate local "StatID"
    aggregates always
    parameters via entity "Input";



However, when trying to activate my service I get the following error :

dp:service.xsodata] Unsupported parameter "IP_APPID" in object "dp::FLOWS_ANALYTICS".

[dp:service.xsodata] Unsupported parameter "IP_USERNAME" in object "dp::FLOWS_ANALYTICS".

I couldn't find much on the subject. My parameters are single values, and I saw that NVARCHAR is supported. So what's going wrong there ?