P_SubstanceAssgdPCPhys is a Consumption CDS View that provides data about "Assoc. Physical Chemical Property" in SAP S/4HANA. It reads from 1 data source (I_Substance) and exposes 7 fields. It has 1 association to related views.
@EndUserText.label: 'Assoc. Physical Chemical Property'
-- for Substance
@AbapCatalog:
{
-- SQL view name (16 characters)
sqlViewName: 'PSUBASGDPHYS',
--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_SubstanceAssgdPCPhys
--Select data from basic view 'Chemical Compliance Information'
asselectfrom I_Substance as Substance
--Join data from physical chemical propertes with status In Process
leftouter to one join I_PhysicalChemicalProperty as PhysicalChemicalInProcess on Substance.SubstanceUUID = PhysicalChemicalInProcess.SubstanceUUID
and PhysicalChemicalInProcess.PCPrptyProcgSts = 'IP'
--Join data from physical chemical propertes with status Released
leftouter to one join I_PhysicalChemicalProperty as PhysicalChemicalReleased on Substance.SubstanceUUID = PhysicalChemicalReleased.SubstanceUUID
and PhysicalChemicalReleased.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 substance
key Substance.SubstanceUUID as SubstanceUUID,
--Property Type
keycast('EHFNDD_PHYSCHEM' as ehfnd_prop_property_root ) as PCPrptyRootType,
--UUID of in process version
PhysicalChemicalInProcess.PhysChmlPrptyUUID as PCPrptyInProcessUUID,
--Status In Process
PhysicalChemicalInProcess.PCPrptyProcgSts as PCPrptyInProcProcgSts,
--Is Active entitycast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as PCPrptyInProcIsActive,
--UUID of released version
PhysicalChemicalReleased.PhysChmlPrptyUUID as PCPrptyReleasedUUID,
--Status Released
PhysicalChemicalReleased.PCPrptyProcgSts as PCPrptyReldProcgSts,
--Is Active entitycast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as PCPrptyReldIsActive,
Substance.ResponsibleUnit as ResponsibleUnit,
--Navigation Link UUID
casewhen PhysicalChemicalInProcess.PCPrptyProcgSts = 'IP' then
PhysicalChemicalInProcess.PhysChmlPrptyUUID
when PhysicalChemicalReleased.PCPrptyProcgSts = 'RE' then
PhysicalChemicalReleased.PhysChmlPrptyUUID
else
_Constants.ConstantEmptyRaw16
endas PCPrptyNavgnLinkUUID,
--Active Indicator
casewhen PhysicalChemicalInProcess.PCPrptyProcgSts = 'IP'
thencast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type )
when PhysicalChemicalReleased.PCPrptyProcgSts = 'RE'
thencast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type )
else
_Constants.ConstantFalse
endas PCPrptyIsActive
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PHYSICALCHEMICALPROPERTY",
"I_SUBSTANCE",
"P_CCHMLCMPLCONSTANTS"
],
"ASSOCIATED":
[
"P_CCHMLCMPLCONSTANTS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/