12-29-2018 12:12 PM
Hi all
I would like to know, what is the representative key on CDS view? For what it is good for? I read about it on https://help.sap.com/viewer/9a281eac983f4f688d0deedc96b3c61c/1709%20001/en-US/f1fc5425e0094c5baf4954... but can not figure out, what does it exactly do.
I made an example:
@AbapCatalog.sqlViewName: 'ZAMIBOPFCHILD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'ZAM: Testing BOPF Child'
@ObjectModel: {
modelCategory: #BUSINESS_OBJECT,
writeActivePersistence: 'ZAM_T_BOPF_CHILD',
semanticKey: ['MATERIAL', 'PLANT'],
representativeKey: 'PLANT',
createEnabled: true,
deleteEnabled: true
}
define view ZAM_I_BOPF_CHILD
as select from zam_t_bopf_child
association [0..1] to ZAM_I_BOPF_ROOT as _Root on $projection.material = _Root.material
{
key material,
key plant,
proc_type,
@ObjectModel.association.type: [#TO_COMPOSITION_PARENT,#TO_COMPOSITION_ROOT]
_Root
}
Why is the MATERIAL not the representative key?
Thanks
01-20-2019 4:54 PM
Not sure if I understand your question correctly, but to be able to achieve the requirements, the MATERIAL field should be defined as a KEY field in the dictionary table from where the data is coming from.
04-28-2023 1:46 PM
Its not very comprehensible in sap help the use of represntative key. I also have the same queries.