on 04-13-2016 2:31 PM
Hi,
I have an entity type.... with the following fields
Employee ID
Employee Name
In the url, I want to pass along with the entity set name two other filter parameters
For eg.
http://nwfront.abc.net:2020/sap/opu/odata/sap/ZMY_SRV/allRulesSet?$filter=DepartmentID eq '1' and DepartmentName eq 'Testing'
Based on these filters, I want to get all the employees id and names in the get_entityset method in the export parameter et_entityset
Is it possible?
I don't want to include the Department ID and Department Name fields in the entity type as my model will have duplicates ( same values repeated) for these fields all over and unwanted columns.
Thanks and Regards,
Gopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Emanuel,
Thank you for the solution.
I went through the document. It is quite informative with respect to filtering and paging.
However, my requirement is I want only two columns ( fields ) that should go as part of my et_entityset output.
And my entity type should only contain the two column fields
Employee ID
Employee Name
And I should be able to pass Department ID and Department name as filters.
But when I tried yesterday, the filtering won't happen as Department ID and Department name fields are not part of the entity type along with Employee Id and Employee Name.
So even if I give all the four fields as part of my entity type, can I anyhow delete the other or disallow the other two repeating fields from the final et_entityset.
I know that columns from an internal table cannot be deleted either. But that doesn't make sense too.
Thanks and Regards,
Gopa
Hi,
If you are hardbound on your requirement of not having additional fields on the entityset (which does not make much sense to me), then you can create a function import which will have filters as input parameters (Department Id and Department name-again a filter on name is never advised and it should be only on id) and exporting would be the same entity which has two fields - Employee Id and Name.
It should serve your purpose.
BR.
how difficult for you to try in the system?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
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.