How to Set Up Destinations in SAP BTP for Accessing On-Premise OData Services

In modern businesses, data integration across cloud and on-premise systems is essential for real-time insights and streamlined processes. Suppose a retail company has a large on-premise SAP ERP system that stores vital business data such as customer orders, inventory levels, and vendor information. The company wants to develop an application on SAP Business Technology Platform (BTP) to access this on-premise data, enabling sales teams to view real-time inventory and order status directly from mobile devices. This scenario requires securely connecting the SAP BTP application to on-premise OData services through destinations. Here’s a step-by-step guide to setting up these destinations.

More Such Questions

Step 1: Set Up SAP Cloud Connector for Secure Access

To connect SAP BTP with on-premise systems, start by installing and configuring SAP Cloud Connector. This acts as a secure bridge between your SAP BTP subaccount and the on-premise system, ensuring data is securely routed.

Installing and Configuring SAP Cloud Connector

  1. Download the SAP Cloud Connector installer from the SAP Support Portal.
  2. Install SAP Cloud Connector on a server that has network access to the on-premise SAP system.
  3. Open SAP Cloud Connector by entering http://<server>:<port> in a browser and log in using administrator credentials.
  4. Add a new subaccount by navigating to Cloud to On-Premise > Subaccount. Enter your SAP BTP subaccount credentials to establish a connection.

Configuring Access to On-Premise System

  1. Select your subaccount and navigate to Cloud to On-Premise > Access Control.
  2. Click Add to create a new system mapping. Provide the internal host name and port of your SAP on-premise system.
  3. Define the protocol (usually HTTPS) and specify whether the system is exposed directly or through a reverse proxy.
  4. In Principal Type, choose None if the system doesn’t use principal propagation, or X.509 for certificate-based access.
  5. Under Resources, select Expose Entire System or specify individual OData paths as needed (e.g., /sap/opu/odata).

Test the Connection

Once set up, test the connection to ensure SAP Cloud Connector can reach the on-premise SAP system. This setup allows your on-premise SAP system to securely communicate with SAP BTP.

Step 2: Define the Destination in SAP BTP Cockpit

After SAP Cloud Connector is configured, the next step is to define a destination in SAP BTP to link the subaccount with the on-premise OData service.

Creating a New Destination

  1. Log in to SAP BTP Cockpit and navigate to your subaccount.
  2. Go to Connectivity > Destinations and click New Destination.
  3. Enter the following mandatory fields:
    • Name: Give a unique name (e.g., ONPREMISE_SAP_ODATA).
    • Type: Set to HTTP.
    • Description: Add a brief description (optional but recommended).
    • URL: Enter the Cloud Connector URL format: https://<cloud-connector-host>:<port>/<odata-service-path> (e.g., https://mycloudconnector:44300/sap/opu/odata/sap/Z_CUSTOMER_SRV).
    • Proxy Type: Set to OnPremise to indicate the destination is for on-premise access.
    • Authentication: Choose the authentication method, typically BasicAuthentication for development or PrincipalPropagation for production if you’re using SSO.

Adding Additional Properties

  1. sap-client: Set the SAP client number (e.g., 100).
  2. sap-language: Specify the language code (e.g., EN).
  3. WebIDEEnabled: Set to true if you’re developing applications in SAP Web IDE.
  4. HTML5.DynamicDestination: Set to true to enable dynamic destination loading.

Example of Destination Configuration

Name: ONPREMISE_SAP_ODATA
Type: HTTP
URL: https://mycloudconnector:44300/sap/opu/odata/sap/Z_CUSTOMER_SRV
Proxy Type: OnPremise
Authentication: BasicAuthentication
User: <your-username>
Password: <your-password>
Additional Properties:
sap-client: 100
sap-language: EN
WebIDEEnabled: true
HTML5.DynamicDestination: true

Step 3: Test the Destination in SAP BTP

Once you’ve configured the destination, test it to ensure connectivity.

  1. In SAP BTP Cockpit, click the Check Connection button next to the destination.
  2. If the connection is successful, a message confirming it will appear. If there’s an error, verify your Cloud Connector settings and ensure the OData service path is correct.

Step 4: Consume the Destination in an SAP BTP Application

Now that the destination is set up and tested, it’s ready to be used in an SAP BTP application, such as an SAP UI5 or SAP Fiori app.

Accessing the OData Service in an SAP UI5 Application

  1. In SAP Business Application Studio or SAP Web IDE, create or open your SAP UI5 application.
  2. In the manifest.json file, define a data source to link the OData service with your application:
"dataSources": {
"myOdataService": {
"uri": "/sap/opu/odata/sap/Z_CUSTOMER_SRV/",
"type": "OData",
"settings": {
"odataVersion": "2.0"
}
}
}
  1. Reference the data source in your models section to bind data to the UI elements.

Example of Data Binding

Using the defined OData model, bind fields in your view to show data from the on-premise system:

<Text text="{myOdataService>/CustomerName}" />
<Text text="{myOdataService>/CustomerCity}" />

Step 5: Troubleshooting Tips and Best Practices

Here are some tips and best practices to ensure smooth connectivity and optimal performance:

  • Check Cloud Connector Logs: If there’s an issue with the connection, inspect SAP Cloud Connector logs for error messages.
  • Configure Timeouts: Ensure appropriate timeout settings in Cloud Connector to avoid unnecessary disconnections.
  • Authentication Security: Avoid hardcoding sensitive information. Use PrincipalPropagation for SSO in production environments.
  • Update Service Paths Regularly: If your OData service paths change, update the destination settings to prevent connection failures.
  • Regularly Test Destinations: Test destinations periodically, especially after system updates or network changes.

By following these steps, you can set up destinations in SAP BTP to securely access on-premise OData services. This approach provides secure, reliable connectivity that allows cloud-based SAP applications to seamlessly integrate with on-premise SAP systems, driving real-time data availability and operational efficiency across your organization.

Leave a Comment