on 09-10-2016 7:55 AM
Hi,
Service call : /sap/opu/odata/sap/ZEMPS_SRV/$batch
My request is
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
Accept: application/xml
GET ztotal_EmpSet/?$filter= StartDate+eq+'24.08.2016 00:00:00'+and+EndDate+eq+'28.08.2016 23:00:00'+and+Unit+eq+'50006636'+and+DateField+eq+'BASIC'+and+Id+eq+'EMP1' HTTP/1.1
--batch--
The debugger is going into the get_entityset method, but
it_filter_select_option is empty.
How do I get these filter values?
Regards,
Gopa
If this works,
My actual requirement is to pass multiple employee ids, and multiple units... in the same batch
Based on the combination, I have to filter and get the output in my backend and pass the final filtered values along with their details to the front end.
Regards,
Gopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Gopa,
The reason why filters are blank because i see there is an extra space between $filter Keyword and the parameters. See the highlighted in Red as below. So you need to remove the space and then it works.
However date value is also going wrong and it should go as below ( highlighted in yellow ).
Using OR operator you can send multiple values as below.
Regards,
Ashwin
Hi Ashwin,
Thanks for the multiple values query.
However, I tried removing the space earlier itself, it was giving error.
' invalid token detected at position number 24 ' in the error log.
Without the date fields it's working fine now. I am getting the filter values. So I am seeing the datetime field passing.
After doing the complete change with datetime, it is giving the error.
Invalid parametertype used at function 'eq' (Position: 11) in the error log.
Below is the new query
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
Accept: application/xml
GET ztotal_EmpSet/?$filter=StartDate+eq+datetime'2016-08-24T00:00:00'+and+EndDate+eq+datetime'2016-08-28T23:00:00'+and+Unit+eq+'50006636'+and+DateField+eq+'BASIC'+and+Id+eq+'1' HTTP/1.1
--batch--
Regards,
Gopa
I just checked the entity type.
StartDate and EndDate both are of type string i.e. edm.string not datetime..
I am getting all the five values in the filter if I pass the get like...
GET ztotal_EmpSet/?$filter=StartDate+eq+'24.08.2016T00:00:00'+and+EndDate+eq+'28.08.2016T23:00:00''+and+Unit+eq+'50006636'+and+DateField+eq+'BASIC'+and+Id+eq+'1'HTTP/1.1
However, I want to pass the Start date as 24.08.2016 00:00:00 with a space as a string using something like
GET ztotal_EmpSet/?$filter=StartDate+eq+'24.08.2016 00:00:00'+and+EndDate+eq+'28.08.2016 23:00:00''+and+Unit+eq+'50006636'+and+DateField+eq+'BASIC'+and+Id+eq+'1'HTTP/1.1
So the batch request is not taking the space here.
Can you tell me how can I pass the date as a string with space?
Gopa
Hey Ashwin,
Can you give me an example as to how to call a batch request for POST in UI5 for the below:
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
Accept: application/xml
GET ztotal_EmpSet/?$filter=StartDate+eq+datetime'2016-08-24T00:00:00'+and+EndDate+eq+datetime'2016-08-28T23:00:00'+and+Unit+eq+'50006636'+and+DateField+eq+'BASIC'+and+Id+eq+'1'HTTP/1.1
--batch--
Any link would also be helpful.
Regards,
Gopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.