on 12-13-2012 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
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
Hi Jibin,
this is my url : http://server:port/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/$batch
this is my header info:
this is my body content:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raja,
If you are using SUP ODP to consume Gateway REST services, here is some android saple code to send multiple request in single call. Please revert back if this is what you are looking for. I will share you the code to hadle the response as well.
ISDMBundleRequest batchRequests = new SDMBundleRequest();
String serviceDocPath = "http://<host>:port /sap/opu/sdata/iwfnd/RMTSAMPLEFLIGHT/";
ISDMRequest serviceDocRequest = buildRequest(serviceDocPath , (ISDMNetListener) this);
batchRequests.addRequest(serviceDocRequest);
ISDMRequest metaDataRequest = buildRequest(serviceDocPath + "$metadata",(ISDMNetListener) this);
batchRequests.addRequest(metaDataRequest);
searchURL = "http:// <host>:port/sap/opu/sdata/iwfnd/ RMTSAMPLEFLIGHT/carrierCollection";
ISDMRequest collectionDataRequest = buildRequest(searchURL, (ISDMNetListener)this);
batchRequests.addRequest(collectionDataRequest);
getRequestmanager().makeRequest(batchRequests);
Regards
Rohith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raja,
If I understand your question correctly, You are trying to send batch requests to gateway.
Batch => Multiple operations in single call/requests.
The cample code I shared above is to send batch/bundle requests from android application to gateway using SUP.
SUP:- Sybase unwired platform which is a mobile platform ofering from SAP to develop online/offline mobile applications.
Is my undertsnading correct here?
Regards
Rohith
Hi Rohith,
I am doing an android application that i am scanning a barcode and getting the value of the barocode.
My Requirement is:
I have to pass the value stored in a variable to get the details of a value from sap system backened table. How to do this Please guide me. Awaiting for your reply, Thanks
Hi,
As per the document
How To Batch Multiple Operations Into A Single Request
i cannot post the batch operation as mentioned in page.18, after sending the request it displays as
"The server is refusing to process the request because the entity has a unsupported format" and the status code as 415-unsupported media type. kindly help me on this to resolve the problem. Thanks
Hi Gowtham,
Its all depends on ur entity design .
- we can use GetEntitySet Method if Barcode information is also presented in same entity with help of $filter option.
- If not available use custom operation http://www.odata.org/documentation/uri-conventions#ServiceOperationParameters .
- one more option is to use "select" option which is also implemented in GETEntityset . I think this option is provided by SAP not from Odata Protocol.
Regards,
Jibin
Hi Raja,
If I understand the question correctly, the $batch is the only operation that you can use to send multiple requests over one http call.
It is possible to use the RFC methods, but the $batch function was introduce in SP4 (I believe) so if you were running SAP NetWeaver Gateway 2.0 SP3 as in the How-to guide example, it wouldn't work.
Regards,
Wayne
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.