P_RawMatlChmlCmplncSts

DDL: P_RAWMATLCHMLCMPLNCSTS Type: view CONSUMPTION

Compliance Status of Raw Material for a Supplier Material

P_RawMatlChmlCmplncSts is a Consumption CDS View that provides data about "Compliance Status of Raw Material for a Supplier Material" in SAP S/4HANA. It reads from 2 data sources (I_CmplRqRslt, I_ChmlCmplncSuplrMatlAssgmt) and exposes 7 fields. It has 4 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_CmplRqRslt _RawMaterialRequirementResult left_outer
I_ChmlCmplncSuplrMatlAssgmt SuplrMatlAssignment from

Associations (4)

CardinalityTargetAliasCondition
[0..*] I_CmplRqRslt _ReldRawMaterialCmplRqRslt SuplrMatlAssignment.ChmlCmplncInfoUUID = _ReldRawMaterialCmplRqRslt.ChmlCmplncInfoUUID and _ReldRawMaterialCmplRqRslt.CmplRqVersUUID = _RawMaterialRequirementResult.CmplRqVersUUID and _ReldRawMaterialCmplRqRslt.CmplRqRsltProcessingStatus = 'RE'
[0..1] I_CmplncRqmtRsltCmplncStsVH _ReleasedStatusVH $projection.cmplrqrsltreldcmplncsts = _ReleasedStatusVH.CmplRqRsltCmplncSts --Requirement Origin Text
[0..1] I_ChmlSuplrMatlStatusOriginT _RequirementOriginText $projection.ChmlCmplncRqmtRsltOrigin = _RequirementOriginText.ChmlCmplncRqmtRsltOrigin and _RequirementOriginText.Language = $session.system_language
[1..1] P_CChmlCmplConstants _Constants _Constants.Constant1 = 1

Annotations (8)

NameValueLevelField
EndUserText.label Compliance Status of Raw Material for a Supplier Material view
AbapCatalog.sqlViewName PCSMRMCSTS 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 (7)

KeyFieldSource TableSource FieldDescription
ChmlSuplrMatlUUID
ChmlCmplncInfoUUID
CmplRqVersUUIDasCmplRqVersUUID
CmplRqRsltReldCmplncSts _ReldRawMaterialCmplRqRslt CmplRqRsltReldCmplncSts
_ReleasedStatusVH _ReleasedStatusVH
_RequirementOriginText _RequirementOriginText
_ReldRawMaterialCmplRqRslt _ReldRawMaterialCmplRqRslt
@EndUserText.label: 'Compliance Status of Raw Material for a Supplier Material'

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

@AccessControl:
{
  authorizationCheck: #NOT_REQUIRED
}

@ClientHandling.algorithm: #SESSION_VARIABLE

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

// view returns information if a CRR of a supplier material is used in its raw material and exposes the information about the released compliance status

define view P_RawMatlChmlCmplncSts
  --Select data from basic view of Supplier Material Assignment
  as select from    I_ChmlCmplncSuplrMatlAssgmt as SuplrMatlAssignment

  -- join data from Compliance Requirement Results of Raw Materials to know if the supplier material CRR is also used in raw material (group by avoids duplicate entries)
    left outer join I_CmplRqRslt                as _RawMaterialRequirementResult on SuplrMatlAssignment.ChmlCmplncInfoUUID = _RawMaterialRequirementResult.ChmlCmplncInfoUUID
  --released raw material CRR for released compliance status
  association [0..*] to I_CmplRqRslt                 as _ReldRawMaterialCmplRqRslt on  SuplrMatlAssignment.ChmlCmplncInfoUUID                = _ReldRawMaterialCmplRqRslt.ChmlCmplncInfoUUID
                                                                                   and _ReldRawMaterialCmplRqRslt.CmplRqVersUUID             = _RawMaterialRequirementResult.CmplRqVersUUID
                                                                                   and _ReldRawMaterialCmplRqRslt.CmplRqRsltProcessingStatus = 'RE'

  association [0..1] to I_CmplncRqmtRsltCmplncStsVH  as _ReleasedStatusVH          on  $projection.cmplrqrsltreldcmplncsts = _ReleasedStatusVH.CmplRqRsltCmplncSts


  --Requirement Origin Text
  association [0..1] to I_ChmlSuplrMatlStatusOriginT as _RequirementOriginText     on  $projection.ChmlCmplncRqmtRsltOrigin = _RequirementOriginText.ChmlCmplncRqmtRsltOrigin
                                                                                   and _RequirementOriginText.Language      = $session.system_language
                                                                                   
  // dummy constant selection to avoid issues with case statement with constants (not null-preserving topic)

  association [1..1] to P_CChmlCmplConstants as _Constants         on  _Constants.Constant1 = 1                                                                                   
{
      --UUID of Supplier Material
  key SuplrMatlAssignment.ChmlSuplrMatlUUID,

      --UUID of Raw Material
  key SuplrMatlAssignment.ChmlCmplncInfoUUID,

      --UUID of Compliance Requirment Version
  key _RawMaterialRequirementResult.CmplRqVersUUID            as CmplRqVersUUID,

      --Requirement Origin
      cast(
            ( case
                when _RawMaterialRequirementResult.CmplRqVersUUID is not null then _Constants.ConstantRaw
                when _RawMaterialRequirementResult.CmplRqVersUUID is null then _Constants.ConstantEmpty
              end ) as ehfnd_csm_crr_origin preserving type ) as ChmlCmplncRqmtRsltOrigin,

      _ReldRawMaterialCmplRqRslt.CmplRqRsltReldCmplncSts,

      /*Association*/
      _ReleasedStatusVH,
      _RequirementOriginText,
      _ReldRawMaterialCmplRqRslt
}
group by
  SuplrMatlAssignment.ChmlSuplrMatlUUID,
  SuplrMatlAssignment.ChmlCmplncInfoUUID,
  _RawMaterialRequirementResult.CmplRqVersUUID,
  _ReldRawMaterialCmplRqRslt.CmplRqRsltReldCmplncSts,
  _Constants.ConstantRaw,
  _Constants.ConstantEmpty  



