C_MatlBsdSubstInRmngCompVH

DDL: C_MATLBSDSUBSTINRMNGCOMPVH Type: view CONSUMPTION

Substances in Aft Prod Comp of MbC

C_MatlBsdSubstInRmngCompVH is a Consumption CDS View that provides data about "Substances in Aft Prod Comp of MbC" in SAP S/4HANA. It reads from 3 data sources (I_MatlBsdAfterProdnCompDraft, I_ChmlComposition, I_ChmlComponent) and exposes 19 fields with key field ChmlCompUUID. It has 2 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_MatlBsdAfterProdnCompDraft _AfterProdnComp inner
I_ChmlComposition _ChemicalComposition inner
I_ChmlComponent ChmlComponent from

Parameters (1)

NameTypeDefault
P_ChmlCompositionUUID sysuuid_x

Associations (2)

CardinalityTargetAliasCondition
[0..1] C_ChmlCmplncPrimMatl _PrimaryMaterial ChmlComponent.ChmlCmplncInfoUUID = _PrimaryMaterial.ChmlCmplncInfoUUID --Substance
[0..1] I_SubstanceTP _Substance ChmlComponent.SubstanceUUID = _Substance.SubstanceUUID

Annotations (15)

NameValueLevelField
EndUserText.label Substances in Aft Prod Comp of MbC view
AbapCatalog.sqlViewName MBCREMCOMPSUBVH view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking #NOT_REQUIRED view
VDM.viewType #CONSUMPTION view
ObjectModel.dataCategory #VALUE_HELP view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.representativeKey ChmlCompUUID view
Metadata.ignorePropagatedAnnotations true view
ClientHandling.algorithm #SESSION_VARIABLE view
Search.searchable true view

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY ChmlCompUUID I_ChmlComponent ChmlCompUUID
ChmlCompositionUUID I_ChmlComponent ChmlCompositionUUID
ChmlCmplncInfoUUID I_ChmlComponent ChmlCmplncInfoUUID
ChmlCompositionUUIDasMatlBsdCompUUID
SubstanceUUID I_ChmlComponent SubstanceUUID
SubstanceName _Substance SubstanceName
CASNumber
ChmlCompQty I_ChmlComponent ChmlCompQty
ChmlCompQtyAsText I_ChmlComponent ChmlCompQtyAsText
ChmlCompQtyUnit I_ChmlComponent ChmlCompQtyUnit
ChmlCompOperatorLowerLimit I_ChmlComponent ChmlCompOperatorLowerLimit
ChmlCompQtyLowerLimit I_ChmlComponent ChmlCompQtyLowerLimit
ChmlCompQtyLowerLimitAsText I_ChmlComponent ChmlCompQtyLowerLimitAsText
ChmlCompOperatorUpperLimit I_ChmlComponent ChmlCompOperatorUpperLimit
ChmlCompQtyUpperLimit I_ChmlComponent ChmlCompQtyUpperLimit
ChmlCompQtyUpperLimitAsText I_ChmlComponent ChmlCompQtyUpperLimitAsText
ResponsibleUnit _Substance ResponsibleUnit
_PrimaryMaterial _PrimaryMaterial
_Substance _Substance
@EndUserText.label: 'Substances in Aft Prod Comp of MbC'

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

@AccessControl:
{
  authorizationCheck: #MANDATORY,
  // blocking of personal data not required (no personal data fields exposed for material)

  personalData.blocking: #NOT_REQUIRED
}

@VDM.viewType: #CONSUMPTION

@ObjectModel:
{
  dataCategory: #VALUE_HELP,

  usageType:
  {
    dataClass: #MIXED,
    sizeCategory: #L,
    serviceQuality: #C
  },
  representativeKey: 'ChmlCompUUID',
  semanticKey: ['SubstanceName']
}

@Metadata.ignorePropagatedAnnotations: true

@ClientHandling.algorithm: #SESSION_VARIABLE

