Skip to Content
1
Jun 17, 2020 at 03:38 PM

CDS OData.publish Error: No data retrieved from ABAP dictionary for entity ... [OData Exposure]

1464 Views

Hi all,

I'm trying to create a new CDS (BOPF-Based) with a root node (header) and a child (tasks):

@AbapCatalog.sqlViewName: 'ZTRMI_HEADER'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Task Request Header'

@Search.searchable: true

@ObjectModel: {
    modelCategory: #BUSINESS_OBJECT,
    compositionRoot: true,
    representativeKey: 'request',
    semanticKey: 'request',
    createEnabled: true,
    updateEnabled: true,
    deleteEnabled: true,
    transactionalProcessingEnabled: true,
    writeActivePersistence: 'ZTRM_HEADER'
}


define view ZTRM_I_HEADER
    as select from ztrm_header 
    association [0..*] to ZTRM_I_TASKS as _tasks
        on $projection.request = _tasks.request
@AbapCatalog.sqlViewName: 'ZTRMI_TASKS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Transport Requests Tasks'

@Search.searchable: true

@ObjectModel: {
    modelCategory: #BUSINESS_OBJECT,
    transactionalProcessingDelegated: true,
    representativeKey: 'code',
    semanticKey: [ 'request', 'code' ],
    createEnabled: true,
    updateEnabled: true,
    deleteEnabled: true,
    writeActivePersistence: 'ZTRM_TASKS'
}

define view ZTRM_I_TASKS
    as select from ztrm_tasks
    association [1] to ZTRM_I_HEADER as _header
        on _header.request = $projection.request

Until here all perfect, the BOPF is generated.

The problem is when I try to create the consumption CDS for both of them:

@AbapCatalog.sqlViewName: 'ZTRMC_HEADER'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Consumption: Header'

@Search.searchable: true

@OData.publish: true

@ObjectModel: {
    representativeKey: 'request',
    semanticKey: 'request',
    createEnabled: true,
    updateEnabled: true,
    deleteEnabled: true,
    transactionalProcessingDelegated: true
}

@UI.headerInfo:
{
    typeName: 'Transport Request',
    typeNamePlural: 'Transport Requests',
    title.value: 'request',
    title.label: 'Transport Requests'
}

define view ZTRM_C_HEADER
    as select from ZTRM_I_HEADER
    association [0..*] to ZTRM_C_TASKS as _tasks
        on $projection.request = _tasks.request
 
@AbapCatalog.sqlViewName: 'ZTRMC_TASKS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Consumption: Tasks'

@Search.searchable: true

@ObjectModel: {
    representativeKey: 'code',
    semanticKey: [ 'request', 'code' ],
    createEnabled: true,
    updateEnabled: true,
    deleteEnabled: true,
    transactionalProcessingDelegated: true,
    writeActivePersistence: 'ZTRM_TASKS'
}

@UI.headerInfo:
{
    typeName: 'Task',
    typeNamePlural: 'Tasks',
    title.value: 'code',
    title.label: 'Task'
}

define view ZTRM_C_TASKS
    as select from ZTRM_I_TASKS
    association [1] to ZTRM_C_HEADER as _header
        on _header.request = $projection.reques

ZTRM_C_HEADER is saved and activated but the annotation OData.publish throw an error: No data retrieved from ABAP dictionary for entity ZTRM_TASKS [OData Exposure]


Could someone help with that error?

Thank you.