Skip to Content
0
Jun 21, 2021 at 11:18 AM

Getting error when using @odata.draft.enabled annotation CAP - Fiori Elements - CRUD

156 Views

Hi All,

When I am using @odata.draft.enabled it gives me the below error.

invalid table name: Could not find table/view CATALOGSERVICE_INTERACTIONS_HEADER_DRAFTS in schema MYHANAPROJECT_HDI_MYHANAAPP_DB_DEPLOYER_1

But removing the annotation it gives me the data while calling service.

Have attached below code

using app.interactions as my from '../db/interactions';
@path:'catalog/' 
service CatalogService {
   
@odata.draft.enabled
entity Interactions_Header as select from my.Interactions_Header;

entity Interactions_Items
    as projection on  my.Interactions_Items;
 
}
namespace app.interactions;

using { Country } from '@sap/cds/common';
type BusinessKey : String(10);
type SDate : DateTime;
type LText : String(1024);


entity Interactions_Header {
  key ID : UUID;
  ITEMS  : Composition of many Interactions_Items on ITEMS.INTHeader = $self;
  PARTNER  : BusinessKey;
  LOG_DATE  : SDate;
  BPCOUNTRY : Country;

};
entity Interactions_Items {

    key INTHeader : association to Interactions_Header;
    key TEXT_ID : BusinessKey;
        LANGU   : String(2);
        LOGTEXT : LText;
};

Attachments

capture.png (60.5 kB)