cancel
Showing results for 
Search instead for 
Did you mean: 

No response from Batch during Query Operation

AshwinDutt
Active Contributor
0 Kudos

Hello Experts,


I am Performing a Batch Operation to Query as described below.

But i am unable to see the content in the response.


I have followed the standard way to implement Batch operation as per suggested by Gateway experts in this forum.

Still i am unable to get the content in the response of the batch.


I Kindly request all Gateway experts to provide your valuable inputs to resolve this issue and suggest/guide me if anything is wrong from my side so that i can correct.


The below are the details :


Both /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN & /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_END are redefined.


METHOD -


URL -

http://********/sap/opu/odata/sap/<; My Service Name >/$batch

HEADER -

Authorization: SAP ID & PASSWORD

x-csrf-token:   Enter Token

Content-Type: multipart/mixed; boundary=batch


BODY -


​--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

Accept: application/json

GET get_rec_types1?$filter=ImWhttype eq 'XX' and ImCountry eq 'IN' HTTP/1.1

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

Accept: application/json

GET get_rec_types1?$filter=ImWhttype eq 'XX' and ImCountry eq 'IN' HTTP/1.1

--batch--​

RESPONSE -

RESPONSR BODY -

Thanks & Regards,

Ashwin

Accepted Solutions (0)

Answers (4)

Answers (4)

AshwinDutt
Active Contributor
0 Kudos

Hello Arun,

I also noticed that 400 Bad Request comes only when i apply filters.

With out filters data is coming ( i.e., entity collection ).

Regards,

Ashwin

arunchembra1
Participant
0 Kudos

Hi Ashwin,

Can you try like this

GET get_rec_types1?$filter=(ImWhttype eq 'XX' and ImCountry eq 'IN') HTTP/1.1


Thanks,

Arun

AshwinDutt
Active Contributor
0 Kudos

Hello Arun,

I tried with GET get_rec_types1?$filter=(ImWhttype eq 'XX' and ImCountry eq 'IN') HTTP/1.1

I am getting below error Arun

Regards,

Ashwin

Former Member
0 Kudos

Hi Ashwin,

The error is coming because in BATCH READ operation, while passing the $filter the format is:

GET get_rec_types1/?$filter=ImWhttype+eq+'XX'+and+ImCountry+eq+'IN' HTTP/1.1

Replace all spaces with a '+' sign. It should work fine.

Regards,

Aashika

AshwinDutt
Active Contributor
0 Kudos

Hello Aashika,

Yes i have already figured out that

Thanks for your kind response.

Regards,

Ashwin

AshwinDutt
Active Contributor
0 Kudos

Hello Arun, Jibin,

Now i am able to get the some response in the content for Batch Query, but it is a 400 bad request.

Not able to figure out what is wrong with my URL now.

I have attached the response

Body -

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

Accept: application/json

GET get_rec_types1/?$filter=ImWhttype eq 'XX' and ImCountry eq 'IN' HTTP/1.1

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

Accept: application/json

GET get_rec_types1/?$filter=ImWhttype eq 'XX' and ImCountry eq 'IN' HTTP/1.1

--batch--​

I kindly request to help to correct the URL.

Regards,

Ashwin

arunchembra1
Participant
0 Kudos

Hi Ashwin,

Can you go to transaction /iwfnd/error_log and check this error is showing there or not, i think this issue is not because of the URL. I think its because of data type miss match. Its showing Expected type is 'Edm.Boolean' .

Thanks,

Arun

AshwinDutt
Active Contributor
0 Kudos

Hello Arun,

I did check in error log Arun, it is logged as ' Invalid type for '$filter' system query option. Expected type is 'Edm.Boolean' '.

But i checked with other services. I am getting the same error for those services as well.

When i execute the same URL with the filter parameters which i have used in the body, service is not failing. It is getting data .

If it was a data type miss match it should fail when i execute URL in browser. But its working.

When the filter parameters if i put in body and send, service is failing Arun.

The above mentioned error is coming when it is through Batch Query ( for other services as well )

Otherwise with the same filter parameters (individually) in browser, services are working fine.

Not able to understand what exactly is going wrong when query is through batch.

Regards,

Ashwin

jibin_joy
Contributor
0 Kudos

Hi Ashwin Dutt ,

Please Refer : http://scn.sap.com/thread/3244292

AshwinDutt
Active Contributor
0 Kudos

Hello Jibin,

Batch for read is working fine for me.

Problem is with Batch Query.

Status code is 202 Accepted.

No errors are encountered. But content is empty.

Regards,

Ashwin

arunchembra1
Participant
0 Kudos

Hi Ashwin,

I think you forgot to add '/' (GET get_rec_types1/?$filter=ImWhttype eq 'XX' and ImCountry eq 'IN' HTTP/1.1) verify that , and put an external break point in /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN while executing the service if break point is not triggering that means the problem was with your request body only so please check again.

Please Refer :

Thanks,

Arun

AshwinDutt
Active Contributor
0 Kudos

Hello Arun,

Thanks a lot for your inputs.

I added ' / ' as you suggested in the query and also referred to your blog.

Body is exactly same as you have explained in the blog and also the spacing as well.

But still i am unable to see content in the response and  break point is not hitting /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN.

I am really not able to figure out what might be the mistake in my body.

​--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

Accept: application/json

GET get_rec_types1/?$filter=ImWhttype eq 'XX' and ImCountry eq 'IN' HTTP/1.1

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

Accept: application/json

GET get_rec_types1/?$filter=ImWhttype eq 'XX' and ImCountry eq 'IN' HTTP/1.1

--batch--​

Batch operation for read is working absolutely fine for me with the below body.

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

Accept: application/json

GET get_data11(ImWhttype='C2',ImCountry='TH') HTTP/1.1

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

Accept: application/json

GET get_data11(ImWhttype='C1',ImCountry='TH') HTTP/1.1

--batch--

Problem is with only Query.

Regards,

Ashwin