P_ChmlCmplncUse

DDL: P_CHMLCMPLNCUSE Type: view CONSUMPTION Package: EHFND_CNS_CCI

Chemical Compliance Use

P_ChmlCmplncUse is a Consumption CDS View that provides data about "Chemical Compliance Use" in SAP S/4HANA. It reads from 2 data sources (I_ChmlCmplncInfoTP, I_ProdCmplncLegalArea) and exposes 5 fields with key fields ChmlCmplncInfoUUID, ProdCmplncLegalArea. It has 3 associations to related views. Part of development package EHFND_CNS_CCI.

Data Sources (2)

SourceAliasJoin Type
I_ChmlCmplncInfoTP ChemicalComplianceInfo from
I_ProdCmplncLegalArea ProdCmplncLegalArea cross

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_PCPrptyProcgSts _ProcessingStatus $projection.ProdCmplncUseProcgSts = _ProcessingStatus.PCPrptyProcgSts --Dummy constant selection to solve issues with case-statements with constants (not null-preserving)
[1..1] P_CChmlCmplConstants _Constants _Constants.Constant1 = _Constants.Constant1
[0..1] I_ProdCmplncLegalArea _ProdCmplncLegalArea $projection.ProdCmplncLegalArea = _ProdCmplncLegalArea.ProdCmplncLegalArea

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PCCUSE view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
VDM.private true view

Fields (5)

KeyFieldSource TableSource FieldDescription
KEY ChmlCmplncInfoUUID I_ChmlCmplncInfoTP ChmlCmplncInfoUUID
KEY ProdCmplncLegalArea
ProdCmplncUseUUIDendasProdCmplncUseUUID
_ProcessingStatus _ProcessingStatus
_ProdCmplncLegalArea _ProdCmplncLegalArea
@AbapCatalog:
{
  sqlViewName: 'PCCUSE',
  compiler.compareFilter: true,
  preserveKey: true
}

@AccessControl:
{
  authorizationCheck: #NOT_REQUIRED
}

@ClientHandling.algorithm: #SESSION_VARIABLE

@VDM.viewType: #CONSUMPTION
@VDM.private: true

define view P_ChmlCmplncUse
  as select from           I_ChmlCmplncInfoTP    as ChemicalComplianceInfo

    cross join             I_ProdCmplncLegalArea as ProdCmplncLegalArea

  --Join data from Use with status In Process
    left outer 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
    left outer 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 with case-statements with constants (not null-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: true
  key ChemicalComplianceInfo.ChmlCmplncInfoUUID                                                                                                       as ChmlCmplncInfoUUID,

  key cast( coalesce( _ProdCmplncUseInProgress.ProdCmplncLegalArea, _ProdCmplncUseReleased.ProdCmplncLegalArea) as ehfnd_legal_area preserving type ) as ProdCmplncLegalArea,

      --Navigation Link UUID
      case
           when _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP' then
             _ProdCmplncUseInProgress.ProdCmplncUseUUID
           when _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE' then
             _ProdCmplncUseReleased.ProdCmplncUseUUID
         end                                                                                                                                          as ProdCmplncUseUUID,

      --Delete allowed?
      case
        when _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP' then
           _Constants.ConstantTrue
        when _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE' then
           _Constants.ConstantFalse
      end                                                                                                                                             as ProdCmplncUseDeleteIsAllwd,

      --Release allowed?
      case
        when _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP' then
           _Constants.ConstantTrue
        when _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE' then
           _Constants.ConstantFalse
      end                                                                                                                                             as ProdCmplncUseReleaseIsAllwd,

      --Processing Status
      case
        when _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP'
            and _ProdCmplncUseReleased.ProdCmplncUseProcgSts is null then
           _Constants.ConstantInitialVersion
        when _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP' then
           _ProdCmplncUseInProgress.ProdCmplncUseProcgSts
        when _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE' then
          _ProdCmplncUseReleased.ProdCmplncUseProcgSts
      end                                                                                                                                             as ProdCmplncUseProcgSts,

      --Criticality
      case
        when _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP' then
           _Constants.Constant2
        when _ProdCmplncUseReleased.ProdCmplncUseProcgSts = 'RE' then
           _Constants.Constant3
      end                                                                                                                                             as ProdCmplncUseProcgStsCritlty,

      /* Associations */
      _ProcessingStatus,
      _ProdCmplncLegalArea

}
where
     _ProdCmplncUseInProgress.ProdCmplncUseProcgSts = 'IP'
  or _ProdCmplncUseReleased.ProdCmplncUseProcgSts   = 'RE'