cancel
Showing results for 
Search instead for 
Did you mean: 

System query options not allowed in the requested URI,ODATA,SAPUI5

Former Member
0 Kudos

Hi Experts,


we created an Odata service based on BEX  easy query , and when i try to use any system query option i get this

any one knows how to solve this , thank you in advance


System query options '$orderby,$skip,$top,$skiptoken,$inlinecount,' are not allowed in the requested URI


Best Regards

Reda

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This message was moderated.

former_member184867
Active Contributor
0 Kudos

Hi Reda,

Please share the URI which is being fired by UI5 application.

Which version of Netweaver Gateway are you using?

Regards,

Atanu

Former Member
0 Kudos

hi atanu,

,

the link is in an internal server , but you'll find below the query generated , by sapui5

but when i query the odatavia the browser

IS there is any way so i can prevent the sapui5 from generating those system query options or how can i modify the metadata of my odata service, not that im using dataservices version 2 wich allows these kind of system query options, and im not querying any measures

I want to change the property attribute Sap:filterable to true instead of false, i think that would do the trick

Kind Regards

Reda

former_member184867
Active Contributor
0 Kudos

one more question, are you firing a read or a query? From the second picture it looks like you are firing a READ as you have only ENTRY in the response of the Gateway service.You can not use $top,$skip,$inlinecount with READ. If you do so Gateway will throw such error.

So I think in UI5 you also need to fire read instead of a query..

Former Member
0 Kudos

HI,

Can you please explain more, i didn't get the point from firing a query or a read , are you reffering to the methods GET / POST...... and in case im using a read as you said what can i do ?

Best Regards

Reda

former_member184867
Active Contributor
0 Kudos

As you mentioned when you fire the URL in the browser you got a response something like, here I shall assume that this is your full response body.

A QUERY URL should look like "http://<host>:<port>/namespace/CollectionName?$top=XX&$skip=YY"

$top/$skip is makes sense here as multiple entities are expected in response.

Now a READ URI would look like ''http://<host>:<port>/namespace/CollectionName(KEY FIELD).

As CollectionName(KEY FIELD) always return only one entity, $top,$skip does not make any sense here.

oDatamodel.read() method can be used to fire a read call.

Regards,

Atanu

Former Member
0 Kudos

hi ,

I  believe your answer is very helpful although i don't know how can i show the result in my table after, so this is my code

  var oModel = new sap.ui.model.odata.ODataModel("http://<host>:<port>...../sap/opu/odata/sap/ZMPA01_Q001_EQ",false,); 

        

          oModel.read("/AZMPA01_Q001_EQResults('1.2.1.1%3A7_0000002.2013')");

          oTable.setModel(oModel); 

         

         oTable.bindRows("/AZMPA01_Q001_EQResults");

But it doesn't work , ca you please tell me how should i modify it , to have the result in the table i created

Kind Regards

Reda

Former Member
0 Kudos

Hi atanu,

I managed to solve the problem, now i have a one last question , if i may:

my OData service is based on a BEX query, that have a parameter , i'm wondering if i can filter the results based on the paramaeter values , note that the value will be an input of the user

Kind Regards

former_member184867
Active Contributor
0 Kudos

You can pass the filter using the following code......

var f2 = new  sap.ui.model.odata.Filter('<PROPERTY NAME>', [{operator:"EQ" ,value1:"<VALUE>"}]);

oTable.bindRows("/<COLLECTION NAME>",'<PROPERTY NAME>', undefined, [f2]);

oTabel.getBinding('rows').refresh()

deepnain_kundra
Participant
0 Kudos

Hi Reda,

I am also facing the similar issue. Could you please advice how you have solved it?

Regards,

Deep Nain Kundra

Former Member
0 Kudos

use load instead of read

oModel.loadData(sURL, oParameters, async, sType, bMerge, bCache, mHeaders)

Former Member
0 Kudos

I use this with sType "POST", but FireFox and Chrome are using OPTIONS in the call...

how can i fix this? is it a framework-Problem(currently using 1.16.9).

best regards