cancel
Showing results for 
Search instead for 
Did you mean: 

Access DWC Objects from SAP CAP Project

davidgbarbero
Participant

Hello all,

I have been following the these 2 tutorials (Tutorial 1 and Tutorial 2) in order to access DWC objects from a SAP CAP project developed in BAS. I have created the User Provided Service and all the db objects. I have bound my application to the CF services (db and UPS). When I try to deploy the database objects I get the following error

Error: Error executing: CALL "FIORI_DEV$TEC"."HDI_GRANTOR_FOR_CUPS"(#PRIVILEGES);
 (nested message: user-defined error: "FIORI_DEV$TEC"."HDI_GRANTOR_FOR_CUPS": line 46 col 7 (at pos 2169): Unsupported Feature: Cannot grant the requested privilege)
grantor service: "UPS_DWC_ACCESS_FROM_FIORI", type: "procedure", user: "FIORI_DEV#CORPBI", procedure: "HDI_GRANTOR_FOR_CUPS", procedure_schema: "FIORI_DEV$TEC"
file name: cfg/dwc_access.hdbgrants<br>

My mta.yaml file looks like this:

_schema-version: '3.1'
ID: dwc_btp_odata
version: 1.0.0
description: "A simple CAP project."
parameters:
  enable-parallel-deployments: true
   
build-parameters:
  before-all:
   - builder: custom
     commands:
      - npm install --production
      - npx -p @sap/cds-dk cds build --production

modules:
 # --------------------- SERVER MODULE ------------------------
 - name: dwc_btp_odata-srv
 # ------------------------------------------------------------
   type: nodejs
   path: gen/srv
   requires:
    # Resources extracted from CAP configuration
    - name: dwc_btp_odata-db
    - name: dwc_hdi_container_service
   provides:
    - name: srv-api      # required by consumers of CAP services (e.g. approuter)
      properties:
        srv-url: ${default-url}

 # -------------------- SIDECAR MODULE ------------------------
 - name: dwc_btp_odata-db-deployer
 # ------------------------------------------------------------
   type: hdb
   path: gen/db  
   parameters:
     buildpack: nodejs_buildpack
   requires:
    # 'hana' and 'xsuaa' resources extracted from CAP configuration
    - name: dwc_btp_odata-db
      properties:
       TARGET_CONTAINER: ~{hdi-service-name}
    - name: dwc_hdi_container_service
      group: SERVICE_REPLACEMENTS
      properties:
       key: ServiceName_1
       service: ~{the-service-name}

resources:
 # services extracted from CAP configuration
 # 'service-plan' can be configured via 'cds.requires.<name>.vcap.plan'
# ------------------------------------------------------------
 - name: dwc_btp_odata-db
# ------------------------------------------------------------
   type: com.sap.xs.hdi-container
   parameters:
     config:
      database_id: (I hid it for this question)
      schema: DWC_TO_FIORI
     service: hana  # or 'hanatrial' on trial landscapes
     service-plan: hdi-shared
   properties:
     hdi-service-name: ${service-name}
# The user provided service created in BTP to be able to access the DWC space database user
# ------------------------------------------------------------
 - name: dwc_hdi_container_service
# ------------------------------------------------------------
   type: org.cloudfoundry.existing-service
   parameters:
     service-name: UPS_DWC_ACCESS_FROM_FIORI
   properties:
     the-service-name: ${service-name}

I have the hdbgrants files as it follows:

{
	"UPS_DWC_ACCESS_FROM_FIORI": {
		"object_owner": {
			"roles": [],
			"container_roles": [],
			"object_privileges": [
                {
				  "type": "VIEW",
				  "name": "DWC_to_Fiori_View",
				  "privileges_with_grant_option": [
				    "SELECT"
				  ]
				}
			]
		}
	}
}

And the hdbsynonym looks like this:

{
  "DWC_SFLIGHT_CV": {
    "target": {
      "schema": "FIORI_DEV",
      "object": "DWC_to_Fiori_View"
    }
  }
}

What is wrong with the configuration? Why do I get that error message when trying to deploy the db artifacts? I have found no documentation about this error whatsover, so any kind of help will be really welcomed.Thanks!

View Entire Topic
davidgbarbero
Participant
0 Kudos

I already found the solution. The flag "Expose for consumption" was not set to true in the DWC view. After setting that flag on, the deployment worked as expected.