Skip to Content

Using calculation view with input parameters in SAPUI5 control

Hi guys,

I have a calculaton view which is using an input parameter. The view is exposed as an xsodata sevice. Now, I want to feed data from this view into a set of tiles. The problem is the syntax when referring to specific fields from my view. I can use a syntax like "{RequestsByStatusParameters(IP_Status='02')/Results}, which gives me the "Results" collection - which in my case consists of one single element (the one with IP_Status = '02'). The problem is I cannot find a way to refer to the individual elements (fields) inside this "Results" entity...

I have found forum posts showing how to bind the entire "Results" entity to a table, but that's not what I need. I need to refer to the specific fields inside Results. If I do so, like for instance "...Results/myFieldName", I get an error stating that I can only use $count after "Results", since the "last node is a collection".

My UI5 control - a tile - looks like this:

						title="In Progress" 
Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Posted on Mar 10, 2017 at 05:08 PM

    To refer to the individual element you need to use OData url with Key in the url.

    As for the calculation view's XSOData definition is to generate local keys, so at runtime key is generated and we don't what is the key value.

    service {
        "sample.odata::view" as "MyView" key generate local "GenID";

    Only approach I could think of is to perform read operation on the model ...something like and get the results to perform binding

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 10, 2017 at 08:41 PM

    since you are referring to a data set and you only need one record from the list.. you need to call your end point as you have it.. then basically take the zero index element from the array. did you try this?


    check out the element binding section:

    Add comment
    10|10000 characters needed characters exceeded