<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Access DWC Objects from SAP CAP Project in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/access-dwc-objects-from-sap-cap-project/qaa-p/12786257#M4800561</link>
    <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2170909-image.png" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 09:36:05 GMT</pubDate>
    <dc:creator>davidgbarbero</dc:creator>
    <dc:date>2023-06-09T09:36:05Z</dc:date>
    <item>
      <title>Access DWC Objects from SAP CAP Project</title>
      <link>https://community.sap.com/t5/technology-q-a/access-dwc-objects-from-sap-cap-project/qaq-p/12786256</link>
      <description>&lt;P&gt;Hello all, &lt;BR /&gt;&lt;BR /&gt;I have been following the these 2 tutorials (&lt;A href="https://blogs.sap.com/2021/03/18/expose-sap-data-warehouse-cloud-artefacts-as-odata-v4-service/" target="_blank"&gt;Tutorial 1&lt;/A&gt; and &lt;A href="https://blogs.sap.com/2021/01/31/sap-btp-showcase-access-the-sap-hana-cloud-database-underneath-sap-data-warehouse-cloud/" target="_blank"&gt;Tutorial 2&lt;/A&gt;) 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&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;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&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;My mta.yaml file looks like this:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;_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.&amp;lt;name&amp;gt;.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}
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I have the hdbgrants files as it follows:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;{
	"UPS_DWC_ACCESS_FROM_FIORI": {
		"object_owner": {
			"roles": [],
			"container_roles": [],
			"object_privileges": [
                {
				  "type": "VIEW",
				  "name": "DWC_to_Fiori_View",
				  "privileges_with_grant_option": [
				    "SELECT"
				  ]
				}
			]
		}
	}
}&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;And the hdbsynonym looks like this:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;{
  "DWC_SFLIGHT_CV": {
    "target": {
      "schema": "FIORI_DEV",
      "object": "DWC_to_Fiori_View"
    }
  }
}&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;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!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 12:20:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/access-dwc-objects-from-sap-cap-project/qaq-p/12786256</guid>
      <dc:creator>davidgbarbero</dc:creator>
      <dc:date>2023-06-08T12:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Access DWC Objects from SAP CAP Project</title>
      <link>https://community.sap.com/t5/technology-q-a/access-dwc-objects-from-sap-cap-project/qaa-p/12786257#M4800561</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2170909-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 09:36:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/access-dwc-objects-from-sap-cap-project/qaa-p/12786257#M4800561</guid>
      <dc:creator>davidgbarbero</dc:creator>
      <dc:date>2023-06-09T09:36:05Z</dc:date>
    </item>
  </channel>
</rss>

