on 04-13-2012 7:34 AM
Hi,
I've successfully pass parameter into get_entityset using it_filter_select_options but is there a better way to pass parameter into get_entityset?
Normally a service like this http://abc.abc.com:8001/sap/opu/odata/sap/TIMESHEETSERV/Weeks('2012-04-23') would only call the get_entity.
What I had done is to utilize the it_filter_select_options - http://abc.abc.com:8001/sap/opu/odata/sap/TIMESHEETSERV/Weeks?$filter=keyDate eq '2012-04-12' to pass in the value into get_entityset. The reason is so I can use '2012-04-12' in get_entityset to get a collection of data.
Please feels free to suggest any other method that I might have overlooked.
Regards,
HK
Hi HK,
I think you are on the right track, to get a subset of values you would use a filter.
One thing to note however is dates and timestamps in ABAP should map to Edm.DateTime and the correct way to access them in a filter would be something like
/Weeks?$filter=keyDate eq datetime'2012-04-12T12:00:00'
for example
I have got the above Northwind example working in my Gateway system, see http://mysapgw.wordpress.com/2012/01/25/filter-string-how-to/, had to parse the datetime string manually, from memory used an xsd:datetime function, but you could just as easily write your own doing similar to what you did in previous question.
Hope it helps.
Cheers
JSP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.