Technical Articles
SAP Cloud Integration – OData V4 Outbound Adapter
Introduction
SAP Cloud Integration version 2.47.x comes with addition of OData V4 outbound/receiver adapter. OData V4 version spec comes with lot of enhancements and supporting features. To begin with the initial feature increment, SAP Cloud Integration OData V4 outbound adapter comes basic support for GET, POST and PUT operation. This blog explains usage these basic operations.
OData V4 Service
OData V4 outbound adapter has been explained with a sample service provided by www.odata.org. You need to get a sample instance of the service by visiting https://www.odata.org -> Developers -> Reference Services
Click on the TripPin(read/write) service under OData v4 tab.
The URL (which is displayed in the address field of the browser) shall be used in this to demonstrate OData V4 operations.
Query (GET) Operation
Consider the below integration flow project. I have added an HTTP sender adapter such that I get an HTTP endpoint after the deployment and can invoke it via an REST client e.g. POSTMAN application.
The provided address /cpi_odata_v4_get_demo in HTTP sender will be appended to the HTTP service URL endpoint upon the successful deployment of this integration flow.
Now when you connect the End event to the receiver system, the OData adapter will come with option OData V2 and OData V4, OData V4 is of our interest.
Once the OData V4 is selected, the properties of it will be populated. Let us see the properties details.
General Section
The General tab gives you the information about OData V4 under message protocol section.
Connection Section
In the Connection tab, the Address field will have the OData V4 service root URI of the reference service. The service doesn’t require any authentication and hence, None is selected for Authentication.
Processing section
In the Processing tab, operation Query (GET) has been selected and for the Resource name, entity People has been provided.
After the deployment of this integration flow, you will get service endpoint of it from SAP Cloud Integration Web UI monitoring section under Manage Integration Content tile as shown below
Invoking the above endpoint in the REST client POSTMAN will fetch you the content of People entity from the service.
Create(POST) Operation
The OData V4 outbound adapter Create(POST) operation is used to create the entity in the target OData V4 service. The same integration flow example has been modified to have a different endpoint in HTTP sender adapter and changed the OData V4 operation to Create(POST) under the Processing section as shown below.
After the successful deployment, POST the payload to be created via the REST client application POSTMAN. Upon successful data creation, the response content will be given back as shown in the below sample screenshot.
In similar lines, the Update (PUT) operation is also supported.
Note: Tracing support on processed message for this adapter is not yet available.
Summary
SAP Cloud Integration now has support for OData V4 outbound adapter with support of basic operations. In the upcoming releases, we will be supporting some more features and blog for the same will be updated.
Hi!
Do you know if it's possible to use the OData V4 adapter with the Cloud Connector?
In V2's adapter, I have the choice to select the "proxy type" (internet / On-Premise), but here I have only "internet" (and "manual", but it's always grayed).
I mean, I have an OData Service published under my network, and I'd like to consume it using CC, instead of publishing the service into the Internet.
Is this possible?
Thanks in advance
Hi Adrian,
We will be working on to provide support for On Premise/Cloud Connector connectivity for OData V4. I will be publishing (or update) the blog once it is available.
Thanks
Deepak
Hi Deepak G Deshpande ,
do you know if ODATA V4 is working normally (same es ODATA V2) over the Cloud Connector (to a On Premise S4), or if there are any problems or restrictions?
I am trying to set up the https://api.sap.com/api/OP_PRODUCT_0001/overview but it always results in a "Failed to connect to system.".
Even though the ODATA V2 all work properly.
Thank you!
BR,
Goran
Looping back on this, is there any progress with the support of using odatav4 ? we have upgraded to the latest cc (2.12.01) and v3 is not supported also.
Hi Joel,
Can you explain what do you mean by cc here? Is it cloud connector?
As of the SAP Cloud Platform Integration version 2.52.x, with OData V4 outbound/receiver adapter, you can connect to On Premise OData V4 services.
In SAP Cloud Platform Integration, we will not be supporting OData V3 version.
Thanks
Deepak
Hello Depak,
I am frequently receiving the below error when i try to use SFSF OData V4 adapter for GET & PUT operations. At time the GET operation is working but not regularly.
An internal server error occured: java.lang.IllegalArgumentException: Could not parse as Edmx document
Payload for PUT:
<Users>
<User>
<studentID>TrainM_AS2</studentID>
<altSuperID1>TrainM_AS5</altSuperID1>
<altSuperID2>TrainM_AS4</altSuperID2>
</User>
</Users>
Thanks !!
Hi Ashokkumar,
Is the still persisting? If so, I recommend you to create issue/incident with relevant details and this incident will be analysed
Also, hope the SuccessFactors OData V4 was up and running without any issues. Sometimes, if the backend is not reachable, then such issues occur.
Thanks
Deepak
Hi Deepak,
I am trying to send the response as
<SAPCpiOutboundEccCatalogs>
<SAPCpiOutboundEccCatalog>
<sapCpiCatalogs>
<SAPCpiCatalog>
<name>testCatalogNew</name>
<integrationKey>testCatalogNew</integrationKey>
</SAPCpiCatalog>
<SAPCpiCatalog>
<name>testCatalogNew2</name>
<integrationKey>testCatalogNew2</integrationKey>
</SAPCpiCatalog>
</sapCpiCatalogs>
<b2bUnitUid>testB2BUnitUid2</b2bUnitUid>
<salesOrganization>5600</salesOrganization>
<integrationKey>testB2BUnitUid2</integrationKey>
</SAPCpiOutboundEccCatalog>
</SAPCpiOutboundEccCatalogs>
In the SCPI I do not see any error but I get 400 ; nested exception,
When I remove the nesting xml
<sapCpiCatalogs>
<SAPCpiCatalog>
<name>testCatalogNew</name>
<integrationKey>testCatalogNew</integrationKey>
</SAPCpiCatalog>
<SAPCpiCatalog>
<name>testCatalogNew2</name>
<integrationKey>testCatalogNew2</integrationKey>
</SAPCpiCatalog>
</sapCpiCatalogs>
In this case I get success message
My data model in hybris is as below :
Hi Nafish,
Is the problem still exist? If so, I propose you create an issue/incident along with relevant details, such that issue can be analysed and inputs can be provided.
Thanks
Deepak
Hello Deepak,
Now that SAP PO7.5 SP17 supports all V4 versions, just curious that Could Connector has already been updated to support V4 Odata? Any insights?
Hi Niranjan,
Sorry, I didn't understand your question, especially with respect to usage of cloud connector in PO world. Can you elaborate what you are looking?
Thanks
Deepak
Hi Deepak,
The Odata V4 Receiver adapter does not have ''Enable Batch Processing'. How do we post multiple items using ODATA V4?
Thanks & Regards,
Merina
Hi Merina,
For OData V4 outbound/receiver adapter, there is a dedicated operation named “Batch Processing ($batch)” in the adapter properties and even the same is available for the query wizard as well, you can use that option.
Thanks
Deepak
Thanks Deepak,
Figured this out and wrote a blog on it - https://blogs.sap.com/2020/12/17/batch-processing-with-odatav4-adapter-in-sap-cpi/#
Hi Merina,
Thanks for the update
Thanks
Deepak