P_AssociatedSubstLglCmpstn is a Consumption CDS View that provides data about "Assoc. Legal Compositon In Process and Released" in SAP S/4HANA. It reads from 1 data source (I_ChmlComposition) and exposes 8 fields with key field ProdCmplncLegalArea. It has 1 association to related views. Part of development package EHFND_CNS_CCI.
@EndUserText.label: 'Assoc. Legal Compositon In Process and Released'
@AbapCatalog:
{
-- SQL view name (16 characters)
sqlViewName: 'PAASLCMPS',
--If it's true, the filter conditions are compared and, if they match, the associated join expression is evaluated only once
compiler.compareFilter: 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_AssociatedSubstLglCmpstn
--Select data from basic view 'Composition'
asselectfrom I_ChmlComposition as Composition
--Join data from composition with status In Process => Active or draft composition
leftouter to one join P_AssociatedSubstLglProcCmpstn as CompositionInProcess on Composition.ChmlCmplncInfoUUID = CompositionInProcess.ChmlCmplncInfoUUID
and Composition.ChmlCompositionType = CompositionInProcess.ChmlCompositionType
--Join data from composition with status Released => only active chemical composition, because released composition isnot editable
leftouter to one join P_AssociatedSubstLglReldCmpstn as CompositionReleased on Composition.ChmlCmplncInfoUUID = CompositionReleased.ChmlCmplncInfoUUID
and Composition.ChmlCompositionType = CompositionReleased.ChmlCompositionType
/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] }*/association [1..1] to P_CChmlCmplConstants as _Constants on _Constants.Constant1 = _Constants.Constant1
{
--UUID of chemical compliance information
key Composition.ChmlCmplncInfoUUID,
--Composition Type
key Composition.ChmlCompositionType,
key Composition.ProdCmplncLegalArea,
--UUID of chemical composition in process
CompositionInProcess.ChmlCompositionInProcessUUID,
--Status In Process
casewhen CompositionInProcess.ChmlCmpstnInProcStatus = 'IP'
then CompositionInProcess.ChmlCmpstnInProcStatus
when CompositionInProcess.ChmlCmpstnInProcStatus = ''
or CompositionInProcess.ChmlCmpstnInProcStatus isnull
--Set NE if the In Process Version isnot existing
then _Constants[inner].ConstantNotExisting
endas ChmlCmpstnInProcStatus,
--Indicator: Is active entity of chemical composition with status In Process
CompositionInProcess.ChmlCmpstnInProcIsActiveEntity,
--UUID of chemical composition released
CompositionReleased.ChmlCompositionReleasedUUID,
--Status Released
casewhen CompositionReleased.ChmlCmpstnReldStatus = 'RE'
then CompositionReleased.ChmlCmpstnReldStatus
when CompositionReleased.ChmlCmpstnReldStatus = ''
or CompositionReleased.ChmlCmpstnReldStatus isnull
--Set NE if the Released Version isnot existing
then _Constants[inner].ConstantNotExisting
endas ChmlCmpstnReldStatus,
--Released by User
CompositionReleased.ReleasedByUser,
--Indicator: Is active entity of chemical composition with status In Process
CompositionReleased.ChmlCmpstnReldIsActiveEntity
}
where
--Only for Released andIn Process Compositions
// Check for ChmlCompositionCategory = 'A' leads to temporary materialization of this view// Condition: ChmlCompositionType <> 'ANALYTIC1' and ChmlCompositionType <> 'MATLBSD1' does not lead to materialization.
// Composition._CompositionType.ChmlCompositionCategory = 'A'
// and Composition.ChmlCompositionType <> 'ANALYTIC1'
(
Composition.ChmlCompositionType <> 'ANALYTIC1'
and Composition.ChmlCompositionType <> 'MATLBSD1'
and Composition.ChmlCompositionType <> 'MATLBSD2'
and Composition.ChmlCompositionType <> 'MCPC'
and Composition.ChmlCompositionType <> 'TS'
and Composition.ChmlCompositionType <> 'POLYMER'
)
and(
Composition.ChmlCompositionStatus = 'IP'
or Composition.ChmlCompositionStatus = 'RE'
)
groupby
Composition.ChmlCmplncInfoUUID,
Composition.ChmlCompositionType,
Composition.ProdCmplncLegalArea,
CompositionInProcess.ChmlCompositionInProcessUUID,
CompositionInProcess.ChmlCmpstnInProcStatus,
CompositionInProcess.ChmlCmpstnInProcIsActiveEntity,
CompositionReleased.ChmlCompositionReleasedUUID,
CompositionReleased.ChmlCmpstnReldStatus,
CompositionReleased.ReleasedByUser,
CompositionReleased.ChmlCmpstnReldIsActiveEntity,
_Constants[inner].ConstantNotExisting