I was going through the blog by Vishwa Gopalkrishna  about the CI/CD automation approach for hybrid developments focusing on HDI container-based developments for SAP HANA Cloud & Space level Developments within SAP Data Warehouse Cloud .My blog would be a pre-requisite for the automation approach and would provide the hands-on and step by step tutorials for accessing SAP Data Warehouse Cloud(SAP DWC) space objects in your HDI container as well accessing HDI containers in your SAP DWC space. The bi-directional approach of using SAP DWC as SaaS and utilize the underlying SAP HANA Cloud for advanced or complex developments supports customers in the following scenarios:

  1. Customers migrating from HANA Enterprise Data mart to SAP DWC with dependency on multi-model analytics capabilities
  2. Customers migrating from SAP BW to SAP DWC with dependency on Native HANA developments.
  3. Customers planning to expose the SAP DWC Space Objects for external OData consumption or as Web APIs

Please note that there have been some updates in SAP DWC roadmap with availability of Choropleth layer for Spatial Analytics and generic OData based Public APIs to build custom solutions.  Please refer the blog https://blogs.sap.com/2022/10/05/sap-data-warehouse-cloud-in-q3-news/ from Klaus-Peter Sauer for more details.

Now let’s discuss the Scenario 1 in detail “Accessing DWC Space Objects in the HDI container”

Access%20Space%20Objects%20in%20HDI%20container

Access Space Objects in HDI container

Here are the steps to be followed in sequence

  1. Prerequisites
  2. Raise SAP service Ticket for Space mapping [Between DWC Space and your BTP Space]
  3. HDI Development using Business Application Studio [BAS]

Prerequisites:

  1. You already have access to the SAP DWC Tenant.
  2. You have a BTP account with an Organization and Space for HDI Developments.
  3. Both your DWC Tenant and BTP account must be in the same Data Center. [eg EU10 or US10]
  4. You already have a DWC Space with necessary views to be exposed for BAS based development.
  5. You have a created a Open SQL Schema/Database User within your SAP DWC space enabling READ, WRITE & HDI consumption.

As you see in the below screenshots, my DWC tenant and subaccounts are in datacenter eu10.

Datacenter%20SAP%20DWC%20and%20BTP%20Sub-Account

 

And I also assume you have the necessary views in your DWC Space to be exposed for BAS based development. In my case, I already have a view “COVID_STATS”, a federated data source from BigQuery which will be blended with other data sources.

DWC%20Analytical%20Dataset

DWC Analytical Dataset

Finally, the Open SQL Schema/DB user within your DWC Space with access to read and write for HDI consumption. In my case, the DB User is QRESPONSE. When you select the info dialog [1], it will provide the credentials for User-Provided service [UPS] that we will use later for BAS developments.

Open%20SQL%20Schema

 

SAP service Ticket for Space mapping:

In order to consume objects deployed in DWC Spaces into your own HDI container, you need access to the underlying SAP HANA Cloud  tenant from your BTP space.  In order to achieve this, you have raise a ticket to SAP component DWC-SM and request instance sharing (sharing the HANA Cloud tenant of SAP DWC to your BTP Space) . While creating the incident, please provide the following details and request for tenant mapping.

  • SAP DWC Tenant ID
  • SAP DWC Database ID
  • SAP BTP Org GUID
  • SAP BTP Space GUID

You can get the SAP DWC tenant ID  & Database ID as seen below [System->About]

SAP%20DWC%20Tenant%20ID

SAP DWC Tenant ID

You can get the Org ID and Space ID using your Cloud Foundry CLI or from your Business Application studio Terminal[1] by executing the following commands

 

cf org <orgname>  --guid
cf  space <spacename> --guid

Business%20Application%20Studio

Business Application Studio

If you are assigned to multiple Orgs or Spaces , then execute “cf orgs” & “cf spaces” to get the Org name and Space name . And then execute the commands. Once you have these details, please raise a service ticket to DWC-SM requesting to map your BTP space to DWC Space.

Once support team completes the request, you will get a screenshot  with confirmation of space mapping.

Space%20Mapping

Space Mapping

Now that all the necessary prerequisites and space mapping are taken care, let’s get into development.

HDI Development using Business Application Studio [BAS]

  1. Create User-Provided Service [UPS] using BTP Cockpit
  2. Clone the repository and deploy with minimal adjustments

You can use the following git repository for reference and am going to explain the steps based on the same.

 Create User-Provided Service [UPS] using BTP Cockpit

Since I already have my HANA Cloud instance and instance-based developments in the space          [hcdb], I created a separate space for developments based on instance sharing [space              dwcdemo]. If you want to create it in the existing space where you already have a HANA Cloud      instance, then you need to add the Database ID in the yaml file before deployments.

