Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

No representative key element found in CDS view

Former Member
0 Likes
7,414

Hi Expert,

I create a ABAP CDS view with annotation as below:

@ObjectModel.representativeKey: 'FORM_ID'

@AbapCatalog.sqlViewName: 'ZTAB_LINEV'

@AbapCatalog.compiler.compareFilter: true

@AccessControl.authorizationCheck: #CHECK

@EndUserText.label: 'table line text for replacing text universe' @Analytics.dataExtraction.enabled: true

@Analytics.dataCategory: #DIMENSION

when I activate this CDS view, I get error message below, even though I already define representive key in annotation

" No representative key element found in CDS view "

by following picture, you can see there is 'FORM_ID' field in the CDS view.

fields-in-cds-view.png

1 ACCEPTED SOLUTION
Read only

UweFetzer_se38
Active Contributor
3,674

Missing "KEY" in front of the first column?

Hi Expert,

I create a ABAP CDS view with annotation as below:

@ObjectModel.representativeKey: 'FORM_ID'

@AbapCatalog.sqlViewName: 'ZTAB_LINEV'

@AbapCatalog.compiler.compareFilter: true

@AccessControl.authorizationCheck: #CHECK

@EndUserText.label: 'table line text for replacing text universe' @Analytics.dataExtraction.enabled: true

@Analytics.dataCategory: #DIMENSION

when I activate this CDS view, I get error message below, even though I already define representive key in annotation

" No representative key element found in CDS view "

by following picture, you can see there is 'FORM_ID' field in the CDS view.

fields-in-cds-view.png

4 REPLIES 4
Read only

UweFetzer_se38
Active Contributor
3,675

Missing "KEY" in front of the first column?

Read only

Former Member
0 Likes
3,674

thanks.

Read only

0 Likes
3,674

Hi,

i had experience in this issue and below is the way how i resolved it.

we need to provide the following Annotation to overcome this error.

@ObjectModel.representativeKey: [ 'Countrykey', 'Bankkeys', 'BankShortKey', 'Companycode' ]

Here the fields Mentioned in [ ] are key fields in my case.

Mention all the key fields in your CDS View with above annotation and activate the CDS View and test it . it will work.

Regards

Sri Ram

Read only

0 Likes
3,674

Thanks, worked fine. i was getting the error only for "master data extractor" and the code @ObjectModel.representativeKey: fixed it. Thanks again.