Skip to Content
0
Mar 10, 2017 at 09:56 AM

Using calculation view with input parameters in SAPUI5 control

777 Views

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:

					<StandardTile 
						id="__RequestsInProgress"
						title="In Progress" 
						icon="sap-icon://settings" 
						info="Requests" 
						number="{NumberOfRequests}"
						infoState="Success" 
						binding="{/RequestsByStatusParameters(IP_Status='SG02')/Results}"
						press=".onRequestsInProgressPressed"/>