Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Sushil01
Product and Topic Expert
Product and Topic Expert

Introduction:


In this blog post, we will walk through the process of establishing a connection between the SAP Business Application Studio, a powerful cloud service, and the on-premise backend systems. This setup will allow you to develop, test, and deploy applications seamlessly, leveraging the best of both cloud and on-premise capabilities.

Before we dive into the steps, it's important to ensure you have a few things in place.

Pre-requisites:



    1. SAP HANA Platform:  You should have an instance of the SAP HANA Platform already set up and available in your on-premise environment.
    2. SAP HANA Extended Application Services Advanced (XS Advanced): The XS Advanced platform should be set up and ready to go. This is crucial for developing and deploying web applications on the SAP HANA Platform.
    3. Cloud Connector: The Cloud Connector should be installed. This software acts as a link between your on-premise systems and the cloud services.
    4. Familiarity with Cloud Connector Setup: While we will cover the basic setup, it's crucial to have a basic understanding of setting up the Cloud Connector.
    5. Connection to SAP BTP Sub account in Cloud Connector: Ensure you're connected to your SAP Business Technology Platform (BTP) Sub account through the Cloud Connector. This connection is essential for linking your cloud and on-premise services.

Now that we have the prerequisites covered, let's dive into the step-by-step process of setting up the connectivity.

To expose on-premise backend systems, we need to collect the endpoints for those systems.

Here's a breakdown of the required endpoints:

    1. XS advanced controller (controllerEndpoint): This endpoint is needed to connect to the XS advanced controller. You can find the endpoint URL by using the command "xs -v" in your command line interface.
    2. XS advanced User Account and Authentication (XSUAA) (authorizationEndpoint): The XSUAA endpoint is necessary for user account and authentication purposes. You can obtain the endpoint URL using the same "xs -v" command.
    3. SAP HANA cockpit (hana-cockpit) service: The endpoint URL for the SAP HANA cockpit service is also required. You can find this URL using the "xs -v" command.
    4. The Multitarget Application(MTA) Archive deployer service (deploy-service): The endpoint URL for the MTA deployer service is needed as well. You can obtain this URL by using the "xs -v" command.
    5. SAP HANA run-time-tools service (hrtt-service): To find the endpoint URL for the SAP HANA run-time-tools service, you can use the command "xs app hrtt-service".
    6. The SID and instance number of the SAP HANA database that is mapped to XS advanced: To find the SID and instance number, use the command "xs tenant-databases" and copy the value of the sql-port. The second and third digits of the port number represent the instance number.

In case of doubt, refer to the following screenshots:

 

 

Collect endpoints for controllerEndpoint, authorizationEndpoint, hana-cockpit, and deploy-service

 

 

Collect endpoints for hrtt-service

 

 

Collect endpoints SAP HANA SID and sql-port



Cloud Connector


The Cloud Connector is a vital tool that allows the SAP Business Technology Platform (BTP) to connect with XS Advanced and the underlying on-premise system(s). The Cloud Connector can be installed and set up on any host that can access the system hosting the backend system.

To connect SAP BTP to XS Advanced, it's important to know the default HOST and HTTP/TCP ports:

For SAP HANA (both the system database and the default tenant database), the required TCP port range is 3<HANA_INST_#>13 - 3<HANA_INST_#>17. For instance, if the instance number of the SAP HANA database is "00", the range would be 30013 - 30017.

Note: In this blog, we'll use 06 as the instance number. This might be different for you.

For additional tenant databases, three ports per tenant are required, with the range being 3<HANA_INST_#>40 - 3<HANA_INST_#>42.

Configuring SAP Cloud Connector



    • Connect your BTP Sub-account(see the screenshot)

 

    • Click on Cloud To On-Premise to expose your backend systems(or services)

 

In case of doubt, refer to the following screenshots:

 

 

Choose Back-end Type

 

 

Choose Protocol

 

 

