cancel
Showing results for 
Search instead for 
Did you mean: 

Supported OData Query Options

Former Member
0 Kudos

Hi all,

OData supports query options like $filter=cityfrom eq 'SINGAPORE' or $select=...

(A full list can be found [here|http://www.odata.org/media/16352/%5Bms-odata%5D.pdf])

1) Which options are supported by Gateway?

2) What is the "Gateway Solution" to filter the result of the GetList/Query command for a specific entity?

(e.g. return all flights with city of departure equal to 'Singapore')

Best Regards,

Florian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi -

Supported options are listed in [Note 1574568 - SAP NetWeaver Gateway 2.0 - Known Constraints|https://service.sap.com/sap/support/notes/1574568]. There are currently some limitations for query options like $filter.

But it can handle what you describe (e.g. filtering flights by depart city). It would be just as you had it. For example, .../FlightService/FlightCollection?$filter=cityfrom eq 'SINGAPORE'&...

Regards,

Jin

udo_schfer
Member
0 Kudos

Hi

sorry to revive this old isse, but I have some trouble filtering access for the flight demo. I can search & filter the account demo data ok. But in the flight example I can only access a single element like this:

http://gw.esworkplace.sap.com/sap/opu/sdata/sap/DEMO_FLIGHT/z_demo_flightCollection(value='020408_DL198420090413',scheme_id='Z_DEMO_FLIGHT',scheme_agency_id='HU2_800')

(works) but

http://gw.esworkplace.sap.com/sap/opu/sdata/sap/DEMO_FLIGHT/z_demo_flightCollection?$sap-client=800&... eq 'SINGAPORE'

fails with error 400 (or any other filter combination).

What am I missing here?

thanks,

Daniel

martin_bachmann
Advisor
Advisor
0 Kudos

Hi,

please have a look at the metadata, here you can see the attribute 'sap:filterable'. It has to be set to 'true'. As a reference this service can be used: [http://gw.esworkplace.sap.com/sap/opu/sdata/iwcnt/contact/ContactCollection?sap-client=800&$format=xml&$filter=SearchTerm eq 'Gateway' |http://gw.esworkplace.sap.com/sap/opu/sdata/iwcnt/contact/ContactCollection?sap-client=800&$format=xml&$filter=SearchTerm eq 'Gateway' ]

In this case the metadata shows: sap:filterable=true.

Hope this helps,

Martin

Former Member
0 Kudos

HI

using oData service when i want to fetch the email from its return perfectly.


/Employee?$filter= Email eq 'test@gmail.com'

but i want the data which have a slash '\'.

/Employee?$filter= DomainAndUsername eq 'company\ali.naveed'


<d:DomainAndUsername>

company\ali.naveed

</d:DomainAndUsername>


Kindly Guide me .


Regard

Ali

Former Member
0 Kudos

Maybe state what your problem is?

Former Member
0 Kudos

Hi

Problem is when i apply filter and data has a Slash ("\") for e.g company\ali.naveed

its give me error.

http://192.168.59.229:8080/gateway/odata/sap/EmployeeDataList;v=1/Employee?$filter= DomainAndUsername eq 'company\ali.naveed'


if i query without Slash ("\") for example in email  its working.

/Employee?$filter= Email eq 'test@gmail.com'

what is process to fetch data which contain a slash("\")?

Regard

Ali

kammaje_cis
Active Contributor
0 Kudos

Can you try escaping slash? Example:

$filter= DomainAndUsername eq 'company%2fali.naveed'

Former Member
0 Kudos
Former Member
0 Kudos

Hi everyone,

We are trying to filter a date type of Edm.DateTime, but I was not able to get it to work.

Neither a format of


filter=EndDate lt \/Date(1446296400000)\/

nor of a format to the tune of

$filter=EndDate lt DateTime'2012-05-29T09:13:28' or

$filter=EndDate lt '2012-05-29T09:13:28'

seems to be working. Eithere I get a "Invalid token detected at position 11" or

""Invalid system query options value".

Can someone shed some light on this?

Is this supported after all?

Thanks, Rolf

AshwinDutt
Active Contributor
0 Kudos

Hello Rolf,

Please try as below it should work.

?$filter=OrderDate eq datetime'2014-03-11T14:49:52'


Regards,

Ashwin

Former Member
0 Kudos

Hello Ashwin,

Many thanks for the hint, it is indeed working now!

I got an error message due to a missing & before the $filter,

which I found out through debugging.

Regards, Rolf

Answers (2)

Answers (2)

0 Kudos

Supported options are listed in [Note 1574568 - SAP NetWeaver Gateway 2.0 - Known Constraints|https://service.sap.com/sap/support/notes/1574568].   There are currently some limitations for query options like $filter.

But it can handle what you describe (e.g. filtering flights by depart city).  It would be just as you had it.  For example,  .../FlightService/FlightCollection?$filter=cityfrom eq 'SINGAPORE'&...

Regards,

Suman

Former Member
0 Kudos

hi Suman. It is asking for username password when I try to open this note. What is the username and password for it?

0 Kudos

Hi Arslan,

Sap s-user user name and password.Sap service market place user name.

other way

1 . Transaction SNOTE

2 . Goto-Download sap note ( Top of the screen)

3 . Enter the note number (1574568) then Execute

4 . After download the note, Double Click on the note number

5 . Or go back click on overview,enter the note number ,Execute

Former Member
0 Kudos

This message was moderated.