on 09-16-2015 1:26 PM
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 ?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ->
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes since you want to get collection of data matching to the input you are sending then you need to implement QUERY/Get_Entity_Set method. So that you get the collection of data as you are expecting.
Your URL will look something like this ->
/sap/opu/odata/sap/Z_COLL_PORTAL_SRV/fileRepositorySet?$filter=<Property_Name> eq 'XXXXXXX'
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.