I_CurrentEHSParentLocationID
Current EHS Location and Parent ID
I_CurrentEHSParentLocationID is a Composite CDS View that provides data about "Current EHS Location and Parent ID" in SAP S/4HANA. It reads from 2 data sources (I_CurrentEHSLocationPath, I_SAPClient) and exposes 4 fields with key fields EHSLocationUUID, EHSSuperiorLocationUUID, EHSSuperiorLocationUUID. It has 2 associations to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_CurrentEHSLocationPath | I_CurrentEHSLocationPath | from |
| I_SAPClient | I_SAPClient | union |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_EHSLocationRoot | _EHSLocationParentRoot | $projection.EHSSuperiorLocationUUID = _EHSLocationParentRoot.EHSLocationUUID |
| [1..1] | I_EHSLocationRoot | _EHSLocationRoot | $projection.EHSLocationUUID = _EHSLocationRoot.EHSLocationUUID |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| EndUserText.label | Current EHS Location and Parent ID | view | |
| VDM.viewType | #COMPOSITE | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| AbapCatalog.sqlViewName | ILOCANDPARID | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #M | view | |
| ObjectModel.usageType.dataClass | #MASTER | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (4)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | EHSLocationUUID | EHSLocationUUID | ||
| KEY | EHSSuperiorLocationUUID | EHSSuperiorLocationUUID | ||
| KEY | EHSSuperiorLocationUUID | |||
| EHSLocationID |
@EndUserText.label: 'Current EHS Location and Parent ID'
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AbapCatalog.sqlViewName: 'ILOCANDPARID'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true
// Client handling by session
@ClientHandling.algorithm: #SESSION_VARIABLE
// used for BOBF Master Data Object
@ObjectModel.usageType:{ serviceQuality: #C, // < 15 msec
sizeCategory: #M, // < 100.000
dataClass: #MASTER }
@Metadata.ignorePropagatedAnnotations:true
@ObjectModel.supportedCapabilities: [ 'SQL_DATA_SOURCE' ]
define view I_CurrentEHSParentLocationID
as select from I_CurrentEHSLocationPath
association [0..1] to I_EHSLocationRoot as _EHSLocationParentRoot on $projection.EHSSuperiorLocationUUID = _EHSLocationParentRoot.EHSLocationUUID
association [1..1] to I_EHSLocationRoot as _EHSLocationRoot on $projection.EHSLocationUUID = _EHSLocationRoot.EHSLocationUUID
{
key EHSLocationUUID,
key EHSSuperiorLocationUUID,
case
when _EHSLocationParentRoot.EHSLocationID is not null then _EHSLocationParentRoot.EHSLocationID
when _EHSLocationRoot.EHSLocationID is not null then _EHSLocationRoot.EHSLocationID
end as EHSLocationID
}
union select from I_SAPClient // this generates a dummy empty location -> it is in case when Location ID is space in the authorization object
{
key cast( hextobin( '00000000000000000000000000000000' ) as ehfnd_location_uuid_ref preserving type ) as EHSLocationUUID,
key cast( hextobin( '00000000000000000000000000000000' ) as ehfnd_location_uuid_ref preserving type ) as EHSSuperiorLocationUUID,
'' as EHSLocationID
}
where
I_SAPClient.sapclient = $session.client
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