Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 


SAP Cloud Integration provides support to create and host/provision your OData services via the creation of OData Service artifacts. You can find more information about OData Service creation in the documentation

This blog explanations on how to invoke the provisioned service in $batch mode and excludes the details on how to create an OData Service.

OData Service

There is no extra configuration or implementation required in OData Service projects to enable $batch mode invocation. As of now the $batch works with below scope/restriction

  1. Only one operation is support per changeset

  2. The Message Processing Log (MPL) per changeset is generated

An OData Service as shown in the below example will be used for the explanation. This OData Service is internally designed to invoke another OData service.

Below is the integration flow generated for Query operation of ProuctSet of OData Service. The integration flow editor opens upon clicking on icon under the Action column against the operation.


Upon successful deployment of this OData Service, the endpoint is generated and hosted. The hosted endpoint information is available under the Monitoring -> Overview -> Manage Integration Content as shown in below screenshot. Copy and use this endpoint where it is needed to be invoked.


Invoking OData Service

In this example, let’s invoke this OData service in a REST client application, POSTMAN. You need to append /$batch at the end of OData Service URL, e.g. in our case it will be https://<tenant-host>/gw/odata/SAP/ODATA_SERVICE_BATCH_DEMO;v=1/$batch. You need to first fetch the csrf token and use it in the HTPP POST request.

Below is the POST request payload content
Content-Type: application/http
Content-Transfer-Encoding: binary

GET ProductSet(3) HTTP/1.1

Content-Type: multipart/mixed; boundary=changeset_1

Content-Type: application/http
Content-Transfer-Encoding: binary

POST ProductSet HTTP/1.1
Content-Type: application/json

"ID": 55,
"Name": "Example55",
"Rating": 9,
"Price": "9.9",
"ReleaseDate": "2008-05-08T00:00:00"


Below is the sample screenshot of POSTMAN client

Headers section

Body section

Response body section


Example response body contents are as below.
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 200 OK
Content-Type: application/atom+xml;charset=utf-8;type=entry
Cache-Control: no-store, no-cache
Content-Length: 1027

<?xml version="1.0" encoding="utf-8"?><entry xmlns="" xmlns:m="" xmlns:d="" xml:base=";v=1/"><id>;v=1/ProductSet(3)</id><title type="text">ProductSet</title><updated>2018-11-21T05:54:38.35Z</updated><category term="S1.Product" scheme=""></category><link href="ProductSet(3)" rel="edit" title="Product"></link><content type="application/xml"><m:properties><d:ID>3</d:ID><d:Name m:null="true"></d:Name><d:Description m:null="true"></d:Description><d:ReleaseDate>2005-10-01T00:00:00</d:ReleaseDate><d:DiscontinuedDate>2006-10-01T00:00:00</d:DiscontinuedDate><d:Rating>3</d:Rating><d:Price>19.9</d:Price></m:properties></content></entry>
Content-Type: multipart/mixed; boundary=changeset_591ce50b-9727-46bf-8881-0fd7cac16dd3

Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created
Content-Type: application/atom+xml;charset=utf-8;type=entry
Content-Length: 997

<?xml version="1.0" encoding="utf-8"?><entry xmlns="" xmlns:m="" xmlns:d="" xml:base=";v=1/"><id>;v=1/ProductSet(55)</id><title type="text">ProductSet</title><updated>2018-11-21T05:54:38.351Z</updated><category term="S1.Product" scheme=""></category><link href="ProductSet(55)" rel="edit" title="Product"></link><content type="application/xml"><m:properties><d:ID>55</d:ID><d:Name></d:Name><d:Description></d:Description><d:ReleaseDate>2008-05-08T00:00:00</d:ReleaseDate><d:DiscontinuedDate m:null="true"></d:DiscontinuedDate><d:Rating>9</d:Rating><d:Price>9.9</d:Price></m:properties></content></entry>


Message Processing Log

As mentioned in the above section on scope/restrictions, an MPL per changeset is created. In the example above, we are using two changeset requests, one for GET and other for POST, hence there will be two MPLs generated for the sample scenario.



The invocation of SAP Cloud Integration OData Service can be done in $batch mode with mentioned scope/restrictions.