P_ChmlAnalyticComposition is a Consumption CDS View that provides data about "Chemical Analytical Composition" in SAP S/4HANA. It reads from 1 data source (I_ChmlCmplncInfo) and exposes 3 fields. It has 2 associations to related views. Part of development package EHFND_BO_CCI.
--Chemical Analytical Composition
@AbapCatalog:
{
-- SQL view name (16 characters)
sqlViewName: 'PCCANCMPSTN',
--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_ChmlAnalyticComposition
--Select data from basic view 'Chemical Compliance Information'
asselectfrom I_ChmlCmplncInfo as ChemicalComplianceInfo
--Join data from analytical composition with status In Process => only active chemical composition
leftouter to one join I_ChmlComposition as AnalyticCompositionInProcess on ChemicalComplianceInfo.ChmlCmplncInfoUUID = AnalyticCompositionInProcess.ChmlCmplncInfoUUID
and AnalyticCompositionInProcess.ChmlCompositionType = 'ANALYTIC1'
and AnalyticCompositionInProcess.ChmlCompositionStatus = 'IP'
--Join data from analytical composition with status Released => only active chemical composition, because released composition isnot editable
leftouter to one join I_ChmlComposition as AnalyticCompositionReleased on ChemicalComplianceInfo.ChmlCmplncInfoUUID = AnalyticCompositionReleased.ChmlCmplncInfoUUID
and AnalyticCompositionReleased.ChmlCompositionType = 'ANALYTIC1'
and AnalyticCompositionReleased.ChmlCompositionStatus = 'RE'
association [0..1] to I_ChmlCompositionStsActnText as _StatusDetailText on _StatusDetailText.ChmlCompositionStatus = 'NE'
and _StatusDetailText.Language = $session.system_language
association [1..1] to P_CChmlCmplConstants as _Constants on _Constants.ConstantNotExisting = _Constants.ConstantNotExisting
{
--UUID of chemical compliance information
key ChemicalComplianceInfo.ChmlCmplncInfoUUID,
--UUID of chemical composition in process
AnalyticCompositionInProcess.ChmlCompositionUUID as ChmlCompositionInProcessUUID,
--Change date of composition in status In Process
cast( AnalyticCompositionInProcess.LastChangeUTCDateTime as ehfnd_cci_processed_ts ) as LastChangeUTCDateTime,
--Status In Process
casewhen AnalyticCompositionInProcess.ChmlCompositionStatus = 'IP'
then AnalyticCompositionInProcess.ChmlCompositionStatus
else
_Constants[inner].ConstantNotExisting
endas ChmlCmpstnInProcStatus,
--Action Name
casewhen AnalyticCompositionInProcess.ChmlCompositionStatus = 'IP'
then AnalyticCompositionInProcess._CompositionStatus._DetailText[1: Language = $session.system_language ].ChmlCompositionStatusName
else
_StatusDetailText.ChmlCompositionStatusName
endas ChmlCmpstnInProcActionName,
--Indicator: Is active entity of chemical composition with status In Process
cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as ChmlCmpstnInProcIsActiveEntity,
--UUID of chemical composition released
AnalyticCompositionReleased.ChmlCompositionUUID as ChmlCompositionReleasedUUID,
--Release date of composition is status Released
AnalyticCompositionReleased.ValidityStartDateTime as ReleaseDateTime,
--Status Released
casewhen AnalyticCompositionReleased.ChmlCompositionStatus = 'RE'
then AnalyticCompositionReleased.ChmlCompositionStatus
else
_Constants[inner].ConstantNotExisting
endas ChmlCmpstnReldStatus,
casewhen AnalyticCompositionReleased.ChmlCompositionStatus = 'RE'
then AnalyticCompositionReleased._CompositionStatus._DetailText[1: Language = $session.system_language ].ChmlCompositionStatusName
else
_StatusDetailText.ChmlCompositionStatusName
endas ChmlCmpstnReldActionName,
--Indicator: Is active entity of chemical composition with status In Process
cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as ChmlCmpstnReldIsActiveEntity,
_Constants
}