//// view returns information if a CRR of a supplier material is used in its raw material and exposes the information about the released compliance status

//define view P_RawMatlChmlCmplncSts

//  --Select data from basic view of Supplier Material Assignment

//  as select from I_ChmlCmplncSuplrMatlAssgmt as SuplrMatlAssignment

//

//  -- join data from Compliance Requirement Results of Raw Materials to know if the supplier material CRR is also used in raw material (group by avoids duplicate entries)

//  association [0..*] to I_CmplRqRslt                 as _RawMaterialRequirementResult on  SuplrMatlAssignment.ChmlCmplncInfoUUID = _RawMaterialRequirementResult.ChmlCmplncInfoUUID

//  --released raw material CRR for released compliance status

//  association [0..*] to I_CmplRqRslt                 as _ReldRawMaterialCmplRqRslt    on  SuplrMatlAssignment.ChmlCmplncInfoUUID                = _ReldRawMaterialCmplRqRslt.ChmlCmplncInfoUUID

//                                                                                      and _ReldRawMaterialCmplRqRslt.CmplRqVersUUID             = _RawMaterialRequirementResult.CmplRqVersUUID

//                                                                                      and _ReldRawMaterialCmplRqRslt.CmplRqRsltProcessingStatus = 'RE'

//

//  --Requirement Origin Text

//  association [0..1] to I_ChmlSuplrMatlStatusOriginT as _RequirementOriginText        on  $projection.ChmlCmplncRqmtRsltOrigin = _RequirementOriginText.ChmlCmplncRqmtRsltOrigin

//                                                                                      and _RequirementOriginText.Language      = $session.system_language

//{

//      --UUID of Supplier Material

//  key SuplrMatlAssignment.ChmlSuplrMatlUUID,

//

//      --UUID of Raw Material

//  key SuplrMatlAssignment.ChmlCmplncInfoUUID,

//

//      --UUID of Compliance Requirment Version

//  key _RawMaterialRequirementResult.CmplRqVersUUID            as CmplRqVersUUID,

//

//      --Requirement Origin

//      cast(

//            ( case

//                when _RawMaterialRequirementResult.CmplRqVersUUID is not null then 'RAW'

//                else ''

//              end ) as ehfnd_csm_crr_origin preserving type ) as ChmlCmplncRqmtRsltOrigin,

//

//      /*Association*/

//      _RequirementOriginText,

//      _ReldRawMaterialCmplRqRslt

//}

//group by

//  ChmlSuplrMatlUUID,

//  SuplrMatlAssignment.ChmlCmplncInfoUUID,

//  _RawMaterialRequirementResult.CmplRqVersUUID

//

// 

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCSUPLRMATLASSGMT",
"I_CMPLRQRSLT",
"P_CCHMLCMPLCONSTANTS"
],
"ASSOCIATED":
[
"I_CHMLSUPLRMATLSTATUSORIGINT",
"I_CMPLNCRQMTRSLTCMPLNCSTSVH",
"I_CMPLRQRSLT",
"P_CCHMLCMPLCONSTANTS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/