P_BasicDescForReldRglnScore is a Composite CDS View that provides data about "Basic Descr for Rel Reg Fallback Score" in SAP S/4HANA. It reads from 2 data sources (I_CmplRqRslt, I_CmplRqRsltDngrsGdsBscDescT) and exposes 6 fields with key fields ChmlCmplncInfoUUID, CmplRqRsltUUID, Language, LanguageEthen10else0endasFallbackScore. Part of development package EHDGM_CNS_UNPACKAGED_PRODUCT.
@AbapCatalog:{
sqlViewName: 'PDGBDSCFRRS',
compiler.compareFilter: true
}@AccessControl.authorizationCheck: #NOT_REQUIRED@ClientHandling.algorithm: #SESSION_VARIABLE@ObjectModel: {
usageType: {
serviceQuality: #C,
sizeCategory: #L,
dataClass: #MIXED
}
}
@VDM: {
private: true,
viewType: #COMPOSITE
}defineview P_BasicDescForReldRglnScore
asselectfrom I_CmplRqRslt
innerjoin I_CmplRqRsltDngrsGdsBscDescT on I_CmplRqRsltDngrsGdsBscDescT.CmplRqRsltUUID = I_CmplRqRslt.CmplRqRsltUUID
{
key I_CmplRqRslt.ChmlCmplncInfoUUID,
key I_CmplRqRslt.CmplRqRsltUUID,
key I_CmplRqRsltDngrsGdsBscDescT.Language,
keycase// Look for CRID UNRTDG in the logon language
when I_CmplRqRslt.ComplianceRequirement = 'UNRTDG' and I_CmplRqRsltDngrsGdsBscDescT.Language = $session.system_language
then 51
// Fallback same CRID but in English
when I_CmplRqRslt.ComplianceRequirement = 'UNRTDG' and I_CmplRqRsltDngrsGdsBscDescT.Language = 'E'
then 50
// Fallback same CRID but in English
when I_CmplRqRslt.ComplianceRequirement = 'IMDG-Code' and I_CmplRqRsltDngrsGdsBscDescT.Language = 'E'
then 40
// Fallback CRID ADR in the logon language
when I_CmplRqRslt.ComplianceRequirement = 'ADR' and I_CmplRqRsltDngrsGdsBscDescT.Language = $session.system_language
then 31
// Fallback same CRID but in English
when I_CmplRqRslt.ComplianceRequirement = 'ADR' and I_CmplRqRsltDngrsGdsBscDescT.Language = 'E'
then 30
// Fallback CRID 49 CFR in the logon language
when I_CmplRqRslt.ComplianceRequirement = '49 CFR' and I_CmplRqRsltDngrsGdsBscDescT.Language = $session.system_language
then 21
// Give all other English descriptions the value 10
when I_CmplRqRsltDngrsGdsBscDescT.Language = 'E'
then 10
// all others
else 0
endas FallbackScore,
I_CmplRqRslt.CmplRqVersUUID,
I_CmplRqRsltDngrsGdsBscDescT.DangerousGoodBasicDescription
}
where
I_CmplRqRslt.CmplRqRsltProcessingStatus = 'RE'
and I_CmplRqRsltDngrsGdsBscDescT.DangerousGoodBasicDescription <> ''
// This should not be necessary if we put a 10 to english descriptions per default: We wil filter out duplicate results in the I_UpaDaGdDescForReldRegulation either way
//// and Look for DG Basic Description on a released CRR for any (the first available) CRID in EN
//unionselectfrom I_CmplRqRsltDngrsGdsBscDescT
// innerjoin I_CmplRqRslt on I_CmplRqRsltDngrsGdsBscDescT.CmplRqRsltUUID = I_CmplRqRslt.CmplRqRsltUUID
// innerjoin P_BasicDescForReldRglnMaxCRR on I_CmplRqRsltDngrsGdsBscDescT.CmplRqRsltUUID = P_BasicDescForReldRglnMaxCRR.CmplRqRsltUUID
// and I_CmplRqRslt.ChmlCmplncInfoUUID = P_BasicDescForReldRglnMaxCRR.ChmlCmplncInfoUUID
//
//{
// key I_CmplRqRslt.ChmlCmplncInfoUUID,
// key I_CmplRqRslt.CmplRqRsltUUID,
//
// key 10 as FallbackScore,
//
// I_CmplRqRslt.CmplRqVersUUID,
// I_CmplRqRsltDngrsGdsBscDescT.Language,
// I_CmplRqRsltDngrsGdsBscDescT.DangerousGoodBasicDescription
//
//}
//where// I_CmplRqRsltDngrsGdsBscDescT.Language = 'E'