cancel
Showing results for 
Search instead for 
Did you mean: 

Batch operation in SAP Odata gives a syntax error

Former Member
0 Kudos

HI All,

I'm trying to do a batch operation on an Odata set but it gives me a malformed syntax error when i execute the URI in Gateway client.

Please find attached along the screenshot of the same. At the same time when i use "boundary=batch_005056A5-09B1-1ED1-BF82-409B26A80600"he header it gives me a success message but does not give me an entity value. Attached also the screen shot of the same.

Appreciate your help.

Thanks,

Praveen

Accepted Solutions (0)

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Praveen,

At the end can you please replace ' --batch- ' with ' --batch-- and try ?

Regards,

Ashwin

Former Member
0 Kudos

HI Ashwin,

Thanks for your reply.

I did change like you suggested but still same error: 'Malformed syntax'.

Just some more info on the same:

When i try the GET individually it works but in the batch it gives syntax error.

Thanks,

Praveen

AshwinDutt
Active Contributor
0 Kudos

What are the data types for values which are passing as Keys ?

Can you share the edm types used for those key properties ?

For example if you are sending decimal value as input then value should not be enclosed inside single quotes when edm types used is decimal.

If at all you send decimal values inside quotes then also you will get syntax error. Please check these aspects once as well.

Correct URI ->  GET get_dataSet(ProductID='C1',Price=100) HTTP/1.1

Wrong URI ->   GET get_dataSet(ProductID='C1',Price='100') HTTP/1.1

Former Member
0 Kudos

HI Ashwin,

The key fields are of the type edm.string.

Like I said earlier it works perfectly fine when i run the GET operation on these individual entity sets.

only in BATCH it gives me this malformed syntax error.

Thanks

AshwinDutt
Active Contributor
0 Kudos

Ok can you please share the entire payload here ?

brian_zhu
Explorer
0 Kudos

Hi Praveen,

According to the description 1 in section "Attention for batch response" of SAP Note 1869434,

return code 202 means that  the correct request header is added, it has nothing to do with the retrieve operations.

there are some good and bad examples in this note.

also there is another blog for Batch , i think it is very good.

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


regards,

Yueqiang

Former Member
0 Kudos

Thanks Ashwin. Sorry for the delay in replying.

When you say detailed payload do you want me to paste all methods that the entity calls?

Former Member
0 Kudos

Thanks Yueqiang for your reply and the link to the blog.

I do follow the syntax formalities in there but still do not get any output other than the response code 202.

brian_zhu
Explorer
0 Kudos

the prerequisite of using batch is to redefine the following methods:

1) /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN

2)/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHAGESET_END.

for you troubling shooting, you could wrie some dummy codes to the begin and end method

and set up an extenal debug point to the following methods

1) changeset_begin method

2) changeset_end method

3) get_entity_set method

you will found out the following sequence:

call changeset_begin method

call multiple times of get_entityset method

call changeset_end_metho

Given that your single call of get_entityset works, you could see the result.

this is a very mature techniques, we used this in couple of projects with 740, sp8 and above.

regards,

Yueqiang

Former Member
0 Kudos

HI Yueqiang,

It does not even get to those (External)breakpoints although I do have dummy codes there.

It right away gives me the 202 status code without getting to those methods

Thanks,

Praveen