Open Data Protocol (OData) is an open protocol that allows the creation and consumption of data, and builds on Web technologies to provide access to information from a variety of applications. OData is the current default method for connecting with an SAP back end.
SAP OData utilizes SAP Gateway, which provides the ability to create an SAP OData service that exposes information from one or many underlying systems — whether an SAP or non-SAP system. SAP Gateway uses OData for SAP products, which contains SAP-specific metadata, such as from the SAP ABAP Dictionary, which helps developers consume SAP business data. You can create and generate custom OData models, implement the OData service, and publish and register the service with SAP.
The purpose of this tutorial is to demonstrate the use of SAP OData connector with NextGen DataStage: DataStage on IBM Cloud Pak for Data and DataStage SaaS.
We connect to SAP OData by creating SAP OData connector in IBM Cloud Pak for Data. We will then use Asset Browser connector in DataStage to view all SAP OData services and preview metadata. We will then utilize DataStage in-built data visualization and create a simple DataStage flow.
In this tutorial, you will learn how to:
- Create an SAP OData connection
- Use the Asset Browser connector in DataStage to browse the SAP OData connection
- Use the built-in DataStage data visualization to better understand data and create a simple DataStage flow
For more information about SAP OData connector prerequisites and support, please refer to IBM Documentation.
About the data
For this tutorial, we make use of an existing SAP OData data connection. Please substitute details pertaining to data connection and its containing data with your own.
Completing this tutorial should take about 15 minutes.
Step 1. Navigate to new connection in IBM Cloud Pak for Data
Navigate to New Connection and select SAP OData connector. Click Select to launch Create Connections.
Enter the desired name and description for your SAP OData connector and SAP Gateway URL for your connection in the Connection Overview section.
Following are the available Authentication types: API Key, Basic, and None. For this tutorial, we use authentication type Basic, which asks for username and password.
Enter SSL Certificate and ensure that certificate format conforms to the X509 PEM format.
Click on Test Connection to ensure that the test is successful, then click Create to create the named SAPOData connection.
Step 2. Use Asset Browser in DataStage to view details on SAP OData connection
Navigate to a DataStage flow and under palette nodes on left side of canvas, double-click on Asset Browser under Connectors.
Navigate to the created SAPOData connection and select Service under the filter to view all SAP OData services in the connection. Following the OData convention, those services with a
Z*prefix are custom-developed services. Click on the desired service to see the tables available in the service, then click on the eye icon to preview the data.
Select the desired table and click Add.
Select the columns you would like to import from the
This creates an SAP OData connector:
PurchaseOrderItems_1 (same as the table selected). Double-click on the connector to see that the Stage tab has been automatically filled with connection details, service name of SAP OData, service version, and EntitySet.
Optional: Using SAP OData connector
SAP OData is a dedicated connector under the palette note in DataStage. However, unlike Asset Browser, you will need to manually input the desired Service Name and Entity Set information on the Stage tab and import the desired table and columns in the Output tab. For illustration purposes, we drag SAP OData connector to canvas.
As you can see, all details are left blank on the Stage tab.
Step 3. Create simple DataStage flow SAP OData connection
Double-click on the Peek stage and attach to the created
Drag a Copy stage between the
The Input tab of Copy stage displays all columns from PurchaseOrderItems_1, and the Output tab enables you to edit those columns.
You can use DataStage built-in data visualization tools to further aid you in the creation of your data flow by right-clicking on the PurchaseOrderItems_1 connector and selecting Preview data.
From the available Data, Chart, and Profile tabs, you can further understand and explore the relationships within your data. For example, the image below shows the data Profile.
And below is one of the many Chart options: a simple bar chart showing the prices of various products in the
These built-in tools can aid you in building the pipeline and flow you wish.
Once your DataStage flow is built, click Run in Canvas to see the result and logs.
Summary and next steps
In this tutorial, you learned how to create an SAP OData connector and to use the connector in Next Generation DataStage on IBM Cloud Pak for Data. To learn more, check out IBM Cloud Pak for Data on IBM Developer, or visit IBM.com to learn more about IBM Cloud Pak for Data and IBM DataStage.