Choose Internal Host and Internal Port

 

 

Choose Virtual Host and Virtual Port

 

 

Choose Principal Type

 

 

Choose Host In Request Header

 

 

Provide optional description

 

 

Check Internal Host

 


After exposing the systems, add resources for each system

    • Add Resource

        1. Click on the internal hostname field
        2. Click the "+" icon in resources section
        3. Choose values as shown in the screenshot below
    •  

 

    • For SAP HANA, click the + icon and provide the following details

        1. Back-end Type: SAP HANA
        2. Protocol: TCP SSL(or TCP depending on your SAP HANA installation)
        3. Internal Host: endpoint without port (you fetched these in the beginning)
        4. Internal Port: sql-port
        5. Virtual Host: choose any valid virtual host name(You may choose any unused host name, we'll need this later)
        6. Virtual Port: choose any valid virtual port(You may choose any unused port, you'll need this later)
        7. Principal Type: None
        8. Host In Request Header: Use Virtual Host
        9. Description: Provide a description, it is optional
        10. Check Internal Host
        11. Click Finish
    • For SAP HANA, click the + icon and provide the following details

        1. Back-end Type: SAP HANA
        2. Protocol: TCP SSL(or TCP depending on your SAP HANA installation)
        3. Internal Host: endpoint without port (you fetched these in the beginning)
        4. Internal Port: sql-port
        5. Virtual Host: Non-FQDN, e.g. my(You may choose any unused host name, we'll need this later)
        6. Virtual Port: same port chosen in the previous step
        7. Principal Type: None
        8. Host In Request Header: Use Virtual Host
        9. Description: Provide a description, it is optional
        10. Check Internal Host
        11. Click Finish

Your exposed systems list should be like the list in the screenshot below:

 

Exposed Systems list in Cloud connector


If all the systems are reachable then you're good to go for the next step i.e. destinations configuration in your SAP BTP Sub-account

 

SAP BTP Destinations

    1. Login to SAP BTP
    2. Navigate to your sub-account
    3. Click Connectivity > Destinations



 

Select Destinations in SAP BTP Sub-account



Create XS Controller Destination


Click Create Destination and fill in the following values:

    1. Name: SAP_XS_Advanced_Runtime
    2. Type: HTTP
    3. Description: Optional text
    4. URL: http://<virtual-host-for-controller-endpoint>:<virtual port>. Example: http://my.acme.com:30630
    5. Proxy Type: OnPremise
    6. Authentication: NoAuthentication
    7. For additional properties, click "New Property Button" and choose the following key values
    • HTML5.DynamicDestination : True
    • WebIDEEnabled : True
    • XsApiEndpoint : http\://<virtual host for controller endpoint>\:<virtual port>. Example: http\://my.acme.com\:30630

8. Click Save button

 

Create Destination

 

XS Controller Destination

 

Create XSUAA Destination


Click Create Destination and fill in the following values:

    1. Name: SAP_XS_Advanced_UAA
    2. Type: HTTP
    3. Description: Optional text
    4. URL: http://<virtual host for controller endpoint>:<virtual port>. Example: http://my.acme.com:30632
    5. Proxy Type: OnPremise
    6. Authentication: NoAuthentication
    7. For additional properties, click "New Property Button" and choose the following key values
    • HTML5.DynamicDestination : True
    • WebIDEEnabled : True
    • WebIDEUsage : xsuaa
    • XsApiEndpoint : http\://<virtual host for controller endpoint>\:<virtual port>. Example: http\://my.acme.com\:30630

8. Click Save button

9. Check connection. If the connection fails, then recheck the provided values or contact your System Administrator



 

XSUAA Destination

Create HRTT Destination


Click Create Destination and fill in the following values:

    1. Name: SAP_XS_Advanced_HRTT_Service
    2. Type: HTTP
    3. Description: Optional text
    4. URL: http://<virtual host for controller endpoint>:<virtual port>. Example: http://my.acme.com:51064
    5. Proxy Type: OnPremise
    6. Authentication: NoAuthentication
    7. For additional properties, click "New Property Button" and choose the following key values
    • HTML5.DynamicDestination : True
    • WebIDEEnabled : True
    • WebIDEUsage : xs_hrtt
    • XsApiEndpoint : http\://<virtual host for controller endpoint>\:<virtual port>. Example: http\://my.acme.com\:30630

8. Click Save button

9. Check connection. If the connection fails, then recheck the provided values or contact your System Administrator

 

 

HRTT Destination

Create XS Deployer Destination


Click Create Destination and fill in the following values:

    1. Name: SAP_XS_Advanced_Deploy_Service
    2. Type: HTTP
    3. Description: Optional text
    4. URL: http://<virtual host for controller endpoint>:<virtual port>. Example: http://my.acme.com:51041
    5. Proxy Type: OnPremise
    6. Authentication: NoAuthentication
    7. For additional properties, click "New Property Button" and choose the following key values
    • HTML5.DynamicDestination : True
    • WebIDEEnabled : True
    • WebIDESystem : True
    • XsApiEndpoint : http\://<virtual host for controller endpoint>\:<virtual port>. Example: http\://my.acme.com\:30630

8. Click Save button

9. Check connection. If the connection fails, then recheck the provided values or contact your System Administrator

 

 

XS Deployer Destination

Create SAP HANA Cockpit Destination


Click Create Destination and fill in the following values:

    1. Name: SAP_XS_Advanced_HANA_Cockpit
    2. Type: HTTP
    3. Description: Optional text
    4. URL: http://<virtual host for controller endpoint>:<virtual port>. Example: http://my.acme.com:51041
    5. Proxy Type: OnPremise
    6. Authentication: NoAuthentication
    7. For additional properties, click "New Property Button" and choose the following key values
    • HTML5.DynamicDestination : True
    • WebIDEUsage : xs_cpt
    • WebIDEEnabled : True
    • XsApiEndpoint : http\://<virtual host for controller endpoint>\:<virtual port>. Example: http\://my.acme.com\:30630


8. Click Save button

9. Check connection. If the connection fails, then recheck the provided values or contact your System Administrator

 

SAP HANA Cockpit Destination

Create HANA Database Destination


Click Create Destination and fill in the following values:

    1. Name: SAP_HANA_Database
    2. Type: HTTP
    3. Description: Optional text
    4. URL: http://<virtual host for controller endpoint>:<virtual port>. Example: http://my:30615
    5. Proxy Type: OnPremise
    6. Authentication: NoAuthentication
    7. For additional properties, click "New Property Button" and choose the following key values
    • HTML5.DynamicDestination : True
    • WebIDEEnabled : True
    • WebIDEUsage: xs_hdb

8. Click Save button

9. Check connection. If the connection fails, then recheck the provided values or contact your System Administrator



 

SAP HANA Database Destination


If the connection is successful for all the added destinations, that is the indication of successful connectivity setup for communication between SAP Business Application Studio and XS Advanced System.

SAP Cloud Connector System Mappings configuration and SAP BTP Destination generation can be automatically handled using this btp-cloud-connector-setup-automation generator. You may read this blog to know more about it.

Should you want to run an application in SAP Business Application Studio that connects to your on-premise SAP HANA Platform Database, then you must pass the proxy credentials to your database connection.
Proxy credentials depend on the "Location ID" in the SAP Cloud Connector. The credentials will be as follows:

 

 

"proxy_host": "127.0.0.1", //always same

"proxy_port": "20004", // always same

"proxy_userid": "", // always empty string

"proxy_password": "" // if location ID is set in SAP Cloud Connector then base64 of the location ID else empty string

 

 

 

You may now set up a Development Space in SAP Business Application Studio [Documentation].

Detailed documentation about the setup is available here.