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.
@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
defineview P_RawMatlChmlCmplncSts
--Select data from basic view of Supplier Material Assignment
asselectfrom 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 (groupby avoids duplicate entries)
leftouterjoin 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 withcase statement with constants (notnull-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(
( casewhen _RawMaterialRequirementResult.CmplRqVersUUID isnotnullthen _Constants.ConstantRaw
when _RawMaterialRequirementResult.CmplRqVersUUID isnullthen _Constants.ConstantEmpty
end ) as ehfnd_csm_crr_origin preserving type ) as ChmlCmplncRqmtRsltOrigin,
_ReldRawMaterialCmplRqRslt.CmplRqRsltReldCmplncSts,
/*Association*/
_ReleasedStatusVH,
_RequirementOriginText,
_ReldRawMaterialCmplRqRslt
}
groupby
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
//defineview P_RawMatlChmlCmplncSts
// --Select data from basic view of Supplier Material Assignment
// asselectfrom 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 (groupby 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 isnotnullthen 'RAW'
// else ''
// end ) as ehfnd_csm_crr_origin preserving type ) as ChmlCmplncRqmtRsltOrigin,
//
// /*Association*/// _RequirementOriginText,
// _ReldRawMaterialCmplRqRslt
//}
//groupby// 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":""
}
}*/