Ehenv_Mdef_Amns

DDL: EHENV_MDEF_AMNS SQL: EHENVV_MAMN Type: view

Measurement Amounts

Ehenv_Mdef_Amns is a CDS View that provides data about "Measurement Amounts" in SAP S/4HANA. It reads from 5 data sources (Ehenv_Amns_Ext, Ehfnd_Loc_Curr_Rev_All, ehenvd_mdef_root, ehenvd_scen_meas, ehenvd_scen_root) and exposes 17 fields.

Data Sources (5)

SourceAliasJoin Type
Ehenv_Amns_Ext Ehenv_Amns_Ext from
Ehfnd_Loc_Curr_Rev_All Ehfnd_Loc_Curr_Rev_All inner
ehenvd_mdef_root Mdef_root inner
ehenvd_scen_meas Scen_mdef inner
ehenvd_scen_root Scen_root inner

Parameters (3)

NameTypeDefault
p_def_langu lang
p_sy_datlo syst_datlo
p_sy_langu lang

Annotations (8)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.sqlViewName EHENVV_MAMN view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Measurement Amounts view
ObjectModel.usageType.serviceQuality #P view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #MIXED view

Fields (17)

KeyFieldSource TableSource FieldDescription
plant_id Ehfnd_Loc_Curr_Rev_All plant_id
cost_center Ehfnd_Loc_Curr_Rev_All cost_center
company_code Ehfnd_Loc_Curr_Rev_All company_code
buss_area Ehfnd_Loc_Curr_Rev_All buss_area
type Ehfnd_Loc_Curr_Rev_All type
country Ehfnd_Loc_Curr_Rev_All country
region Ehfnd_Loc_Curr_Rev_All region
loc_status Ehfnd_Loc_Curr_Rev_All status
amount_key Ehenv_Amns_Ext amount_key
sourcetype Ehenv_Amns_Ext sourcetype
external_src Ehenv_Amns_Ext external_src
deviation_id Ehenv_Amns_Ext deviation_id
value Ehenv_Amns_Ext value
unit_text Ehenv_Amns_Ext unit_text
value_date Ehenv_Amns_Ext value_date
data_title ehenvd_mdef_root title
data_period ehenvd_mdef_root mdef_period
@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":""
}
}*/