cancel
Showing results for 
Search instead for 
Did you mean: 

it_key_tab of GetEntitySet never gets populated

former_member220853
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184867
Active Contributor
0 Kudos

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

kammaje_cis
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Krishna,

so does it mean that IT_KEY_TAB is never populated for GET_ENTITYSET method?
in case it does could you please provide a usecase?

Thanks much!

Regards,

Haritha