Skip to Content

How to call Odata with input parameter

Jun 29, 2017 at 11:00 AM


avatar image

Hi experts,

I'm quite new to Fiori and Sapui5.

Im developing an application starting from Master-Detail template. I need to connect to an Odata service which requires an id as input to give me results.

I'mo not sure how and where to write the code to pass the input. I thought that this wuold be in manifest.json or component.js since in manifest there is the datasource definition with the uri and in the component there is the call to the getModel() but what I tried so far did not work.

I don't know what code you need to understand my problem so I would wait for your reply and your request to post the necessary part of the code.

Thank you

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

1 Answer

Marco Dalena Jun 29, 2017 at 03:07 PM


I managed to get the data, but now I have trouble to save them in my models.

These are the instructions I used inside Component.js:

var aFilterIds = ["AppraiseeId"];
var aFilterValues = ['00000108'];
var aFilters = this._createSearchFilterObject(aFilterIds, aFilterValues);
var mParameters = {
    filters : aFilters,
    success : function (oData) {}.bind(this),
    error: function (oError) {}.bind(this)
this.oAppModel = this.getModel().read("/HrLists", mParameters);

After the read(), I get this in console:

Object { abort: abort() }

But I can read, from the POST response all the data I need:

I tried defining oAppData as JSONModel and ODataModel.

If I remove the filter from the Odata service, and I call then the service with:

this.oAppModel = this.getModel();

the app works like a charm.

Any ideas?

Thank you

odata-error.png (15.4 kB)
Show 6 Share
10 |10000 characters needed characters left characters exceeded


A thing to be noted. Unless you make binding to ui, you cannot expect the data in model. Not sure whether it is inline to the discussion, most of the people make a wrong assumption here.


Hi Devender,

How to design F4 help in UI5 same like in SAP GUI.

I have already created Odata service importing search help for Sales orders, now i want call that same like how we execute in ECC.

Please give some suggestion on this.


better you post it as another thread


Thanks Devender,

Small Doubt, here how to connect OData and populate the fields.


Any Suggestion Devender?.