P_ChmlCmplncPrpsRqmtPmaCT

DDL: P_CHMLCMPLNCPRPSRQMTPMACT Type: view CONSUMPTION Package: EHFND_BO_CCI

Count Compliance Requirements of all Purposes per Product

P_ChmlCmplncPrpsRqmtPmaCT is a Consumption CDS View that provides data about "Count Compliance Requirements of all Purposes per Product" in SAP S/4HANA. It reads from 2 data sources (I_ChmlCmplncInfo, I_CmplRqRslt) and exposes 1 field. Part of development package EHFND_BO_CCI.

Data Sources (2)

SourceAliasJoin Type
I_ChmlCmplncInfo ChmlCmplInfo from
I_CmplRqRslt CRR inner

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PCCPRPSCRQPMACT view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
VDM.private true view
ObjectModel.representativeKey ChmlCmplncInfoUUID view

Fields (1)

KeyFieldSource TableSource FieldDescription
ChmlCmplncInfoUUID
//@EndUserText.label: 'Count Compliance Requirements of all Purposes per Product'


@AbapCatalog:
{
  sqlViewName: 'PCCPRPSCRQPMACT',
  compiler.compareFilter: true
}

@AccessControl:
{
  authorizationCheck: #NOT_REQUIRED
}

--Client Handling of the view
@ClientHandling.algorithm: #SESSION_VARIABLE

--VDM view type
@VDM.viewType: #CONSUMPTION
@VDM.private: true

@ObjectModel.representativeKey: 'ChmlCmplncInfoUUID'

define view P_ChmlCmplncPrpsRqmtPmaCT
  --Select data from basic view 'Chemical compliance information'
  as select from I_ChmlCmplncInfo       as ChmlCmplInfo

  --Join master table
  --purpose assignment in chemical compliance information
    join         I_ChmlCmplncPrpsAssgmt as PurposeAssignment on ChmlCmplInfo.ChmlCmplncInfoUUID = PurposeAssignment.ChmlCmplncInfoUUID
  --Purpose
    join         I_CmplncPrpsRqmtAssgmt as PrpsCRAssgnmt     on PrpsCRAssgnmt.CmplncPrpsUUID = PurposeAssignment.CmplncPrpsUUID
  --Compliance Requirements
    join         I_CmplRqVers           as CRVersion         on PrpsCRAssgnmt.CmplRqUUID = CRVersion.CmplRqUUID
  --Compliance Requirement Results IP and RE  
    inner join I_CmplRqRslt as CRR    on CRR.ChmlCmplncInfoUUID = ChmlCmplInfo.ChmlCmplncInfoUUID
                                           and CRR.CmplRqVersUUID = CRVersion.CmplRqVersUUID
                                           and ( CRR.CmplRqRsltProcessingStatus = 'IP'
                                           or    CRR.CmplRqRsltProcessingStatus = 'RE' )


{
      --UUID of chemical compliance information
  key ChmlCmplInfo.ChmlCmplncInfoUUID,

      --Count compliance requirements
      cast( count( distinct CRVersion.CmplRqUUID ) as ehfnd_cci_number_of_cr_ma ) as NmbrOfCmplRqRslts
      
}
where
  CRVersion.CmplRqApplicationComponent      = 'PMA'
  and PrpsCRAssgnmt.CmplncPrpsRqmtAssgmtIsObslt <> 'X'
group by
  ChmlCmplInfo.ChmlCmplncInfoUUID