cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP Error - invalid table name: Could not find table/view

Cristian
Participant
0 Kudos
337

Hi experts,

We have a project which is accessing an HDI container outside the space where the cap project is deployed.

We have created the corresponding settings through synonyms to enable the visibility with the externa HDI container.

We have created a view as a select from some of the tables.

service ServicesManagementService {

entity servicesView as ...

Everything gets deployed succesfully and I can see the view successfully created in the HDI container running in the same space as our app and accessing the externa HDI over synonyms. I can even execute the view successfully on Database Explorer.

The problem comes when I run the ODATA call as we receive the error as follows:

Could not find table/view SERVICESMANAGEMENTSERVICE_SERVICESVIEW in schema SDI_HDI_DB_2: line 1 col 436 (at pos 435)

Being the SDI_HDI_DB_2 the namespace where the external HDI is deploy and the namespace used in the CAP project data model cds to define the entities with the cds.persistance exist annotation.

Anything am I missing to make this work?

Many thanks in advance!

M.

View Entire Topic
martinstenzig
Contributor
0 Kudos

Here is the checklist I use: 

1. Let's say I have a remote table that I have in a regular database schema and that TABLE is called SAP_AUFK

2. Make sure the Synonym is there and working. -> It sounds like you have checked that already"C_SAP_AUFK": { "target": { "object": "SAP_AUFK", "schema": "CLEVER" } }3. You create a .cds file that represents that synonym. a) If you have underscores in the name, you can model them as context or namespace. b) add cds.persistence.exists in front of the entitycontext c { @CDS.persistence.exists entity SAP_AUFK { key MANDT : String(3); key AUFNR : String(12); AUART : String(4); ... }; }4. Now you can treat them as a regular entity. Gut feeling and without seeing more of your code, I think you have not configured the representative entity correctly.