Skip to Content
avatar image
Former Member

oDATA invalid key predicate

Hi,

I am trying to perform a get_entity_set read with a key passed

in order to extract all data in the collection with a specific key in the model [fileid in my case].

The url I pass to perform the read is

/sap/opu/odata/sap/Z_COLL_PORTAL_SRV/fileRepositorySet('fileid20150915')

and when I execute I get the message

'Invalid key predicate'

Can anyone help me to find how to fix ?

pastedImage_0.png (40.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 16, 2015 at 12:42 PM

    Hello Bressi,

    Is it a Date which you are sending as input as Key ?

    The URL you are using is to Read the data based on a Key value and for READ GW response will always have a single entry as output and can be null if no matching found.

    For your scenario you need to send inputs as part of filters to get all the data matching to the input you are sending.

    Please check the below for details ->

    Let’s code CRUDQ and Function Import operations in OData service!

    Regards,

    Ashwin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 05, 2015 at 01:47 AM

    Try the URL as below:

    /sap/opu/odata/sap/Z_COLL_PORTAL_SRV/fileRepositorySet('20150915')


    Only when there are multiple key fields, you need to mention field name for filter


    Charles

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 07, 2015 at 08:45 AM

    Hi Claudia,

    As Ashwin said, you should filter as mentioned in the URL syntax for getting the collection list. If you want to get a single record you should send the field with in the phraces as u have mentioned.

    Add comment
    10|10000 characters needed characters exceeded