cancel
Showing results for 
Search instead for 
Did you mean: 

unable to use targetElement within ui.facet when extending a standard cds view

George_ki
Discoverer
0 Kudos
175

Hi, 
I tried to extend the ui.facet of a standard cds view with a new metadata extension. The purpose is to extend the object page of a fiori element app with a new section and present it as table (type: #LINEITEM_REFERENCE). First I extended the standard app with a new association to my ZCDSView which it has also a metadata extension file with annotation (@UI.LINEITEM).
I did also a metadata extension to the standard app on the customer layer and add a new label to the UI.facet as follow:
@ui.facet: [

{

id: 'addr',
label: 'address',
pupose: #standard,
type: #LINEITEM_REFERENCE,
position: 230,
targetElement: '_ZCDSView'                //defined as an alias of the association in the extension of the standard cds

}]

The problem is that The section 'address' is not appearing at all in the object page. But when removing the targetElement: '_ZCDSView',  the label appear with empty content.

I am also sure that the association has been defined properly in the extended view because the association can be followed in the data preview mode.
Any solution to this problem?



View Entire Topic
junwu
Active Contributor
0 Kudos

show me how you extend the cds with new association, did you expose the association?

George_ki
Discoverer
0 Kudos

@AbapCatalog.sqlViewAppendName: 'CEXTADDRESS'
@EndUserText.label: 'Extension view'

extend view C_DFS_PositionHeaderTP with c_ext_address
association [1..*] to C_ZADDRESSVIEWTP as _ViewAddressTP on $projction.dfspositionId = _ViewAddressTP.DfsObjid

{
@ui.hidden: true
DfsPositionId as poshead, // no need to this element, just to silence the compilator
_ViewAddressTP
}


George_ki
Discoverer
0 Kudos
the alias _ViewAddressTP is used as described above in targetElement in the metadata extension for the standard cds