cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP - Access Table HDI in a different space deploy error

Cristian
Participant

Hi experts,

We have a CAP project in which we need to access a table in an HDI deployed in a CF space different from the CAP app.

The table is called ZPMSERVLOC and it is in a schema called SDI_HDI_DB_2.

Our data model within the CAP project is as follows:

namespace SDI_HDI_DB_2;
 
@cds.persistence.exists
entity ZPMSERVLOC {
  key MANDT      : String(3) not null;
  key ZZIDINTERN : String(15) not null;
  key ZZSITE     : String(30) not null;
      ZZSITEEXT  : String(30);
      ZZSERVID   : String(200);
      ZZMARKDEL  : String(1);
}

We have declared an .hdsynonym as follows:

{
  "ZPMSERVLOC": {
    "target": {
      "object": "ZPMSERVLOC",
      "schema": "SDI_HDI_DB_2"
    }
  }
}

The relevant role is granted with SELECT privileges to the table.

            {
                "name": "ZPMSERVLOC",
                "type": "TABLE",
                "privileges": [ "SELECT" ]
            }

We have as well the user provided service with the credentials of the external HDI.

But when deploying, the database deployer app is failing with the following error:

Error: The file requires "db://SDI_HDI_DB_2_ZPMSERVLOC" which is not provided by any file [8212001]

Any idea what is wrong? Maybe the number 2 in the namespace may be something that is affecting?

Many thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

 

{
  "SDI_HDI_DB_2_ZPMSERVLOC": {
    "target": {
      "object": "ZPMSERVLOC",
      "schema": "SDI_HDI_DB_2"
    }
  }
}

 you change your synonym like that.

Cristian
Participant
0 Kudos

Many thanks @junwu ! That solved the issue. Very much appreciated. Now everything is deployed successfully.

Now I am encountering a odd stuff. Let´s see if you could help.

I have a service created on the tabe of the external HDI.

 

service ServicesService {

    entity servicesView as projection on dm.ZPMSERVLOC;

}
 
But the associated View is not created in the external HDI container although I can see it generated in the gen folder.
 
Captura de pantalla 2024-05-16 204235.png
Any idea what can be the issue?
Many thanks in advance!
C.
 
 
 
 
 

Answers (0)