P_ChmlSuplrMatlData

DDL: P_CHMLSUPLRMATLDATA Type: view CONSUMPTION Package: EHFND_CNS_CSM

Additional Data for Supplier Material

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 11 fields. It has 7 associations to related views. Part of development package EHFND_CNS_CSM.

Data Sources (1)

SourceAliasJoin Type
I_ChmlSuplrMatl SupplierMaterial from

Associations (7)

CardinalityTargetAliasCondition
[0..1] I_ChmlCmplncInfoActiveDraft _ActiveDraftCCI SuplrMatlAssignment.ChmlCmplncInfoUUID = _ActiveDraftCCI.ActiveChmlCmplncInfoUUID --Link to the criticality
[1..1] P_ChmlSuplrMatlSuplrStsCritlty _Criticality SuplrMatlAssignment.ChmlSuplrMatlSuplrSts = _Criticality.ChmlSuplrMatlSuplrSts --Count associated
[0..1] P_ChmlSuplrMatlComponentCntr _ComponentCount _ComponentCount.ChmlSuplrMatlUUID = $projection.ChmlSuplrMatlUUID --
[0..1] P_AssociatedAnlytlCmpstnRawMat _RawComposition $projection.ChmlCmplncInfoUUID = _RawComposition.ChmlCmplncInfoUUID --Text
[0..*] I_ChmlSuplrMatlSuplrStsT _SupplierStatusTxt $projection.ChmlSuplrMatlSuplrSts = _SupplierStatusTxt.ChmlSuplrMatlSuplrSts
[0..1] I_ChmlSuplrMatlCmpstnSts _CompositionStatusTxt $projection.ChmlSuplrMatlCmpstnSts = _CompositionStatusTxt.ChmlSuplrMatlCmpstnSts
[1..1] P_CChmlCmplConstants _Constants _Constants.Constant1 = _Constants.Constant1

Annotations (8)

NameValueLevelField
EndUserText.label Additional Data for Supplier Material view
AbapCatalog.sqlViewName PCSMMATLDATA view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
VDM.private true view

Fields (11)

KeyFieldSource TableSource FieldDescription
ChmlSuplrMatlUUID
ChmlCmplncInfoUUID
ChmlCmplncInfoCombinedName
ChmlCmplncInfoCombinedID
ChmlCmpstnInProcStatus _RawComposition ChmlCmpstnInProcStatus
ChmlCmpstnReldStatus _RawComposition ChmlCmpstnReldStatus
ChmlSuplrMatlCmpstnStsName
ResponsibleUnit I_ChmlSuplrMatl ResponsibleUnit
_ActiveDraftCCI _ActiveDraftCCI
_SupplierStatusTxt _SupplierStatusTxt
_CompositionStatusTxt _CompositionStatusTxt
@EndUserText.label: 'Additional Data for Supplier Material'

@AbapCatalog:
{
  sqlViewName: 'PCSMMATLDATA',
  compiler.compareFilter: 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

define view P_ChmlSuplrMatlData
  --Select data from basic view of Supplier Material
  as select from           I_ChmlSuplrMatl             as SupplierMaterial

  --join supplier material data
    left outer to one join I_ChmlCmplncSuplrMatlAssgmt as SuplrMatlAssignment on SupplierMaterial.ChmlSuplrMatlUUID = SuplrMatlAssignment.ChmlSuplrMatlUUID

  --join data of raw material
    left outer 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..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
        when ''  then SuplrMatlAssignment.ChmlSuplrMatlSuplrSts
       end                                                                                                     as ChmlSuplrMatlSuplrSts,

      --Criticality
      case SupplierMaterial.ChmlSuplrMatlIsOutdated
        when 'X'    then _Constants[inner].Constant1
        when '' then _Criticality.ChmlSuplrMatlSuplrStsCritlty
      end                                                                                                      as ChmlSuplrMatlSuplrStsCritlty,

      -- business partner full name
      SupplierMaterial._BusinessPartner.BusinessPartnerFullName                                                as BusinessPartnerFullName,

      case
        when _RawComposition.ChmlCmpstnInProcStatus = 'IP' then _RawComposition.ChmlCompositionInProcessUUID
        when _RawComposition.ChmlCmpstnReldStatus   = 'RE' then _RawComposition.ChmlCompositionReleasedUUID
      end                                                                                                      as ChmlCompositionUUID,
      
      _RawComposition.ChmlCmpstnInProcStatus,
      
      _RawComposition.ChmlCmpstnReldStatus,

      -- Composition status
      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CSM_CALC_EXIT'
      @ObjectModel.readOnly: true
      cast( '' as ehfnd_csm_comp_status ) as ChmlSuplrMatlCmpstnSts,

      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CSM_CALC_EXIT'
      @ObjectModel.readOnly: true
      cast( '' as val_text ) as ChmlSuplrMatlCmpstnStsName,

      --Criticality
      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CSM_CALC_EXIT'
      @ObjectModel.readOnly: true
      cast( 0 as int1 ) as ChmlSuplrMatlCmpstnStsCritlty,

      SupplierMaterial.ResponsibleUnit                                                                         as ResponsibleUnit,

      _ActiveDraftCCI,
      _SupplierStatusTxt,
      _CompositionStatusTxt

}