cancel
Showing results for 
Search instead for 
Did you mean: 

Representative Key : @ObjectModel.representativeKey

virenp_devi
Contributor
0 Kudos

Hello,

What is the precise reason of using @ObjectModel.representativeKey. I found few scn answers but found nothing that can explain the basics.

In CDS view as soon as I define any field as Foreign key, error to provide Representative key is prompted. If view from the association holds only one key (not composite) , is Representative key still required and why? How it affects the association.

Thank you so much.

Viren

maheshpalavalli
Active Contributor
0 Kudos

Hi Viren,

Can you provide the code that you have used?

BR,

Mahesh

Accepted Solutions (1)

Accepted Solutions (1)

former_member520182
Discoverer

Hi Viren,

As my understanding, representativeKey is the main column of a view, such as when you create a view containing columns like, controlling area, sales org, and sales org description, then sales org is the representativeKey, since this view is used to provide the text of sales org. When do the association, you may join this view with controlling area and sales org, system use representativeKey to see which field the text will be attached to. If the view only have one key, no need, since the text attached to the key auto.

Regards,

Franklin

Answers (2)

Answers (2)

virenp_devi
Contributor

Hello SAP Team & Experts,

Kindly assist

virenp_devi
Contributor
0 Kudos

Thanks Franklin. Yes after lots of tests I realised that.