cancel
Showing results for 
Search instead for 
Did you mean: 

Calculated views with multiple input parameters and XS OData

Former Member
0 Kudos

Hi everyone !

I know there are thousands of topics on the subject, which have all been really helpful (especially this one : ), 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 ?

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

Hi Max,

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

Thx.

Florian

Former Member
0 Kudos

Hi Florian,

Sure, here you go :

As for their definition in xml (generated automatically) here it is, if that can be of any help :


<localVariables>

  <variable id="IP_APPID" parameter="true">

    <descriptions defaultDescription="IP_APPID"/>

    <variableProperties datatype="NVARCHAR" length="255" mandatory="false">

      <valueDomain type="empty"/>

      <selection multiLine="false"/>

      <defaultRange/>

    </variableProperties>

  </variable>

  <variable id="IP_USERNAME" parameter="true">

    <descriptions defaultDescription="IP_USERNAME"/>

    <variableProperties datatype="NVARCHAR" length="255" mandatory="true">

      <valueDomain type="empty"/>

      <selection/>

      <defaultRange/>

    </variableProperties>

  </variable>

</localVariables>

Max

pfefferf
Active Contributor
0 Kudos

Can you replace in the XML representation for both parameter the <selection ...> tag with "<selection multiLine="false" type="SingleValue"/>".

It looks like an issue of the web base dev workbench which does not set the attributes correctly.

Regards,

Florian

Former Member
0 Kudos

Thank you Florian !

You found the problem, now my service is activated.

Regards,
Max.

Answers (0)