I_CurrentEHSLocationHierarchy

DDL: I_CURRENTEHSLOCATIONHIERARCHY Type: view COMPOSITE

Current EHS Location Structure Hierarchy

I_CurrentEHSLocationHierarchy is a Composite CDS View that provides data about "Current EHS Location Structure Hierarchy" in SAP S/4HANA. It reads from 2 data sources (I_EHSLocationHierarchyNode, I_EHSLocationHierarchyRevision) and exposes 3 fields with key field EHSLocationUUID. It has 1 association to related views.

Data Sources (2)

SourceAliasJoin Type
I_EHSLocationHierarchyNode I_EHSLocationHierarchyNode from
I_EHSLocationHierarchyRevision I_EHSLocationHierarchyRevision inner

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_EHSLocation _EHSLocation $projection.EHSLocationUUID = _EHSLocation.EHSLocationUUID and _EHSLocation.RevisionStartDate <= $session.system_date and _EHSLocation.RevisionEndDate >= $session.system_date

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName ICUREHSLOCHIER view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
EndUserText.label Current EHS Location Structure Hierarchy view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.representativeKey EHSLocationUUID view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #M view
ObjectModel.usageType.dataClass #MASTER view

Fields (3)

KeyFieldSource TableSource FieldDescription
KEY EHSLocationUUID EHSLocationUUID
EHSParentLocationUUID EHSParentLocationUUID
EHSLocationStatus _EHSLocation EHSLocationStatus
@AbapCatalog:{
    sqlViewName: 'ICUREHSLOCHIER',
    compiler.compareFilter: true,
    preserveKey:true 
}
@EndUserText.label: 'Current EHS Location Structure Hierarchy'
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #NOT_REQUIRED
// Client handling by session 

@ClientHandling.algorithm: #SESSION_VARIABLE

// used for BOBF Master Data Object

@ObjectModel:{
            representativeKey: 'EHSLocationUUID',
            usageType:{ serviceQuality: #C,        // < 15 msec   

                                     sizeCategory:  #M,         // < 100.000

                                     dataClass: #MASTER } 
}

define view I_CurrentEHSLocationHierarchy 
  as select from I_EHSLocationHierarchyNode

  // get the current revision of the location structure

  inner join I_EHSLocationHierarchyRevision on  I_EHSLocationHierarchyRevision.RevisionStartDate          <= $session.system_date
                                            and I_EHSLocationHierarchyRevision.RevisionEndDate            >= $session.system_date
                                            and I_EHSLocationHierarchyRevision.EHSLocHierarchyRevisionUUID = I_EHSLocationHierarchyNode.EHSLocHierarchyRevisionUUID
                                                
/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ]  } */
  association [1..1] to I_EHSLocation as _EHSLocation on $projection.EHSLocationUUID = _EHSLocation.EHSLocationUUID 
    and _EHSLocation.RevisionStartDate <= $session.system_date and _EHSLocation.RevisionEndDate >= $session.system_date

{
  key EHSLocationUUID,
  EHSParentLocationUUID,
  _EHSLocation.EHSLocationStatus
}
// Remark: This where condition was moved from the parent view C_ChildEHSLocForIdentifyRisks to support the counting view

// P_ChildEHSLocationCount to not count historic or new locations

where _EHSLocation.EHSLocationStatus = '02' 
   or _EHSLocation.EHSLocationStatus = '03' // Consider Active and Inactive Locations only

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EHSLOCATION",
"I_EHSLOCATIONHIERARCHYNODE",
"I_EHSLOCATIONHIERARCHYREVISION"
],
"ASSOCIATED":
[
"I_EHSLOCATION"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/