I_CurrentEHSParentLocation
Current EHS Parent Location
I_CurrentEHSParentLocation is a Composite CDS View that provides data about "Current EHS Parent Location" in SAP S/4HANA. It reads from 2 data sources (I_EHSLocationHierarchyRevision, I_EHSLocHierarchyPath) and exposes 4 fields with key fields EHSLocationUUID, EHSParentLocationUUID. It has 2 associations to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_EHSLocationHierarchyRevision | I_EHSLocationHierarchyRevision | inner |
| I_EHSLocHierarchyPath | I_EHSLocHierarchyPath | from |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..*] | I_EHSLocation | _EHSLocation | $projection.EHSParentLocationUUID = _EHSLocation.EHSLocationUUID |
| [1..1] | P_EHSLocationHierarchyLevel | _EHSLocationHierarchyLevel | I_EHSLocationHierarchyRevision.EHSLocHierarchyRevisionUUID = _EHSLocationHierarchyLevel .EHSLocHierarchyRevisionUUID and $projection.EHSParentLocationUUID = _EHSLocationHierarchyLevel .EHSLocationUUID |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | ICURREHSPARLOC | view | |
| AbapCatalog.preserveKey | true | view | |
| EndUserText.label | Current EHS Parent Location | 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 | #L | view | |
| ObjectModel.usageType.dataClass | #MASTER | view |
Fields (4)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | EHSLocationUUID | I_EHSLocHierarchyPath | EHSLocationUUID | |
| KEY | EHSParentLocationUUID | I_EHSLocHierarchyPath | EHSParentLocationUUID | |
| _EHSLocation | _EHSLocation | |||
| EHSLocationHierarchyLevel | _EHSLocationHierarchyLevel | EHSLocationHierarchyLevel |
@AbapCatalog:{
sqlViewName: 'ICURREHSPARLOC',
preserveKey:true
}
@EndUserText.label: 'Current EHS Parent Location'
@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: #L, // < 10.000.000
dataClass: #MASTER }
}
// This returns all parent locations within the current hierarchy
define view I_CurrentEHSParentLocation
as select from I_EHSLocHierarchyPath
// get the current revision of the location hierarchy
inner join I_EHSLocationHierarchyRevision on I_EHSLocationHierarchyRevision.RevisionStartDate <= $session.system_date
and I_EHSLocationHierarchyRevision.RevisionEndDate >= $session.system_date
and I_EHSLocationHierarchyRevision.EHSLocHierarchyRevisionUUID = I_EHSLocHierarchyPath.EHSLocHierarchyRevisionUUID
association [1..*] to I_EHSLocation as _EHSLocation on $projection.EHSParentLocationUUID = _EHSLocation.EHSLocationUUID
association [1..1] to P_EHSLocationHierarchyLevel as _EHSLocationHierarchyLevel on I_EHSLocationHierarchyRevision.EHSLocHierarchyRevisionUUID = _EHSLocationHierarchyLevel .EHSLocHierarchyRevisionUUID
and $projection.EHSParentLocationUUID = _EHSLocationHierarchyLevel .EHSLocationUUID
{
key I_EHSLocHierarchyPath.EHSLocationUUID,
@ObjectModel.foreignKey.association: '_EHSLocation'
key I_EHSLocHierarchyPath.EHSParentLocationUUID,
_EHSLocation,
_EHSLocationHierarchyLevel.EHSLocationHierarchyLevel
}
where
I_EHSLocHierarchyPath.EHSParentLocationUUID <> hextobin( '00000000000000000000000000000000' )
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EHSLOCATIONHIERARCHYREVISION",
"I_EHSLOCHIERARCHYPATH",
"P_EHSLOCATIONHIERARCHYLEVEL"
],
"ASSOCIATED":
[
"I_EHSLOCATION",
"P_EHSLOCATIONHIERARCHYLEVEL"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA