Skip to Content
0

Getting error message while calling Odata service with filter expression from SCP XSJS

Nov 16, 2017 at 06:10 AM

158

avatar image

Hello

I have one Odata service with request URI as below:-

/sap/opu/odata/sap/ZGW_IOT_DELIVERY_DETAILS_SRV/ZES_DELIVERY_DETAILS?$filter=Lfart eq 'LF' and Plant eq 'ZFG1'

Now when i call this URI from gateway client its giving me expected result. Now my purpose is to call this odata service from my XSJS through SCP cloud. I have called gateway service from xsjs successfully for other Odata service without filter expression. But when i am using filter to call this service from xsjs getting this error message :-

jsn Invalid request received by HTTP proxy: java.lang.IllegalArgumentException: invalid version format: = LFART EQ 'LF' AND PLANT EQ 'ZFG1'?$FORMAT=JSON HTTP/1.1

Here is the request message i have built in xsjs :-

request = new $.web.WebRequest($.net.http.GET,"/ZES_DELIVERY_DETAILS?$filter = Lfart eq '" + lfart + "' and Plant eq '" + plant + "'?$format=json");

Any idea why using filter I am getting this error message?

Thanks,

Sunit

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

6 Answers

Ankit Maskara
Nov 17, 2017 at 05:23 AM
1

Seems like Gateway oData is ignoring the incorrect format but SCP cloud's version is not.

You URL is bit wrong. Try as below

request = new $.web.WebRequest($.net.http.GET,"/ZES_DELIVERY_DETAILS?$filter = Lfart eq '" + lfart + "' and Plant eq '" + plant + "'&$format=json");

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Ankit,

Thanks for replying.

Even after using your url I am still getting the same error message what I was getting earlier. I agree with you- the url format perhaps incorrect ;hence looking for correct format using filter that is understandable by Gateway.

Any further idea? please let me know.

Thanks, Sunit.

0

Can you paste the URL which you are trying now?

0
avatar image
Former Member May 01 at 12:05 AM
1

Hi,

Maybe the problem is the spaces in the URL try this:

var uriEncoded = encodeURI("/ZES_DELIVERY_DETAILS?$filter = Lfart eq '" + lfart + "' and Plant eq '" + plant + "'?$format=json");

request = new $.web.WebRequest($.net.http.GET, uriEncoded);


Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 16, 2017 at 07:49 AM
0

Is cloud connector running fine at both ends? check the destination set up too

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Muhsin,

Thanks for replying.

Yes destination is fine as its working for other Odata service without filter. Cloud connector is also working.

Thanks,

Sunit

0
avatar image
Former Member Jan 30 at 11:31 AM
0

Hi,

Even we are facing the similar issue. Did you find a fix to the issue?

Thanks,

Mayur

Share
10 |10000 characters needed characters left characters exceeded
chaithra lakshmi Jun 18 at 11:43 AM
0

Hi

I'm also facing same issue, i'm not getting how to fix it. if anyone found solution ? Please let me know.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

please open a new thread and mention the URL

0
Ivan Mirisola
Jun 20 at 06:21 PM
0

Hi chaithra lakshmi

Read the comments about encodeURI in this exact same thread entered on May 01 at 12:05 AM. If it doesn't help you should open a new thread as mentioned by Ankit.

Regards,
Ivan

Share
10 |10000 characters needed characters left characters exceeded