@AbapCatalog:
{
sqlViewName: 'PCCUSE',
compiler.compareFilter: true,
preserveKey: true
}@AccessControl:
{
authorizationCheck: #NOT_REQUIRED
}@ClientHandling.algorithm: #SESSION_VARIABLE@VDM.viewType: #CONSUMPTION@VDM.private: truedefineview P_ChmlCmplncUse
asselectfrom I_ChmlCmplncInfoTP as ChemicalComplianceInfo
crossjoin I_ProdCmplncLegalArea as ProdCmplncLegalArea
--Join data from Use with status In Process
leftouter to one join I_ProdCmplncUse as _ProdCmplncUseInProgress on ChemicalComplianceInfo.ChmlCmplncInfoUUID = _ProdCmplncUseInProgress.ChmlCmplncInfoUUID
and _ProdCmplncUseInProgress.ProdCmplncLegalArea = ProdCmplncLegalArea.ProdCmplncLegalArea
and _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP'
--Join data from Use with status Released
leftouter to one join I_ProdCmplncUse as _ProdCmplncUseReleased on ChemicalComplianceInfo.ChmlCmplncInfoUUID = _ProdCmplncUseReleased.ChmlCmplncInfoUUID
and _ProdCmplncUseReleased.ProdCmplncLegalArea = ProdCmplncLegalArea.ProdCmplncLegalArea
and _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE'
--Link to processing status
association [0..1] to I_PCPrptyProcgSts as _ProcessingStatus on $projection.ProdCmplncUseProcgSts = _ProcessingStatus.PCPrptyProcgSts
--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
association [0..1] to I_ProdCmplncLegalArea as _ProdCmplncLegalArea on $projection.ProdCmplncLegalArea = _ProdCmplncLegalArea.ProdCmplncLegalArea
{
@UI.hidden: truekey ChemicalComplianceInfo.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
keycast( coalesce( _ProdCmplncUseInProgress.ProdCmplncLegalArea, _ProdCmplncUseReleased.ProdCmplncLegalArea) as ehfnd_legal_area preserving type ) as ProdCmplncLegalArea,
--Navigation Link UUID
casewhen _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP' then
_ProdCmplncUseInProgress.ProdCmplncUseUUID
when _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE' then
_ProdCmplncUseReleased.ProdCmplncUseUUID
endas ProdCmplncUseUUID,
--Delete allowed?
casewhen _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP' then
_Constants.ConstantTrue
when _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE' then
_Constants.ConstantFalse
endas ProdCmplncUseDeleteIsAllwd,
--Release allowed?
casewhen _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP' then
_Constants.ConstantTrue
when _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE' then
_Constants.ConstantFalse
endas ProdCmplncUseReleaseIsAllwd,
--Processing Status
casewhen _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP'
and _ProdCmplncUseReleased.ProdCmplncUseProcgSts isnullthen
_Constants.ConstantInitialVersion
when _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP' then
_ProdCmplncUseInProgress.ProdCmplncUseProcgSts
when _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE' then
_ProdCmplncUseReleased.ProdCmplncUseProcgSts
endas ProdCmplncUseProcgSts,
--Criticality
casewhen _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP' then
_Constants.Constant2
when _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE' then
_Constants.Constant3
endas ProdCmplncUseProcgStsCritlty,
/* Associations */
_ProcessingStatus,
_ProdCmplncLegalArea
}
where
_ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP'
or _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE'