I_LOCATIONDESCFALLBACKLANG
Location Description Fallback
I_LOCATIONDESCFALLBACKLANG is a CDS View in S/4HANA. Location Description Fallback. 1 CDS views read from this table.
CDS Views using this table (1)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| I_EHSCmplncAnlysLocTypeTaskC | view | left_outer | COMPOSITE | Compl Analysis Cube of Tasks by Loc type |
@EndUserText.label: 'Location Description Fallback'
@VDM.viewType: #COMPOSITE
@ObjectModel.representativeKey: 'EHSLocationUUID'
// Begin Correction 3410675 07.12.2023 ************************************
@AccessControl: {
authorizationCheck: #CHECK,
privilegedAssociations: [ '_LocationNameText' ]
}
// End Correction 3410675 07.12.2023 **************************************
@AbapCatalog.sqlViewName: 'EHSLOCDESC'
@AbapCatalog.compiler.compareFilter: true
// Begin Correction 3410675 07.12.2023 ************************************
// code removed
// End Correction 3410675 07.12.2023 **************************************
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #M, dataClass: #MASTER}
define view I_LocationDescFallbackLang
as select from I_EHSLocationRevision
// the assosiaction is needed for the Free Text Search for Location
// As we have different description in the system we have to make sure
// that we will show the same results when searching by free text with the same
// results that we see in the table
// before this assosiation we had direct _text[1: Language = system_language].ehslocation name but it happened, for example
// we see a location with description "test in German"(the description in the system is in DE) and if we are logged with English and we try to search for it
// it cannot be found
// Begin Correction 3410675 07.12.2023 ************************************
association [0..1] to I_EHSLocationNameDistinct as _LocationNameText on $projection.EHSLocationRevisionUUID = _LocationNameText.EHSLocationRevisionUUID
and $projection.EHSLocationUUID = _LocationNameText.EHSLocationUUID
and $projection.EHSLocationName = _LocationNameText.EHSLocationName
// End Correction 3410675 07.12.2023 **************************************
{
key I_EHSLocationRevision.EHSLocationUUID,
I_EHSLocationRevision.EHSLocationRevisionUUID,
// This field is shown in the table As location
// first try to take the description in the system languange; if not found, try to take in english
// if again not found, try to take any description
min(distinct case
when _EHSLocationRevisionName[ 1: Language = $session.system_language].EHSLocationName is not null
then _EHSLocationRevisionName[1: Language = $session.system_language].EHSLocationName
when _EHSLocationRevisionName[1: Language = 'E'].EHSLocationName is not null
then _EHSLocationRevisionName[1: Language = 'E'].EHSLocationName
else _EHSLocationRevisionName[1: Language is not null].EHSLocationName
end ) as EHSLocationName,
EHSLocationType,
EHSLocationStatus,
EHSLocationAuthorizationGroup,
Plant,
CostCenter,
CompanyCode,
BusinessArea,
/* Associations */
_LocationNameText
}
where
RevisionStartDate <= $session.system_date
and RevisionEndDate >= $session.system_date
group by
EHSLocationRevisionUUID,
EHSLocationUUID,
EHSLocationType,
EHSLocationStatus,
EHSLocationAuthorizationGroup,
Plant,
CostCenter,
CompanyCode,
BusinessArea