P_ChmlCmplncInfoAssgdPCIdfr

DDL: P_CHMLCMPLNCINFOASSGDPCIDFR Type: view_entity CONSUMPTION Package: EHFND_CNS_CCI

Assigned Product Identifiers

P_ChmlCmplncInfoAssgdPCIdfr is a Consumption CDS View that provides data about "Assigned Product Identifiers" in SAP S/4HANA. It reads from 2 data sources (I_ChmlCmplncInfo, I_PCPrptyRootType) and exposes 9 fields. It has 1 association to related views. Part of development package EHFND_CNS_CCI.

Data Sources (2)

SourceAliasJoin Type
I_ChmlCmplncInfo ChemicalComplianceInfo from
I_PCPrptyRootType PCPrptyRootType inner

Associations (1)

CardinalityTargetAliasCondition
[1..1] P_CChmlCmplConstants _Constants _Constants.Constant1 = _Constants.Constant1

Annotations (4)

NameValueLevelField
EndUserText.label Assigned Product Identifiers view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #CONSUMPTION view
VDM.private true view

Fields (9)

KeyFieldSource TableSource FieldDescription
ChmlCmplncInfoUUIDasChmlCmplncInfoUUID
PCPrptyRootTypeasPCPrptyRootType
ChmlCmplncIdfrUUIDasPCPrptyInProcessUUID
PCPrptyInProcProcgSts IdentifierInProgress ChmlCmplncIdfrProcgStatus
PCPrptyInProcIsActive
ChmlCmplncIdfrUUIDasPCPrptyReleasedUUID
PCPrptyReldProcgSts IdentifierReleased ChmlCmplncIdfrProcgStatus
ReleasedByUser IdentifierReleased ChmlCmplncIdfrReldByUser
PCPrptyReldIsActive
@AbapCatalog.viewEnhancementCategory: [#NONE]
@EndUserText.label: 'Assigned Product Identifiers'

--Access Control: Authorizations Checks
@AccessControl.authorizationCheck: #NOT_REQUIRED

--VDM view type
@VDM.viewType: #CONSUMPTION
@VDM.private: true
define view entity P_ChmlCmplncInfoAssgdPCIdfr
  as select from           I_ChmlCmplncInfo  as ChemicalComplianceInfo
    inner join             I_PCPrptyRootType as PCPrptyRootType              on PCPrptyRootType.DomainValue = 'EHFNDD_ID'

  --Join data from CCI Identifiers with status In Progress => Active or draft
    left outer to one join I_ChmlCmplncIdfr  as IdentifierInProgress         on  IdentifierInProgress.ChmlCmplncIdfrParentUUID  = ChemicalComplianceInfo.ChmlCmplncInfoUUID
                                                                             and IdentifierInProgress.ChmlCmplncIdfrProcgStatus = 'IP'
                                                                             and IdentifierInProgress.ChmlCmplncIdfrParentType  = 'CCI'

  --Join data from CCI Identifiers with status Released => only active, as released identifiers are not editable
    left outer to one join I_ChmlCmplncIdfr  as IdentifierReleased           on  IdentifierReleased.ChmlCmplncIdfrParentUUID  = ChemicalComplianceInfo.ChmlCmplncInfoUUID
                                                                             and IdentifierReleased.ChmlCmplncIdfrProcgStatus = 'RE'
                                                                             and IdentifierReleased.ChmlCmplncIdfrParentType  = 'CCI'
                                                                             
  --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
{
      --UUID of chemical compliance information
  key ChemicalComplianceInfo.ChmlCmplncInfoUUID                                 as ChmlCmplncInfoUUID,

      --Property Type
  key PCPrptyRootType.PCPrptyRootType                                           as PCPrptyRootType,

      -- In Progress Version
      IdentifierInProgress.ChmlCmplncIdfrUUID                                   as PCPrptyInProcessUUID,
      IdentifierInProgress.ChmlCmplncIdfrProcgStatus                            as PCPrptyInProcProcgSts,
      cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as PCPrptyInProcIsActive,

      -- Released Version
      IdentifierReleased.ChmlCmplncIdfrUUID                                     as PCPrptyReleasedUUID,
      IdentifierReleased.ChmlCmplncIdfrProcgStatus                              as PCPrptyReldProcgSts,
      IdentifierReleased.ChmlCmplncIdfrReldByUser                               as ReleasedByUser,
      cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as PCPrptyReldIsActive,
      
      --Navigation Link UUID
      case
        when IdentifierInProgress.ChmlCmplncIdfrProcgStatus = 'IP' then IdentifierInProgress.ChmlCmplncIdfrUUID
        when IdentifierReleased.ChmlCmplncIdfrProcgStatus   = 'RE' then IdentifierReleased.ChmlCmplncIdfrUUID
        -- else _Constants[inner].ConstantEmptyRaw16
      end                                                                       as PCPrptyNavgnLinkUUID,

      --Active Indicator
      case 
        when IdentifierInProgress.ChmlCmplncIdfrProcgStatus = 'IP'
          then cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type )
        when IdentifierReleased.ChmlCmplncIdfrProcgStatus = 'RE'
          then cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type )
      end                                                                       as PCPrptyIsActive
}