I_CurrentEHSParentLocationID

DDL: I_CURRENTEHSPARENTLOCATIONID SQL: ILOCANDPARID Type: view COMPOSITE

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)

SourceAliasJoin Type
I_CurrentEHSLocationPath I_CurrentEHSLocationPath from
I_SAPClient I_SAPClient union

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_EHSLocationRoot _EHSLocationParentRoot $projection.EHSSuperiorLocationUUID = _EHSLocationParentRoot.EHSLocationUUID
[1..1] I_EHSLocationRoot _EHSLocationRoot $projection.EHSLocationUUID = _EHSLocationRoot.EHSLocationUUID

Annotations (11)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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