Skip to Content
author's profile photo Former Member
Former Member

Calculated views with multiple input parameters and XS OData

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 ?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Aug 10, 2016 at 03:47 PM

    Hi Max,

    can you please show the parameter definitions in your scripted calc. view.

    Thx.

    Florian

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.