Ausdrücke in der Feldliste
@AbapCatalog.sqlViewName: 'ZV_EXPRESSIONS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'First CDS View'
define view zcds_expressions
as
select from snwd_so_i as soi
left outer join snwd_pd as pd on soi.product_guid = pd.node_key
{
key soi.node_key as NodeKey,
soi.parent_key as ParentKey,
soi.so_item_pos as SoItemPos,
soi.currency_code as CurrencyCode,
soi.gross_amount as GrossAmount,
soi.net_amount as NetAmount,
soi.tax_amount as TaxAmount,
pd.category,
ltrim(soi.so_item_pos, '0') as Position0,
division(soi.tax_amount
,soi.net_amount
,2) * 100 as tax,
case when soi.net_amount < 100 then 'C'
when soi.net_amount < 1000 then 'B'
else 'A'
end as PriceCategory,
@Semantics.quantity.unitOfMeasure: 'VolumeUnit'
cast(pd.width as abap.dec( 12,2 ))
* cast(pd.height as abap.dec( 12,2 )) * pd.depth as Volume,
@Semantics.unitOfMeasure: true
cast('MMQ' as abap.unit( 3) ) as VolumeUnit,
TSTMP_TO_DATS(pd.created_at
, $session.user_timezone
, $session.client
, 'NULL') as created_date,
case when pd.weight_measure < 1
or pd.weight_unit = 'g' then 'A'
when pd.weight_measure >= 1
and pd.weight_measure <= 5 then 'B'
else 'C'
end as WeightCategory
}