on 08-30-2013 3:02 AM
Dear All
I have an EntitySet by Name Roles
EntityName is Role
Properties are RoleId, RoleName (both of type string)
I neam calling the getEntitySet of my odata service as follows
/sap/opu/odata/sap/GRC_ACCESSREQUEST_CREATE/Roles?name='RoleName'&value='abc'
However it_key_tab of the redefined GetEntitySet never gets populated
My question is whether there is way to populate this table from OdataService URL
Please help points will be rewarded.
Best Regards
Gaurav
Hi Gaurav,
IT_KEY_TAB and IT_FILTER_SELECT_OPTION are meant for different purposes.
As the name of the variables suggest, IT_KEY_TAB holds the keys of the ENTITY during runtime, whereas IT_FILTER_SELECT_OPTION will hold the filter conditions used in the query.
An entity in OData world is always identified by its atom Id. So if you try to access an entity (not the collection) by the Atom ID(i.e by the keys) then in GET_ENTITY method you can see IT_KEY_TAB populated. For that as Krishna Kishor Kammaje mentioned you need to trigger a read request.
But when you perform a filter on an entity collection, the filter criteria will come in IT_FILTER_SELECT_OPTION in the get_entityset method.In a query like /Products?$filter=Price le 200 and Price gt 3.5, you never pass the atom id of an entity rather you address the collection of entities. so Your IT_KEY_TAB is empty.
Regards,
Atanu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaurav,
If you have all the keys then you use READ. Ex:
/Products(<productID>)
In this case key tab will be populated. But remember to check in Get_entity method. (READ)
If you do not have all keys then you do a $filter. Ex:
/Products?$filter=Price le 200 and Price gt 3.5
Now you need to look at filter_options in get entity set method. (QUERY)
Thanks
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.