Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
subodhmarathe
Participant

In this blog post, you will learn 'How to create User Provided Services' in  SAP HANA Cloud Business Application Studio.


In recent years, after introduction of Business Application Studio(BAS) for HANA cloud modelling, developers are struggling to create a 'User provided services' to access the underlying tables persisted in any schema (post replication) or any other object/project?'

In some projects, this activity is completed by HANA Admin team but in many cases it is not and this becomes showstopper for HANA developer to start modelling work in BAS.

This blog will help HANA developers to create their own UPS within their SAP HANA Cloud environment when they follow exact steps given.

 

Lets first understand - 'What is User Provided Services or UPS as it is called?' 

Ans - User provided Services instance is required for HANA models to access services that are not available in Service Marketplace with your apps running in Cloud Foundry.

In HANA modeler/developer language, If you are developing HANA models in Business Application studio where you need to access tables replicated from source systems into schemas then you need to create User Provided Services instance to do so.

*********** Step by Step Process of creating User Provided Services **************

 

Please follow below steps in Business Application Studio.

 

  • Login to the SAP BTP Cockpit using DBADMIN* user id for creation role & user required for User Provided Service Instance.

  • Once logged in – go to SAP HANA Database Instances as shown below





  • Click on Actions to go to SAP Cockpit





  • Under Security & User Management – Click on Role Management





  • Create Role HDI_GRANTOR in user Administration and add required schemas** to this Role. Privileges should be assigned like below under Object Privileges tab.





















Privileges Grantable to others
Select Yes
Select CDS Metadata Yes
Select Metadata Yes

**For each source system it is ideal scenario to create separate schemas. Ex : S4HANA, EWM or any other database.(screenshots below)




  • For all schemas repeat privilege assignment mentioned in above step.



  • Create New User HDI_UPS_GRANTOR in user management as shown below





  • Enter the password -





  • Click on Assign Roles –



 

  • Assign HDI_GRANTOR role to HDI_UPS_GRANTOR use with grantable to Other option selected as Yes



 

  • Create User Provided Service from instance in the space as below – For this Click on any subaccount like dev/QA/prod where we need to create User provided service





  • Click on Spaces as shown below.



 

  • Click on a space where development is being done





  • On the right top corner, Click on Create button – and select User-Provided Service instance





  • Enter Name of the service




Write below Code -
{    
"password": “<<Password>>",
"tags": [ "hana" ],
"user": "hdi_ups_grantor“
}

** Write the same password which is created in Step No 7 for ‘hdi_ups_grantor’ user id.

 

  • Once the User-Provided Service is created, you can see the same in instances as shown below



 

Once User provided Service is created, the same should be referred in the mta.yaml file & Grants file in the HANA project created in Business Application studio.

I am hereby giving mta.yaml file code & Grants file code for your quick reference.

**mta.yaml File code -


_schema-version: "2.1"
ID: <<project name>>
version: 0.0.1
modules:
- name: db
type: hdb
path: db
requires:
- name: <<User-Provided Service name>>
- name: hdi_db
properties:
TARGET_CONTAINER: ~{hdi-container-name}
resources:
- name: hdi_db
type: com.sap.xs.hdi-container
properties:
hdi-container-name: ${service-name}
- name: <<User-Provided Service name>>
type: org.cloudfoundry.existing-service
parameters:
service-name: <<User-Provided Service name>>

 

**Grants File code -


{
"<<User-Provided Service name>>": {
"object_owner": {
"roles": [
"HDI_GRANTOR"
]
},
"application_user": {
"roles": [
"HDI_GRANTOR"
]
}
}
}


 

I hope you like this post and it will help you in creating UPS in your SAP HANA Cloud BAS environment and you will be able to access the tables/structures stored in schemas after their replication from source.

Please don't forget to share your feedback on this blog post!

 

You can also follow SAP HANA cloud community topics or other relevant posts for your reference.

SAP HANA Cloud environment Topic page - https://community.sap.com/topics/hana  https://answers.sap.com/tags/73554900100800002881 https://blogs.sap.com/tags/73554900100800002881/

 

Thank you!
4 Comments
Labels in this area