Digital Developer Conference: Cloud Security 2021 -- Build the skills to secure your cloud and data Register free

Using SAP OData connector with Asset Browser in NextGen DataStage

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.

Learning objectives

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

Prerequisites

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.

Estimated time

Completing this tutorial should take about 15 minutes.

Steps

Step 1. Navigate to new connection in IBM Cloud Pak for Data

  1. Navigate to New Connection and select SAP OData connector. Click Select to launch Create Connections.

    Figure 1 shows New Connection screen

  2. Enter the desired name and description for your SAP OData connector and SAP Gateway URL for your connection in the Connection Overview section.

    Figure 2 shows Connection Overview screen

  3. 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.

    Figure 3 shows Credentials/Authentication Types screen

  4. Enter SSL Certificate and ensure that certificate format conforms to the X509 PEM format.

    Figure 4 shows Certificate selected

  5. Click on Test Connection to ensure that the test is successful, then click Create to create the named SAPOData connection.

    Figure 5 shows Create Connection screen with test button

Step 2. Use Asset Browser in DataStage to view details on SAP OData connection

  1. Navigate to a DataStage flow and under palette nodes on left side of canvas, double-click on Asset Browser under Connectors.

    Figure 6 shows OData DataStage flow screen with left-pane navigation

  2. 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.

    Figure 7 shows options under Connection

    Figure 8 shows resulting PurchaseOrderItems pop-up

  3. Select the desired table and click Add.

    Figure 9 shows table-selection screen with Add button

  4. Select the columns you would like to import from the PurchaseOrderItems table selected.

    Figure 10 shows Import Columns screen

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.

Figure 11 shows selected table with properties

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.

Figure 12 shows dragging SAP OData connector to canvas

As you can see, all details are left blank on the Stage tab.

Figure 13 shows Stage tab with blank details

Step 3. Create simple DataStage flow SAP OData connection

  1. Double-click on the Peek stage and attach to the created PurchaseOrderItems_1.

  2. Drag a Copy stage between the PurchaseOrderItems_1 and Peek_1.

    Figure 14 shows dragging a Copy stage between PurchaseOrderItems_1 and Peek_1

  3. The Input tab of Copy stage displays all columns from PurchaseOrderItems_1, and the Output tab enables you to edit those columns.

    Figure 15 shows Input tab of Copy stage displaying all columns from PurchaseOrderItems_1

  4. 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.

    Figure 16 shows 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.

Figure 17 shows Data Profile graph options

And below is one of the many Chart options: a simple bar chart showing the prices of various products in the PurchaseOrderItems_1 table.

Figure 18 shows bar chart with prices of products in PurchaseOrderItems_1

These built-in tools can aid you in building the pipeline and flow you wish.

  1. Once your DataStage flow is built, click Run in Canvas to see the result and logs.

    Figure 19 shows clicking Run in Canvas to see result

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.