BTP%20Cloud%20Foundry%20Space

As mentioned in the prerequisites [point 5], you should already have the Open SQL schema details from the DWC Space. Navigate to the newly created BTP space for developments and create a UPS with the details you have captured in point 5.

Create%20User%20Provided%20Instance

Provide the instance name[1] as “dwcshare” as the config files in shared GIT repo address the UPS with the same name. If you are providing a different name, then make sure you adjust the config files once you clone the repository. And in the section “Configure Instance parameters” section[2],  provide the Open SQL Schema access details.

UPS

Use the below code snippet as reference for instance parameters.

{
    "password":  “ ”   --> Password from DWC Space DB user[1]
    "schema": "  ",    --> Provide the Space Schema  NOT the OpenSQL schema [2]
    "tags": [
        "hana"
    ],
    "user": " "  -->  Provide the Open SQL Schema Database Username [3]
}

And here is a screenshot for your reference for the Open SQL schema connection

Open%20SQL%20Schema%20Access%20Details

Once completed, you should see the new UPS instance dwcshare created in your SAP BTP space.

Service%20Instances

 

Clone the repository and deploy with minimal adjustments

Navigate to Business Application Studio and create a new Space [or login to existing one] for SAP HANA Native Application

Business%20Application%20Studio%20Development%20Space

Select the newly created space[in my case “CrossAnalytics”] . Now login to BTP cloud foundry space before you clone the repository . This will be the space where you deploy the developments you are going to create based on SAP DWC artifacts.

To login to your BTP space, you can select the cloud foundry targets [1]  or use Terminal[2].

Business%20Application%20Studio%20CLI%20Login

Let’s use the cloud foundry targets approach to login and provide the credentials to connect to the BTP space.

Once you login, select the option “Clone from Git”

 

Provide the repo URL and click enter to Clone.

 

And select the option  “Open” to view the repository in the BAS editor.

 

The repository is cloned now as you see in the highlighted part of the screen. And we need to map the UPS to container-service[1] and bind the service instance [2].

Let’s bind the UPS ‘dwcshare’ which was created previously. Select the bind option[1] and you will see the option “Bind to the dwcshare service”. Select the option and bind the UPS .

Now bind the hdi container [1] by selecting  “Bind to the default service instance” [2]

When you bind the instance , you will see this message on how to deal with undeployment of files in case of differences between DB and project filesystem. Select “Enable”.

Once you bind the UPS and container, you will see the name of UPS and container as shown below.

Now let’s do a quick check on the artifacts before we deploy.

cfg folder has the hdbgrants and hdbsynonymconfig which will point to the objects from DWC Space.

src folder will have the synonyms and the development artifacts such as calculation view based upon synonyms.

 

In the hdbsynonymconfig file, replace the upsname [1] if you have created a different UPS name[1] than used in repo and change the object name to your DWC Space object view or views[2].

Also update the same information in hdbgrants file with your UPS on line 2  and name of the DWC Space view on line 9

Finally in the source folder [src], update the hdbsynonym[1] with all your DWC space objects that you wanted to use for native HANA deployments. Please make sure the objects mentioned here are the same as mentioned in cfg folder. Also in my case I have created a calculation view[2] based on my DWC Space object COVID_STATS.  So you need to replace the data source with your own view or can delete the calculation view as of now. Once you deploy the synonyms, you can create your own calculation view.

Once these adjustments are done, deploy the cfg[1]folder first followed by src[2] folder. Once the deployment is successful, the objects are deployed in the schema CROSSBTP_1. If you want to change the name of the schema, adjust the mta.yaml file (line 22).

Assuming you followed all these changes, the container should have deployed with no error. If you check the synonym used in my calculation view, it will be the same object from DWC Space.

 

Also, the deployed container CROSSBTP_1 can now be added back to SAP DWC  space as a HDI container. And this HDI container could be used a source while using “Data Builder”

 

In order to consume the deployed container back in SAP DWC Space, please follow these steps.

1. Navigate to the Data builder within your space.

 

2. Create a graphical view

 

3. Under the sources tab, you will find the deployed container[CROSSBTP_1]  and the view[cv_test]      which could be utilized back in your SAP DWC space with other data sources.

 

I would like to thank Axel Meier for his initial blog on this concept and helping with deployment issues. Hopefully this helps you in understanding how to access the HANA Cloud tenant of SAP DWC for HDI developments using Business Application studio. Please do share your feedback or reach out to me if you have issues in accessing the Git Repositories .

 

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x