on 2012 Dec 13 9:42 AM
Hi Experts,
I am doing a task as displayed below
How To Batch Multiple Operations Into A Single Request
whether the multiple operation in a single request can be done only with Odata using $batch or there is any different approach. is it possble to do it using rfc methods as per link [Content Deleted June 2013] Kindly help me on this issue
Message was edited by: Jason Lax
Request clarification before answering.
Hi,
Can multiple batching operations be used for $filter and $select operations as well... ?
Regards
Prasanna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
Thanks a lot for the quick response. But in my case its always fetching the entity collection though i give the filter condition. The request body looks like below
-------------------------------------------------------------------------------------------------------------------------------------------------
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
Accept: application/xml
GET CUSTOMERCollection/?$filter = COUNTRY eq 'AT' HTTP/1.1
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
Accept: application/jsonxml
GET CUSTOMERCollection/?$filter = COUNTRY eq 'BE' HTTP/1.1
--batch--
---------------------------------------------------------------------------------------------------------------------------------------
Am i missing something here.
Even if i keep the debugger point the table it_filter_select_options is empty.
Could you please help me on this regard.?
Hi Prasana,
1. Instead of batch request call single request and check you are getting data for CUSTOMERCollection/?$filter = COUNTRY eq 'AT' HTTP/1.1 and CUSTOMERCollection/?$filter = COUNTRY eq 'BE' HTTP/1.1 .
2. While calling batch you are getting any erro?
3. Have you redefine/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN and
/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_END methods. If not please refer this link http://scn.sap.com/docs/DOC-45504
4. Please check this link also http://scn.sap.com/thread/3403864
Thanks,
Arun Chembra
Hi Prasana,
The body you are passing was not correct, call service using below body.
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
Accept: application/json
GET WBCollection/?$filter= COUNTRY eq 'AT' HTTP/1.1
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
Accept: application/json
GET WBCollection/?$filter= COUNTRY eq 'BE' HTTP/1.1
--batch--
Thanks,
Arun Chembra
Hi Arun,
I used the same body which u have mentioned above by changing my entity collection.
Now it gives an msg that "Response does not contain any data."
I checked the thread http://scn.sap.com/thread/3403864 and gave the same spacing suggested but still it gives this message.
Am i missing something here.
Regards
Prasanna
Hi Prasana,
This issue was because of spacing only, please try the spacing as shown below.
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
Accept: application/json
<<Only one Enter>>
GET WBCollection/?$filter= COUNTRY eq 'AT' HTTP/1.1
<<Only two Enter>>
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
Accept: application/json
<<Only one Enter>>
GET WBCollection/?$filter= COUNTRY eq 'BE' HTTP/1.1
<<Only three enter>>
--batch--
Thanks,
Arun Chembra
Hi Arun,
Thanks you it worked .
But the issue is though i gave the filter query in the body its returning the entitycollection.
In my case country with 'AT' has 2 records and 'BE' has 3 records. So it should return me 5 records.
But its returning the entitycollection. Should we have to do a separate implementation for this??
Regards
Prasanna
Hello Sandhya,
Please correct the URL,
U need to pass the filters as below :
Sample Payload for ur reference -> Correct ur URL accordingly
--batch--
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
GET get_emp_dataSet?$filter=Userid+eq+'00001'+and+Name+eq+'ASH*' HTTP/1.1
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
GET get_emp_dataSet?$filter=Userid+eq+'00002' HTTP/1.1
--batch--
Regards,
Ashwin
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.