cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Batching multiple operation in a single request

GowthamRaja
Active Participant
0 Likes
3,536

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

View Entire Topic
0 Likes

Hi,

Can multiple batching operations be used for $filter and $select operations as well... ?

Regards

Prasanna.

arunchembra1
Participant
0 Likes

Hi Prasanna,

Please find the below link.

http://scn.sap.com/docs/DOC-45504

Thanks,

Arun Chembra

0 Likes

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.?

arunchembra1
Participant
0 Likes

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

0 Likes

Hi Arun,

If i execute the requests separately its fetching the data.

Now i am geeting an error "Invalid type for '$filter' system query option. Expected type is 'Edm.Boolean'" when do a batch operation.

I have redefined both the changeset begin and change set end.

Regards

Prasanna.

arunchembra1
Participant
0 Likes

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

0 Likes

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

arunchembra1
Participant
0 Likes

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

0 Likes

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

Former Member
0 Likes


Hi Prasanna,

We are also facing the similar kind of  issue. Have you got any solution for this?  If so, Can you please share with us.

Thanks in advance.

Regards,

Sandhya

AshwinDutt
Active Contributor
0 Likes

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

Former Member
0 Likes


Hi Ashwin,

Working fine now. Thank you

Regards,

Sandhya