@ClientHandling.algorithm: #SESSION_VARIABLE //Inserted by VDM CDS Suite Plugin
@AbapCatalog.sqlViewName: 'EHENVV_MAMN'
//Commented by VDM CDS Suite Plugin:@ClientDependent: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Measurement Amounts'
//CDS View Performance annotation
@ObjectModel.usageType:{ serviceQuality: #P, // < 15 msec
sizeCategory: #L, // < 10.000.000
dataClass: #MIXED }
define view Ehenv_Mdef_Amns with parameters p_def_langu : lang,
p_sy_datlo : syst_datlo,
p_sy_langu : lang
// IMPORTANT: ensure that parameters are alphabetically sorted in order for the View to work on HANA prior to SP10
as select from Ehenv_Amns_Ext( p_langu:$parameters.p_def_langu,
p_sourcetype:'02' )
inner join ehenvd_scen_root as Scen_root
on Scen_root.valid_from <= $parameters.p_sy_datlo
inner join ehenvd_scen_meas as Scen_mdef on
Scen_mdef.parent_key = Scen_root.db_key and
Scen_mdef.is_owned_indicator = 'X'
inner join ehenvd_mdef_root as Mdef_root on
Mdef_root.db_key = Scen_mdef.mdef_root_key_ref
// inner join to current location revision
inner join Ehfnd_Loc_Curr_Rev_All( p_def_langu: $parameters.p_def_langu,
p_sy_datlo: $parameters.p_sy_datlo,
p_sy_langu: $parameters.p_sy_langu )
on Ehfnd_Loc_Curr_Rev_All.loc_key = Scen_root.loc_root_key_ref
{
//Location Revision Fields
Ehfnd_Loc_Curr_Rev_All.name as location_text,
Ehfnd_Loc_Curr_Rev_All.auth_group as loc_auth_group,
Ehfnd_Loc_Curr_Rev_All.plant_id,
Ehfnd_Loc_Curr_Rev_All.cost_center,
Ehfnd_Loc_Curr_Rev_All.company_code,
Ehfnd_Loc_Curr_Rev_All.buss_area,
Ehfnd_Loc_Curr_Rev_All.type,
Ehfnd_Loc_Curr_Rev_All.country,
Ehfnd_Loc_Curr_Rev_All.region,
Ehfnd_Loc_Curr_Rev_All.status as loc_status,
//Amount fields
Ehenv_Amns_Ext.amount_key as amount_key,
Ehenv_Amns_Ext.status as amount_status,
case
when Ehenv_Amns_Ext.fault_ind = 'X' then '~Icon/ErrorMessage'
when Ehenv_Amns_Ext.missing_ind = 'X' then '~Icon/ObjectOutdated'
when Ehenv_Amns_Ext.warning_ind = 'X' then '~Icon/WarningMessage'
when Ehenv_Amns_Ext.notavailable_ind = 'X' then '~Icon/InactiveLed'
end as issue_type_icon,
case
when Ehenv_Amns_Ext.fault_ind = 'X' then '02'
when Ehenv_Amns_Ext.missing_ind = 'X' then '04'
when Ehenv_Amns_Ext.warning_ind = 'X' then '03'
when Ehenv_Amns_Ext.notavailable_ind = 'X' then '05'
else '06'
end as issue_type,
Ehenv_Amns_Ext.sourcetype as sourcetype,
Ehenv_Amns_Ext.external_src as external_src,
Ehenv_Amns_Ext.deviation_id as deviation_id,
Ehenv_Amns_Ext.preliminary_ind as preliminary_ind,
Ehenv_Amns_Ext.value as value,
Ehenv_Amns_Ext.unit_text as unit_text,
Ehenv_Amns_Ext.value_date,
Ehenv_Amns_Ext.value_month_txt as value_month_txt,
Ehenv_Amns_Ext.valuetimestamp as valuetimestamp,
Mdef_root.title as data_title,
Mdef_root.mdef_period as data_period
}
where Ehenv_Amns_Ext.source_root_key_ref = Mdef_root.db_key
and Ehenv_Amns_Ext.value_date <= $parameters.p_sy_datlo
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"EHENV_AMNS_EXT",
"EHFND_LOC_CURR_REV_ALL",
"EHENVD_MDEF_ROOT",
"EHENVD_SCEN_MEAS",
"EHENVD_SCEN_ROOT"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/