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
- How to Create a Fiori Elements App on SAP BTP Using CDS Views
- How to Configure SAP BTP to Securely Access SAP S/4HANA OData Services
- How to Use OData Filters and Query Parameters in SAP Fiori Applications
- How to Optimize CDS Views for Performance in SAP HANA
- How to Set Up Destinations in SAP BTP for Accessing On-Premise OData Services
- How to Test and Debug OData Services in SAP Gateway
- How to Integrate On-Premise SAP Data with SAP BTP Using SAP Cloud Connector
- How to Consume SAP OData Services in SAP UI5 Applications on SAP BTP
- How to Enable Authorization Checks on CDS Views for Secure Data Access
- How to Create and Expose a CDS View with Multiple Joins as an OData Service
- How to Expose a CDS View as an OData Service for SAP BTP Applications
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
- Download the SAP Cloud Connector installer from the SAP Support Portal.
- Install SAP Cloud Connector on a server that has network access to the on-premise SAP system.
- Open SAP Cloud Connector by entering
http://<server>:<port>
in a browser and log in using administrator credentials. - 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
- Select your subaccount and navigate to Cloud to On-Premise > Access Control.
- Click Add to create a new system mapping. Provide the internal host name and port of your SAP on-premise system.
- Define the protocol (usually HTTPS) and specify whether the system is exposed directly or through a reverse proxy.
- In Principal Type, choose
None
if the system doesn’t use principal propagation, orX.509
for certificate-based access. - 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
- Log in to SAP BTP Cockpit and navigate to your subaccount.
- Go to Connectivity > Destinations and click New Destination.
- 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 orPrincipalPropagation
for production if you’re using SSO.
- Name: Give a unique name (e.g.,
Adding Additional Properties
- sap-client: Set the SAP client number (e.g.,
100
). - sap-language: Specify the language code (e.g.,
EN
). - WebIDEEnabled: Set to
true
if you’re developing applications in SAP Web IDE. - 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.
- In SAP BTP Cockpit, click the Check Connection button next to the destination.
- 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
- In SAP Business Application Studio or SAP Web IDE, create or open your SAP UI5 application.
- 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"
}
}
}
- 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.