I_EHSLocNameFallbackLanguage

DDL: I_EHSLOCNAMEFALLBACKLANGUAGE Type: view_entity COMPOSITE

Location name with a fallback language

I_EHSLocNameFallbackLanguage is a Composite CDS View that provides data about "Location name with a fallback language" in SAP S/4HANA. It reads from 1 data source (I_EHSLocationRoot) and exposes 2 fields with key field EHSLocationUUID.

Data Sources (1)

SourceAliasJoin Type
I_EHSLocationRoot I_EHSLocationRoot from

Annotations (6)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Location name with a fallback language view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #MASTER view
VDM.viewType #COMPOSITE view

Fields (2)

KeyFieldSource TableSource FieldDescription
KEY EHSLocationUUID EHSLocationUUID
EHSLocationNameendasEHSLocationName
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Location name with a fallback language'
@ObjectModel.usageType:{
  serviceQuality: #C,
  sizeCategory: #L,
  dataClass: #MASTER
}

@VDM.viewType: #COMPOSITE
define view entity I_EHSLocNameFallbackLanguage
  as select from I_EHSLocationRoot
{
  key EHSLocationUUID,
      min( distinct case
      // Try to return a name in the user's system language.

        when _EHSLocNameCurrentRevision[ 1:Language = $session.system_language ].EHSLocationName is not null
          then _EHSLocNameCurrentRevision[ 1:Language = $session.system_language ].EHSLocationName
      // If it doesn't exist, try to return one in English.

        when _EHSLocNameCurrentRevision[ 1:Language = 'E' ].EHSLocationName is not null
          then _EHSLocNameCurrentRevision[ 1:Language = 'E' ].EHSLocationName
      // And if neither of them exist, return the first found in any other language.

        else _EHSLocNameCurrentRevision[ 1:Language is not null ].EHSLocationName
      end ) as EHSLocationName
}
group by
  EHSLocationUUID