Hi,
I am creating a CDS view in which I would like to retrieve a field that comes from the join of several tables and I am faced with the limit of CDS views or I do not know how to use them well.
Here is an extract from my CDS (very simplified):
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: ‘Demo’
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{ serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED }
define view entity Z_cds_entity_demo
as select from ZI_MaintenanceNotification_Ext as _MaintenanceNotification
association [0..1] to I_Material as _Material on $projection.Material = _Material.Material
{
key _MaintenanceNotification.MaintenanceNotification,
_MaintenanceNotification.Material,
_MaintenanceNotification.MaintenanceOrder
}
From the MaintenanceOrder field I would like to be able to read the tables EBKN -> EKKN -> EKKO in order to retrieve in my CDS fields of EKKO, for example EKKO.
In classic ABAP it is simple, but with the mechanism of CDS View I do not know how to do it and especially if it is possible. I looked into the TABLE FUNCTION but apparently it is not possible to use it in an association or to send a parameter (AUFNR in my case).
Thank you in advance for your help.