Skip to Content
0

VizFrame on HANA XS OData service

Feb 27 at 08:24 PM

39

avatar image
Former Member

Hi,

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,
Dietmar

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
0

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?

Thanks

Bruno

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

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:
https://blogs.sap.com/2017/07/28/stacked-barcoumn-chart-example-using-vizframe-in-ui5./

How would you change that one to OData?

Cheers,
Dietmar

0

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

Bruno

0
avatar image
Former Member
Mar 01 at 07:10 AM
0

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

vizFrame.setModel()

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

Share
10 |10000 characters needed characters left characters exceeded