P_AssociatedTrdSecretProd is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_ChmlCmplncInfo) and exposes 10 fields. It has 1 association to related views.
@AbapCatalog:
{
-- SQL view name (16 characters)
sqlViewName: 'PAASTSUP',
--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_AssociatedTrdSecretProd
--Select data from basic view 'Chemical Compliance Information' (Logical key of composition)
asselectfrom I_ChmlCmplncInfo as ChemicalComplianceInfo
--Join data from composition
join P_AssociatedTrdSecret as Composition on ChemicalComplianceInfo.ChmlCmplncInfoUUID = Composition.ChmlCmplncInfoUUID
association [1..1] to P_CChmlCmplConstants as _Constants on _Constants.Constant1 = _Constants.Constant1
{
--UUID of chemical compliance information
key ChemicalComplianceInfo.ChmlCmplncInfoUUID,
--Composition Type
key Composition.ChmlCompositionType,
--Composition Type
key Composition.ProdCmplncLegalArea,
--UUID of chemical composition in process
Composition.ChmlCompositionInProcessUUID,
--Status In Process
Composition.ChmlCmpstnInProcStatus,
--Indicator: Is active entity of chemical composition with status In Process
Composition.ChmlCmpstnInProcIsActiveEntity,
--UUID of chemical composition released
Composition.ChmlCompositionReleasedUUID,
--Status Released
Composition.ChmlCmpstnReldStatus,
--Released by User
Composition.ReleasedByUser,
--Indicator: Is active entity of chemical composition with status In Process
Composition.ChmlCmpstnReldIsActiveEntity,
--Indicator: Released Composition Exists
cast ( case Composition.ChmlCmpstnReldStatus
when 'RE'
then _Constants[inner].ConstantTrue
else _Constants[inner].ConstantEmpty
endas ehfnd_cci_ccmps_has_released ) as ChmlCmpstnHasReldCmpstn,
--Navigation Link UUID
casewhen Composition.ChmlCmpstnInProcStatus = 'IP' then
Composition.ChmlCompositionInProcessUUID
when Composition.ChmlCmpstnReldStatus = 'RE' then
Composition.ChmlCompositionReleasedUUID
endas ChmlCmpstnNavgnLinkUUID,
--Active Indicator
casewhen Composition.ChmlCmpstnInProcStatus = 'IP'
then Composition.ChmlCmpstnInProcIsActiveEntity
when Composition.ChmlCmpstnReldStatus = 'RE'
then Composition.ChmlCmpstnReldIsActiveEntity
endas ChmlCmpstnIsActive
}
--Only for Unpackaged Product
where
ChmlCmplncInfoType = 'BU'
and(
MaterialIsSold = 'X'
or MaterialIsTransported = 'X'
or MaterialIsProduced = 'X'
or MaterialIsSourced = 'X'
)