Skip to Content

VizFrame on HANA XS OData service

Feb 27 at 08:24 PM


avatar image


I am trying to build a VizFrame Timeseries Line Chart that shows data from a simple HANA XS OData service.

Does anyone have a minimalistic example that does that? All available examples I find use local JSON datamodels :-(

Thanks a lot,

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Bruno Lucattelli
Feb 27 at 09:56 PM

SAPUI5 reference does show some examples using json files only. However, shouldn't that be easily changed to ODATA services in your implementation? I mean, most SAPUI5 models can be easily switched from ODATA to JSON and vice-versa with little coding changes.

Does this case has something different?



Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Bruno,

At least I was not be able to do the conversion from JSON to OData :-(

All examples load the JSON manually whereas I think it is best practice to load OData by the UI5 framework?

I used this example:

How would you change that one to OData?



Hi! So your issue is much simpler.

Based on this example, your metadata.json refers to a sap.ui.model.json.JSONModel model. You have to change that to a sap.ui.model.odata.ODataModel. Please consider that are other settings in metadata.json that needs to be adjusted in the model section for OData to work.

Then, you'll have to adjust your data binding.Heres an example.

Hope this helps


Chapman Wong
Mar 01 at 07:10 AM

It is pertty much similar to bind JSONModel dataset except:

1. call the oDataModel by calling

sap.ui.model.odata.v2.ODataModel(URL, username, password) 

2. you set this oDataModel to vizFrame by calling


The rest of the definitons like FlattenedDataset and feedings are no difference than JSONModel binding.

10 |10000 characters needed characters left characters exceeded