P_ChmlSuplrMatlData is a Consumption CDS View that provides data about "Additional Data for Supplier Material" in SAP S/4HANA. It reads from 1 data source (I_ChmlSuplrMatl) and exposes 10 fields. It has 7 associations to related views.
@EndUserText.label: 'Additional Data for Supplier Material'
@AbapCatalog:
{
sqlViewName: 'PCSMMATLDATA',
compiler.compareFilter: true,
preserveKey: true
}@AccessControl:
{
// no authorization check needed for private view
authorizationCheck: #CHECK,
personalData.blocking: #REQUIRED
}@ClientHandling.algorithm: #SESSION_VARIABLE@VDM.viewType: #CONSUMPTION@VDM.private: true@ObjectModel:
{
semanticKey: [ 'ChmlSuplrMatlUUID' ]
}// additional data for the supplier material object page:
// - combined name
// - navigation information
// - supplier status
// - composition status
// - business partner full name
defineview P_ChmlSuplrMatlData
--Select data from basic view of Supplier Material
asselectfrom I_ChmlSuplrMatl as SupplierMaterial
--join supplier material data
leftouter to one join I_ChmlCmplncSuplrMatlAssgmt as SuplrMatlAssignment on SupplierMaterial.ChmlSuplrMatlUUID = SuplrMatlAssignment.ChmlSuplrMatlUUID
--join data of raw material
leftouter to one join C_RawChmlCmplncPrimMatl as RawMaterialData on SuplrMatlAssignment.ChmlCmplncInfoUUID = RawMaterialData.ChmlCmplncInfoUUID
--join data for active or draft chemical compliance information
association [0..1] to I_ChmlCmplncInfoActiveDraft as _ActiveDraftCCI on SuplrMatlAssignment.ChmlCmplncInfoUUID = _ActiveDraftCCI.ActiveChmlCmplncInfoUUID
--Link to the criticality
association [1..*] to P_ChmlSuplrMatlSuplrStsCritlty as _Criticality on SuplrMatlAssignment.ChmlSuplrMatlSuplrSts = _Criticality.ChmlSuplrMatlSuplrSts
--Count associated composition components
association [0..1] to P_ChmlSuplrMatlComponentCntr as _ComponentCount on _ComponentCount.ChmlSuplrMatlUUID = $projection.ChmlSuplrMatlUUID
--Association for navigation
association [0..1] to P_AssociatedAnlytlCmpstnRawMat as _RawComposition on $projection.ChmlCmplncInfoUUID = _RawComposition.ChmlCmplncInfoUUID
--Text association for status
association [0..*] to I_ChmlSuplrMatlSuplrStsT as _SupplierStatusTxt on $projection.ChmlSuplrMatlSuplrSts = _SupplierStatusTxt.ChmlSuplrMatlSuplrSts
association [0..1] to I_ChmlSuplrMatlCmpstnSts as _CompositionStatusTxt on $projection.ChmlSuplrMatlCmpstnSts = _CompositionStatusTxt.ChmlSuplrMatlCmpstnSts
association [1..1] to P_CChmlCmplConstants as _Constants on _Constants.Constant1 = _Constants.Constant1
{
--UUID of Supplier Material
key SupplierMaterial.ChmlSuplrMatlUUID,
--UUID of raw material
SuplrMatlAssignment.ChmlCmplncInfoUUID,
--Concatenate the name of supplier material: "Supplier - Raw Material Name"
concat_with_space(SupplierMaterial._BusinessPartner.BusinessPartnerFullName,
concat_with_space(_Constants[inner].ConstantHyphen, RawMaterialData.ChmlCmplncInfoCombinedName, 1), 1) as SupplierMaterialCombinedName,
--Combined Name of Raw Material (Material description or Internal Name)
RawMaterialData.ChmlCmplncInfoCombinedName,
-- Needed in PCE monitor app like Initiating object ID
RawMaterialData.ChmlCmplncInfoCombinedID,
--Supplier Status for Raw Material
case SupplierMaterial.ChmlSuplrMatlIsOutdated
when 'X' then _Constants[inner].ConstantOutdated -->Set "Outdated" if indicator is set in the supplier material
else SuplrMatlAssignment.ChmlSuplrMatlSuplrSts
endas ChmlSuplrMatlSuplrSts,
--Criticality
case SupplierMaterial.ChmlSuplrMatlIsOutdated
when 'X' then _Constants[inner].Constant1
else _Criticality.ChmlSuplrMatlSuplrStsCritlty
endas ChmlSuplrMatlSuplrStsCritlty,
-- business partner full name
SupplierMaterial._BusinessPartner.BusinessPartnerFullName as BusinessPartnerFullName,
casewhen _RawComposition.ChmlCmpstnInProcStatus = 'IP' then _RawComposition.ChmlCompositionInProcessUUID
elsecasewhen _RawComposition.ChmlCmpstnReldStatus = 'RE' then _RawComposition.ChmlCompositionReleasedUUID
endendas ChmlCompositionUUID,
_RawComposition.ChmlCmpstnInProcStatus,
_RawComposition.ChmlCmpstnReldStatus,
-- Composition status
cast( casewhen _ComponentCount.NrOfAllChmlSuplrMatlComponent > 0
then _Constants[inner].ConstantCompStatForrelease // at least 1 component exists
else _Constants[inner].ConstantCompStatNew
endas ehfnd_csm_comp_status preserving type ) as ChmlSuplrMatlCmpstnSts,
--Criticality
casewhen _ComponentCount.NrOfAllChmlSuplrMatlComponent > 0 then _Constants[inner].Constant3
else _Constants[inner].Constant2
endas ChmlSuplrMatlCmpstnStsCritlty,
SupplierMaterial.ResponsibleUnit as ResponsibleUnit,
_ActiveDraftCCI,
_SupplierStatusTxt,
_CompositionStatusTxt
}