Skip to Content

VizFrame on HANA XS OData service

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • 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?

    Thanks

    Bruno

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • 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

    vizFrame.setModel()

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

    Add comment
    10|10000 characters needed characters exceeded