association in cds views
Sale Order Item
@AbapCatalog.sqlViewName: 'ZSO_VBAP'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'sale order item'
define view zso_vbap1 as select from vbap
{
key vbeln as Sale_Order,
key posnr as Item_num,
matnr as Material_num,
matwa as Material_Entered
}
Sale Order Header
@AbapCatalog.sqlViewName: 'ZSALE_VBAK'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'sale order header'
define view zso_vbak1 as select from vbak as a
association [1..*] to zso_vbap1 as b on a.vbeln = b.Sale_Order
{
key a.vbeln as Sale_Order,
a.erdat as Creation_date,
a.erzet as Creation_time,
b.Item_num as Item_num,
b.Material_num as Material_num,
b.Material_Entered as Material_Entered
}
Association
@AbapCatalog.sqlViewName: 'ZASO_VBAK'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'association'
define view zas_vbak as select from zso_vbak1 as a
association [1] to zso_vbap1 as _b
on $projection.Sale_Order = _b.Sale_Order
{
key a.Sale_Order as Sale_Ord,
a.Creation_date as Creation_date,
a.Creation_time as Creation_time,
_b
}
output
click zas_vbak.then
Comments
Post a Comment