Skip to Content

No representative key element found in CDS view Z2I_GLACCOUNTINCHARTOFACCOUNTS


I copied the CDS view I_GLACCOUNTINCHARTOFACCOUNTS and created a new one Z2I_GLACCOUNTINCHARTOFACCOUNTS. The intention is to create the same master data without the hierarchy association, but i get the error "no representative key element".

Where is the error? the CDS view is exactly the same as the original but i cannot correct the error and i dont know how to correct the problem.

I have the following CDS definition:

@EndUserText.label: 'G/L Account In Chart Of Accounts'

@Analytics: {dataCategory: #DIMENSION, dataExtraction.enabled: true} @VDM.viewType: #BASIC @AbapCatalog.sqlViewName: 'ZZZIFIGLAcc' @ObjectModel.representativeKey: 'GLAccount2c'

//@AccessControl.authorizationCheck: #CHECK

@AbapCatalog.buffering.status: #NOT_ALLOWED @ObjectModel.usageType.sizeCategory: #M

@ObjectModel.usageType.dataClass: #MASTER @ObjectModel.usageType.serviceQuality: #A

@ClientHandling.algorithm: #SESSION_VARIABLE @Metadata.ignorePropagatedAnnotations: true

//@AccessControl.authorizationCheck: #CHECK

and the key fields:

@ObjectModel.foreignKey.association: '_ChartOfAccounts' //Inserted by VDM CDS Suite Plugin

key ska1.ktopl as ChartOfAccounts,

@ObjectModel.text.association: '_Text'

// @ObjectModel.Hierarchy.association: '_GLAccountHierarchyNode'

key ska1.saknr as GLAccount2c,

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Sep 13, 2017 at 10:38 AM

    Try adding a representative key via annotation:

    @ObjectModel.representativeKey: '<fieldname>'



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.