cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Fiori - Call OData Service with Parameters

kiefer500a
Explorer
0 Kudos

Hi there,

how can I call an OData Service or one of its methods with input parameters?

I do not want to load to much data in model so would it be possible to only load the needed data?

Thanks and best regards.

Jay

Accepted Solutions (1)

Accepted Solutions (1)

former_member667434
Active Participant

You can filter OData using $filter query and load data accordingly.

Ashutosh

Answers (1)

Answers (1)

anmolamb
Participant

Hi Jay,

If you are calling read method then you can pass the $filter ( like mentioned by Ashutosh ) in the following fashion. If you want to limit the output you can also pass $top for getting only few records for the beginning.

var entitySet_url = lv_oDataUrl + "SetName?$filter=(field1 eq '') &$etop=20";
OData.read(entitySet_url, function(oResponse) { }

Regards,

Anmol

		
		
kiefer500a
Explorer
0 Kudos

Hi Anmol,

In which file of my application should I post this code?

thanks

Jay

gregorw
Active Contributor
0 Kudos

I think you should learn the basics by working through the SAPUI5 Walkthrough