P_ChmlCmplncInfoAssgdPCSfty is a Consumption CDS View that provides data about "Assoc. Safety-Related Property" in SAP S/4HANA. It reads from 2 data sources (I_PCPrptyRootType, I_ChmlCmplncInfo) and exposes 8 fields. It has 1 association to related views.
@EndUserText.label: 'Assoc. Safety-Related Property'
-- for Unpackaged Product
@AbapCatalog:
{
-- SQL view name (16 characters)
sqlViewName: 'PCCIASGDSFTY',
--If it's true, the filter conditions are compared and, if they match, the associated join expression is evaluated only once
compiler.compareFilter: true,
preserveKey: true
}
--Access Control: Authorizations Checks
@AccessControl:
{
authorizationCheck: #NOT_REQUIRED
}
--Client Handling of the view@ClientHandling.algorithm: #SESSION_VARIABLE
--VDM view type
@VDM.viewType: #CONSUMPTION@VDM.private: truedefineview P_ChmlCmplncInfoAssgdPCSfty
--Select data from basic view 'Chemical Compliance Information'
asselectfrom I_ChmlCmplncInfo as ChemicalComplianceInfo
innerjoin I_PCPrptyRootType as _PCPrptyRootType on _PCPrptyRootType.DomainValue = 'EHFNDD_SR'
--Join data from safety-related propertes with status In Process
leftouter to one join I_PCSftyProperty as SftyRelatedInProcess on ChemicalComplianceInfo.ChmlCmplncInfoUUID = SftyRelatedInProcess.ChmlCmplncInfoUUID
and SftyRelatedInProcess.PCPrptyProcgSts = 'IP'
--Join data from safety-related propertes with status Released
leftouter to one join I_PCSftyProperty as SftyRelatedReleased on ChemicalComplianceInfo.ChmlCmplncInfoUUID = SftyRelatedReleased.ChmlCmplncInfoUUID
and SftyRelatedReleased.PCPrptyProcgSts = 'RE'
--Dummy constant selection to solve issues withcase-statements with constants (notnull-preserving)
association [1..1] to P_CChmlCmplConstants as _Constants on _Constants.Constant1 = _Constants.Constant1
{
--UUID of chemical compliance information
key ChemicalComplianceInfo.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
--Property Type
key _PCPrptyRootType.PCPrptyRootType as PCPrptyRootType,
--UUID of in process version
SftyRelatedInProcess.PCSftyPrptyUUID as PCPrptyInProcessUUID,
--Status In Process
SftyRelatedInProcess.PCPrptyProcgSts as PCPrptyInProcProcgSts,
--Is Active entitycast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as PCPrptyInProcIsActive,
--UUID of released version
SftyRelatedReleased.PCSftyPrptyUUID as PCPrptyReleasedUUID,
--Status Released
SftyRelatedReleased.PCPrptyProcgSts as PCPrptyReldProcgSts,
--Released By User
SftyRelatedReleased.ReleasedByUser as ReleasedByUser,
--Is Active entitycast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as PCPrptyReldIsActive,
--Navigation Link UUID
casewhen SftyRelatedInProcess.PCPrptyProcgSts = 'IP' then
SftyRelatedInProcess.PCSftyPrptyUUID
when SftyRelatedReleased.PCPrptyProcgSts = 'RE' then
SftyRelatedReleased.PCSftyPrptyUUID
endas PCPrptyNavgnLinkUUID,
--Active Indicator
casewhen SftyRelatedInProcess.PCPrptyProcgSts = 'IP'
thencast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type )
when SftyRelatedReleased.PCPrptyProcgSts = 'RE'
thencast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type )
endas PCPrptyIsActive
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCINFO",
"I_PCPRPTYROOTTYPE",
"I_PCSFTYPROPERTY",
"P_CCHMLCMPLCONSTANTS"
],
"ASSOCIATED":
[
"P_CCHMLCMPLCONSTANTS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/