@UI:{
  presentationVariant: [{
    sortOrder: [{ by: 'SubstanceName', direction: #ASC }],
     requestAtLeast: ['SubstanceUUID',
                      'ChmlCmplncInfoCombinedName',
                      'Material',
                      'SubstanceName',
                      'CASNumber',
                      'ChmlCompQtyAsText',
                      'ChmlCompQtyUnit',
                      'ChmlCompOperatorLowerLimit',
                      'ChmlCompQtyLowerLimitAsText',
                      'ChmlCompOperatorUpperLimit',
                      'ChmlCompQtyUpperLimitAsText'
                    ]
  }]
}

@Search.searchable: true

/*
 * This view is used in the object page of the material based composition
 * to diplay all CCIs with type = 'Bulk' and role 'Produced' or 'Sourced'
 * in a value help
 */

define view C_MatlBsdSubstInRmngCompVH
  with parameters
    P_ChmlCompositionUUID : sysuuid_x
  -- select Raw Material
  as select from I_ChmlComponent            as ChmlComponent

    inner join   I_MatlBsdAfterProdnCompDraft as _AfterProdnComp      on ChmlComponent.ChmlCmplncInfoUUID = _AfterProdnComp.CompChmlCmplncInfoUUID

    inner join   I_ChmlComposition          as _ChemicalComposition on  ChmlComponent.ChmlCompositionUUID          = _ChemicalComposition.ChmlCompositionUUID
                                                                      and _ChemicalComposition.ChmlCompositionType   = 'ANALYTIC1'
                                                                      and _ChemicalComposition.ChmlCompositionStatus = 'RE'

  --------------------------------------------------------------------------------------------------------------------
  --Nodes/Detaildata
  --------------------------------------------------------------------------------------------------------------------

  association [0..1] to C_ChmlCmplncPrimMatl as _PrimaryMaterial on ChmlComponent.ChmlCmplncInfoUUID = _PrimaryMaterial.ChmlCmplncInfoUUID

  --Substance
  association [0..1] to I_SubstanceTP  as _Substance       on ChmlComponent.SubstanceUUID = _Substance.SubstanceUUID

{

  key ChmlComponent.ChmlCompUUID,
      ChmlComponent.ChmlCompositionUUID,
      ChmlComponent.ChmlCmplncInfoUUID,

      -- MatlBsdComp of Root
      _AfterProdnComp.ChmlCompositionUUID                                                            as MatlBsdCompUUID,
      -- Preferred Material of Component
      @ObjectModel.readOnly: true
      @ObjectModel.text.element: ['ChmlCmplncInfoCombinedName']
      @Semantics.text:true
      cast( _PrimaryMaterial.Material as matnr preserving type)                                      as Material,

      -- Combined component name
      @ObjectModel.readOnly: true
      @Semantics.text: true
      @Search: {
        defaultSearchElement: true,
        fuzzinessThreshold:   0.8,
        ranking: #HIGH
      }
      cast(_PrimaryMaterial.ChmlCmplncInfoCombinedName as ehfnd_cci_component_name preserving type ) as ChmlCmplncInfoCombinedName,

      ChmlComponent.SubstanceUUID,
      _Substance.SubstanceName,
      
      @UI: {
        lineItem: [{
          position:   20 ,
          importance:  #MEDIUM 
         }]
       }
      _Substance._ListedSubstance.CASNumber,
      
      @Semantics.quantity.unitOfMeasure: 'ChmlCompQtyUnit'
      ChmlComponent.ChmlCompQty,
      ChmlComponent.ChmlCompQtyAsText,
      ChmlComponent.ChmlCompQtyUnit,
      ChmlComponent.ChmlCompOperatorLowerLimit,
      @Semantics.quantity.unitOfMeasure: 'ChmlCompQtyUnit'
      ChmlComponent.ChmlCompQtyLowerLimit,
      ChmlComponent.ChmlCompQtyLowerLimitAsText,
      ChmlComponent.ChmlCompOperatorUpperLimit,
      @Semantics.quantity.unitOfMeasure: 'ChmlCompQtyUnit'
      ChmlComponent.ChmlCompQtyUpperLimit,
      ChmlComponent.ChmlCompQtyUpperLimitAsText,

//      @ObjectModel.readOnly: true

//      @ObjectModel.virtualElement

//      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_MCMPS_APC_SUB_AC_EXIT'

//      cast( 0 as ehfnd_cci_ccomp_qty_ch )                                                            as ChmlCompAbsQtyAsText,

      
      @UI.hidden: true
      _Substance.ResponsibleUnit                                                                    as ResponsibleUnit,

      /* Associations */
      _PrimaryMaterial,
      _Substance
}
where
      _AfterProdnComp.ChmlCompositionUUID = $parameters.P_ChmlCompositionUUID
  and _AfterProdnComp.ChmlCompIsRemoved   <> 'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"C_CHMLCMPLNCPRIMMATL",
"I_CHMLCOMPONENT",
"I_CHMLCOMPOSITION",
"I_MATLBSDAFTERPRODNCOMPDRAFT",
"I_SUBSTACTIVEDRAFTLSTDSUBST",
"I_SUBSTANCETP"
],
"ASSOCIATED":
[
"C_CHMLCMPLNCPRIMMATL",
"I_SUBSTANCETP"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/