0% found this document useful (0 votes)
1K views11 pages

SAP CPI OData Integration via Postman

This document outlines the process of using SAP Cloud Platform Integration (CPI) to post data to an OData service via Postman. It details the necessary prerequisites, the integration flow design, and the components involved, such as the HTTPS sender adapter, content modifier, and OData receiver. The article concludes by confirming successful data posting to the OData service and encourages users to test the integration flow using Postman.

Uploaded by

aditya.rajak2024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views11 pages

SAP CPI OData Integration via Postman

This document outlines the process of using SAP Cloud Platform Integration (CPI) to post data to an OData service via Postman. It details the necessary prerequisites, the integration flow design, and the components involved, such as the HTTPS sender adapter, content modifier, and OData receiver. The article concludes by confirming successful data posting to the OData service and encourages users to test the integration flow using Postman.

Uploaded by

aditya.rajak2024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SAP CPI - FROM POSTMAN TO ODATA AS A

RECEIVER IFLOW
BY JALLAJ KUMAR

FOLLOW ON LINKEDIN/JALLAJKUMAR
Introduction:

In this blog, we will be using SAP Cloud Platform Integration(CPI) to post some data to
OData from Postman as a Sender.

CPI is a robust integration platform that connects various applications and services,
enabling seamless data exchange across an enterprise.

Prerequisites:
Before we enter into the integration flow, make sure you have the following prerequisites
in place:

1. SAP BTP Account (Trial or Enterprise)

2. SAP Cloud Platform Integration (CPI)

3. Basic Knowledge in CPI

Note: Make sure to provide all the roles to authorize your user in BTP under the Role
section for Integration Suite Access.
Scenario:

The aim of the iFlow is to post some data in SAP using OData as a receiver adapter and
HTTPS as a Sender adapter. Here we are going to call the API from POSTMAN as a Sender.

Since we all might know about Northwind OData service available as open source so we are
going to consuming the same OData service to post PRODUCTS(Entity) data.
Solution:

In the Integration Flow, we are using

1. HTTPS as a Sender Adapter

2. Content Modifier to Modify the JSON Data

3. JSON to XML Converter ( To parse as XML Payload )

4. Request Reply to connect Receiver End Point.

5. Receiver as an OData Adapter

FOLLOW ON LINKEDIN/JALLAJKUMAR
Below is my iFlow Design:

Before testing the iFlow, first we will test the Northwind OData service from POSTMAN.

Get Products Data using Postman

Status : 200 ok and we get the results of Products Entity.

FOLLOW ON LINKEDIN/JALLAJKUMAR
Now, let's check the count of the same entityset.

Get Products Count - Postman

Status : 200 ok and we get the count of Products Entity which is 13 now.

Let's see the iFlow parts:

HTTPS Adapter -> To Call the CPI as HTTPS Request(We are using Postman to call and
pass the data)

FOLLOW ON LINKEDIN/JALLAJKUMAR
HTTPS Sender Adapter - Connection

Content Modifier -> Why we are using the Content Modifier is to add Product tag(Since
OData usually accepts XML as a payload) outside the JSON payload.

Content Modifier - Message Body

JSON to XML Converter -> To send payload as XML Format.

FOLLOW ON LINKEDIN/JALLAJKUMAR
JSON to XML Converter - Processing

Below is the sample XML format that accepts OData for Post Call in Products Entity Set.

<?xml version="1.0" encoding="UTF-8"?>

<Products>

<Product>

<ID>12</ID>

<Name>Earphone</Name>

<Description>Test</Description>

<ReleaseDate>2023-10-08T[Link]</ReleaseDate>

<DiscontinuedDate></DiscontinuedDate>

<Rating>3</Rating>

<Price>1900</Price>

</Product>

</Products>

FOLLOW ON LINKEDIN/JALLAJKUMAR
For the abode XML code you may notice data is passed inside the Products and Product
Tag. This is the reason we have added Content Modifier to add Product and in the JSON to
XML Converter we are using Products as Name under Processing Tab.

Request reply and ODATA Receiver -> To Post data in OData Service.

Request Reply is used to connect the OData Receiver in Integration Flow.

Below is the OData Receiver Connection details which holds OData URL in the Address field

OData Receiver Connection

Below is the setup for OData Receiver Processing:

FOLLOW ON LINKEDIN/JALLAJKUMAR
OData Receiver Processing

Choose Post Method as Operation Details and in the Resource Path, click the Select Button
and

1. Select Local EDMx File option in Connection Source.

2. POST Method in Operation

3. Products(In our Case) in Select Entity.

4. Select All the Fields listed in the screen.

5. Generate XML Schema Definite Checkbox is used to generate XSD file to get the XML
format for our entity set.(It will be shown in the Resource Tab in the Integration
Flow)

FOLLOW ON LINKEDIN/JALLAJKUMAR
After you deploy your iFlow, you can see your End point URL generated in Manage
Integration Content Tile which hold all your iFlows.

iFlow - Endpoint URL

ok, Let's test the Integration Flow from POSTMAN using above URL.

FOLLOW ON LINKEDIN/JALLAJKUMAR
POSTMAN - Trigger the iFlow

Status - 201 Created, yes we have posted one Record in product entity set. Let's check the
data now in OData Service.

FOLLOW ON LINKEDIN/JALLAJKUMAR
POSTMAN - Fetch Records to Test

Yes, now our data got posted in the entity set and you can test the count of the same entity
set.

Conclusion

In this Article, we have achieved how to call SAP OData Service using CPI from POSTMAN.

Thanks

Jallaj Kumar

FOLLOW ON LINKEDIN/JALLAJKUMAR

You might also like