@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.sqlViewName : 'NSDM_V_MSKUH_AGG'
@EndUserText.label : 'CDS View for Sums on MSKUH per Period'
@DataAging.noAgingRestriction : 'false '
@ObjectModel.usageType.sizeCategory : 'L'
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ClientHandling.algorithm: #AUTOMATED
@AccessControl.authorizationCheck: #NOT_ALLOWED
@AbapCatalog.viewEnhancementCategory: #PROJECTION_LIST
define view nsdm_e_mskuh_agg as
select from matdoc_extract
{
key mandt,
key matbf as matnr,
key werks,
key charg_sid as charg,
key sobkz,
key kunnr_sid as kunnr,
key gjper,
key lbbsa_sid as lbbsa,
sum(stock_qty_l1) as stock_qty,
sum(/cwm/stock_qty_l1) as /cwm/stock_qty
/*
@EndUserText: { label: 'Valuated Unrestricted-Use Stock', quickInfo: 'Unrestrestricted' }
@Semantics.quantity.unitOfMeasure : 'MARA.MEINS'
sum(case lbbsa_sid when '01' then stock_qty_l1 else 0 end ) as kulab,
@EndUserText: { label: 'Stock in Quality Inspection', quickInfo: 'In Quality Insp.' }
@Semantics.quantity.unitOfMeasure : 'MARA.MEINS'
sum(case lbbsa_sid when '02' then stock_qty_l1 else 0 end ) as kuins,
@EndUserText: { label: 'Total Stock of All Restricted Batches', quickInfo: 'Restricted-Use Stock' }
@Semantics.quantity.unitOfMeasure : 'MARA.MEINS'
sum(case lbbsa_sid when '08' then stock_qty_l1 else 0 end ) as kuein,
@EndUserText: { label: 'Stock in Transfer (Plant to Plant)', quickInfo: 'Stock in Trans.' }
@Semantics.quantity.unitOfMeasure : 'MARA.MEINS'
sum(case lbbsa_sid when '05' then stock_qty_l1 else 0 end ) as kuuml
*/
}
where
(sobkz = 'W'
and (lbbsa_sid = '01'
or lbbsa_sid = '02'
or lbbsa_sid = '05'
or lbbsa_sid = '08') )
or (sobkz = 'V'
and (lbbsa_sid = '01'
or lbbsa_sid = '02'
or lbbsa_sid = '08' ) )
group by mandt,
matbf,
werks,
charg_sid,
sobkz,
kunnr_sid,
gjper,
lbbsa_sid
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"MATDOC_EXTRACT"
],
"ASSOCIATED":
[],
"BASE":
[],
"VERSION":0
}
}*/
Depth:
1
2
3
4
5
All
Reload