cancel
Showing results for 
Search instead for 
Did you mean: 

How to call OData from sapui5 application in webide

dhiraj_more
Participant
0 Kudos

Hello Experts,

I have created a simple application in webide where I used query service to get table entries from backend system. I want to perform CRUD operations where I have some queries.

1. As there are two ways by which i can perform update operation using ODATA.update() method or using ODATA.REQUEST() object where we provide requestUri,method. Now my question is whoch method is better or preferred?

2. If we go for ODATA.update() method then how to get and pass XSRF token from header or is it automatically handled?

3. In case of ODATA.REQUEST() method, Is it safe to pass the requesURI value with Server port details.

Can you please provide your expertise on above questions.

Thanks in Advance for your help.

Regards,

Dhiraj

Accepted Solutions (0)

Answers (1)

Answers (1)

sagarikagattu
Participant
0 Kudos

Hello ,

you can try the below code

ODataModel.update(sQuery,oEntry, { //oEntry is the array which I want to export to oData and sQuery is the entityset

method: "PUT",

error: function(e) { alert("error"); },

success: function(data) { alert("success"); } } );