Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
sangeeta_06
Discoverer

In this blog article, we will walk you through the process of consuming an OData service in the SAP Integration Suite, with a focus on configuring the OData adapter.

Before you start the integration process, ensure you have the following prerequisites in place:

  • SAP Integration Suite: Access to the SAP Integration Suite is necessary.
  • OData service URL: Know the URL of the OData service you intend to consume.

 Firstly, we need to understand what OData is:
OData: The OData adapter allows you to communicate with an OData API using OData protocol. You can use messages in ATOM or JSON format for communication.

  1. Click on "Create" to initiate a new Integration Flow.
  2. Define the integration flow details, such as name and description.

sangeeta_06_28-1710848023562.png

Open & click on edit 

sangeeta_06_29-1710848023572.png

 

As Start event should have an incoming message use Timer event instead of Start Event

sangeeta_06_30-1710848023579.png

 

Now add a Request reply to consume the OData service.

sangeeta_06_31-1710848023586.png

Now connect your request reply with the Receiver by using the OData V2 as message protocol.

sangeeta_06_32-1710848023593.png

Now, configure the OData adapter with the necessary details:

1. Endpoint: Enter the URL of the OData service you want to consume.

The Service URL for an OData service typically includes the following components:

ODATA URL: https://host:port/sap/opu/odata/sap/ZMM_INVOIC_PEARL_INBOUND_SRV/InvoicerejheadSet?$expand=ASSREJITE...

  • Protocol: https:// This indicates that the communication will be secured using HTTP Secure (HTTPS), which encrypts the data transferred between the client (your browser or application) and the server.
  • Host: This is the IP address of the server hosting the OData service.
  • Port:  The port number on which the OData service is listening. The default ports are 80 for HTTP and 443 for HTTPS.
  • PATH: /sap/opu/odata/sap/ZMM_INVOIC_PEARL_INBOUND_SRV: This is the base path for the OData service. It identifies the service and specifies the namespace for the entities exposed by the service. ZMM_INVOIC_PEARL_INBOUND_SRV is likely the name of the OData service, and /sap/opu/odata/sap/ is a common prefix for SAP OData services.
  • Entity set: InvoicerejheadSet: This is the entity set being accessed. In OData, an entity set is a collection of entities of the same type. Here, InvoicerejheadSet seems to represent a collection of invoice rejection headers.
  • Sublevel: $expand: a "sublevel" typically refers to the depth of nested entities or related data that can be expanded in an OData query. When you perform an OData query with the $expand option, you can specify which related entities you want to include in the response. Each entity that you expand represents a level of depth in the data hierarchy.

2. Select the proxy type: 

  • Internet: Internet proxy type is suitable when your OData service is externally hosted or available on the Internet. It allows the adapter to communicate with the service over the public network.
  • On-Premise: The on-Premise proxy type is suitable for scenarios where the OData service is hosted within your organization's network. It allows the adapter to establish a connection within the internal network, ensuring secure and controlled access.

3. Authentication: Specify the authentication method (e.g., Basic Authentication, OAuth) and provide the required credentials.

sangeeta_06_33-1710848023606.png

In the processing tab configure as shown below

  • Operation Details: Define the specific OData operations (GET, POST, PUT, DELETE) required for your integration scenario.
  • Resource Path:  Set the Resource Path based on the Entity Set and navigation properties relevant to your scenario.

sangeeta_06_34-1710848023615.png

After selecting it will take you to another screen as below. So, don’t change anything in Step 1 keep it as it is.

STEP 1: Connect to System

sangeeta_06_42-1710848599508.png

NOTE: When you access the URL in your step 1, typically the service will respond with metadata about the available entity sets, properties, relationships, and operations exposed by the service. The metadata document describes the structure and capabilities of the OData service, allowing clients to understand how to interact with it programmatically.

In summary, when you access the full URL, you'll receive metadata and information about the available resources and operations provided by the OData service, not just the raw data from the InvoicerejheadSet entity set.

Step-2: Now click on Step-2 and select the Operation as Query as we are fetching Data.

In Entity, search for Entity and select it. Also, check all the checkboxes against all fields, you can also check Generate XML schema Definition if you want xsd of it.

sangeeta_06_43-1710848652798.png

Step 3: Configure Filter & Sorting: These steps help you refine your query to retrieve only the specific data you need. This step is available only for data fetch operations, where you can define the order in which the records are fetched in the response payload and filter for the fields that you require.

sangeeta_06_44-1710848981645.png

After step-3 click on Finish. It will automatically generate a query as below based on our filter conditions.

After all this configuration you will get one EDMX file and an XSD file.

EDMX (Entity Data Model XSD) File: EDMX is an XML-based file that encapsulates the metadata of an OData service. It includes information about entities, properties, relationships, and other aspects of the service's data model.

Leave the remaining fields as empty as they are not mandatory.

 

sangeeta_06_45-1710849079344.png
Now save and deploy the I-Flow. Always, change the Log level from info to Trace to see all the Message Processing steps.

 

 
sangeeta_06_46-1710849126453.png

Once I-Flow gets started you can see the payload at the End of Step.

1 Comment
Labels in this area