Skip to Content

how to bind xsodata in sapui5 table?

Jul 31, 2017 at 08:03 AM


avatar image

I am trying to bind xsodata in sapui5, but i don't know how to instantiate xsodata model in it . Also, is it possible to perform create and update operation with the help of xsodata in sap hana database from sapui5

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

2 Answers

Best Answer
Ashwin Narayan Aug 01, 2017 at 10:54 AM

Hi Naresh,

As rightly mentioned by Srikanth, there is no much difference between how to evoke and use a web service or an xsodata file.

For your better understanding i have created a small mock up, this i'm doing in controller to save time, you can do it manifest.json which is adviced.

Hope the below code works for you, Note: I have used sap.ui.table library for this. Please do let me know if you need further assistance on the same.



<<XSODATA File>>
"Your package Name::Your calculation View Name" as "Entity"
keys generate local "genID";
<<Controller file>>
var oTableInstance = this.getView().byId("your table id");
var oModelName= new sap.ui.model.odata.ODataModel("/path to xsodata file.xsodata", true);
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hii Ashwin,

Thanks for your help,

yes by this way ,I am able to bind the data to sapui5. But,can you help me in performing create and update operation with the help of xsodata in the hana database.

Now, I am trying to fill data in the inputs of sapui5 frontend , which must get created in hana database table.This is what i am trying to achieve. Can you help me in this?




Hi Naresh,

Glad that it worked for you. Getting back to your requirement I have came across a blog which serves the exact purpose and will perfectly suit your requirement.

CRUD Operations With XSODATA

All the best!!



Srikanth KV Jul 31, 2017 at 05:44 PM

XSOData model instantiation in UI5 like any other v2 OData model... there is no difference in model instantiation on UI5 between Gateway and XSOData.

Create a model entry in manifest.json and point the metadata url to XSOData on HANA

CRUD operations can be performed on XSOData for catalog objects like tables only. It is possible to write OData exits that contains any custom code using XSJS for Create and update operations

10 |10000 characters needed characters left characters exceeded