@AbapCatalog.sqlViewName : 'V_CONSUMP_DOC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@ObjectModel.usageType.serviceQuality : 'D'
@ObjectModel.usageType.sizeCategory : 'L'
@ObjectModel.usageType.dataClass : 'TRANSACTIONAL'
@ClientDependent: true
@EndUserText.label : 'Sum of consumption with WIP Reduction'
define view ML4H_CDS_CONSUMP
with parameters
P_kalnr : ck_kalnr,
p_curtp : curtp,
p_jahrper_low : ml4h_jahrper,
p_jahrper_high : ml4h_jahrper,
p_runref : ml4h_runref,
p_xabr : ml4h_xabr,
P_timestamp : ml4h_timestamp
as select from mldoc
{
key kalnr as kalnr,
key curtp as curtp,
key categ as CATEG,
key ptyp as PTYP,
key process as process,
@Semantics.currencyCode: true
key waers as waers,
@Semantics.unitOfMeasure: true
key meins as meins,
@Semantics.quantity.unitOfMeasure : 'MEINS'
0 - cast (sum (quant) as ml4h_quantity ) as quant,
@Semantics.amount.currencyCode : 'WAERS'
0 - cast (sum (stval) as ml4h_stval ) as stval,
@Semantics.amount.currencyCode : 'WAERS'
0 - cast ( sum ( prd ) as ml4h_prd ) as prd,
@Semantics.amount.currencyCode : 'WAERS'
0 - cast ( sum (kdm) as ml4h_kdm ) as kdm,
0 - cast ( sum (stval) as ml4h_altval ) - cast ( sum ( prd ) as ml4h_prd ) - cast ( sum (kdm) as ml4h_kdm ) as altval,
0 - cast ( sum (markup) as ml4h_markup ) as markup,
max( timestamp ) as timestamp
}
where kalnr = :P_kalnr and
curtp = :p_curtp and
jahrper between :p_jahrper_low and :p_jahrper_high and
( categ = 'VN' or ( categ = 'AB' and posart = 'ST' )) and
( runref = :p_runref or runref = '' ) and
( xabr = :p_xabr or xabr = '' ) and
timestamp <= :P_timestamp
group by kalnr, curtp, jahrper, categ, ptyp, bvalt, process, meins, waers
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"MLDOC"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload