C_CmplRqRsltTradeSecretSubstVH

DDL: C_CMPLRQRSLTTRADESECRETSUBSTVH SQL: CCRRTSRSUBVH Type: view CONSUMPTION

Substance Indicated as CBI Registration

C_CmplRqRsltTradeSecretSubstVH is a Consumption CDS View that provides data about "Substance Indicated as CBI Registration" in SAP S/4HANA. It reads from 3 data sources (I_ChmlComponent, I_ChmlComposition, I_CmplRqRsltTrdScrtRegnDraft) and exposes 18 fields with key fields CmplRqRsltUUID, SubstanceUUID. It has 3 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_ChmlComponent _ChmlComponent from
I_ChmlComposition _ChmlComposition inner
I_CmplRqRsltTrdScrtRegnDraft _CmplRqRsltTrdScrtRegnDraft inner

Parameters (1)

NameTypeDefault
P_CmplRqRsltUUID sysuuid_x

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_SubstanceTP _Substance _ChmlComponent.SubstanceUUID = _Substance.SubstanceUUID -- Unit Of Measure Value Help
[0..*] I_UnitOfMeasureText _UnitOfMeasureText $projection.ChmlCompReldQtyUnit = _UnitOfMeasureText.UnitOfMeasure --Link to 'Chemcial Compliance Info' as root
[1..1] I_ChmlCmplncInfo _ChmlCmplncInfo $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID

Annotations (14)

NameValueLevelField
EndUserText.label Substance Indicated as CBI Registration view
AbapCatalog.sqlViewName CCRRTSRSUBVH view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #MANDATORY view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.representativeKey SubstanceUUID view
ObjectModel.dataCategory #VALUE_HELP view
Metadata.ignorePropagatedAnnotations true view
Search.searchable true view

Fields (18)

KeyFieldSource TableSource FieldDescription
KEY CmplRqRsltUUID
KEY SubstanceUUID I_ChmlComponent SubstanceUUID
SubstanceName _Substance SubstanceName
SubstanceInternalName _Substance SubstanceInternalName
CompanySubstanceName _Substance CompanySubstanceName
ECNumberasECNumber
CASNumber
ResponsibleUnit _Substance ResponsibleUnit
ChmlCompTypeasChmlCompType
ChmlCompTypeNameasChmlCompTypeName
ChmlCompQtyAsTextasChmlCompReldQtyAsText
ChmlCompReldLowrLimitQtyAsText I_ChmlComponent ChmlCompQtyLowerLimitAsText
ChmlCompReldUprLimitQtyOptr I_ChmlComponent ChmlCompOperatorUpperLimit
ChmlCompReldUprLimitQtyAsText I_ChmlComponent ChmlCompQtyUpperLimitAsText
ChmlCompQtyUnitasChmlCompReldQtyUnit
ChmlCmplncInfoUUID I_ChmlComposition ChmlCmplncInfoUUID
_Substance _Substance
_ChmlCmplncInfo _ChmlCmplncInfo
@EndUserText.label: 'Substance Indicated as CBI Registration'
@AbapCatalog.sqlViewName: 'CCRRTSRSUBVH'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #MANDATORY
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType: {
     serviceQuality:  #C,
     dataClass:       #MIXED,
     sizeCategory:    #L
   }
@ObjectModel.semanticKey:  [ 'SubstanceName' ]
@ObjectModel.representativeKey: 'SubstanceUUID'
@ObjectModel.dataCategory: #VALUE_HELP
@Metadata.ignorePropagatedAnnotations: true

@UI:
{
  presentationVariant:
  {
   requestAtLeast: [ 'SubstanceUUID', 'SubstanceName', 'ChmlCompReldQtyAsText', 'ChmlCompReldQtyUnitText', 'ChmlCompReldLowrLimitQtyOptr',
                     'ChmlCompReldLowrLimitQtyAsText', 'ChmlCompReldUprLimitQtyOptr', 'ChmlCompReldUprLimitQtyAsText' ]
  }
}

@Search.searchable: true

/*----------------------------------------------------------------------------------------------------------------------
    Value Help view to find and assign produced substances that are not already used in the (draft) composition
------------------------------------------------------------------------------------------------------------------------*/

define view C_CmplRqRsltTradeSecretSubstVH
  with parameters
    P_CmplRqRsltUUID : sysuuid_x

  as select from           I_ChmlComponent               as _ChmlComponent

    inner join             I_CmplRqRsltTrdScrtRegnDraft  as _CmplRqRsltTrdScrtRegnDraft  on _CmplRqRsltTrdScrtRegnDraft.CmplRqRsltUUID = $parameters.P_CmplRqRsltUUID

    inner join             I_ChmlComposition             as _ChmlComposition             on  _ChmlComposition.ChmlCompositionType           = _CmplRqRsltTrdScrtRegnDraft.ChmlCompositionType
                                                                                         and _ChmlComposition.ChmlCompositionUUID           = _ChmlComponent.ChmlCompositionUUID
                                                                                         and _ChmlComposition.ChmlCompositionStatus         = 'RE'
                                                                                         and _CmplRqRsltTrdScrtRegnDraft.ChmlCmplncInfoUUID = _ChmlComposition.ChmlCmplncInfoUUID

  --Join data of draft components of substance-based composition that are already assigned
    left outer to one join I_CmplRqRsltTrdScrtSubstDraft as _CmplRqRsltTrdScrtRegnSubstD on  _CmplRqRsltTrdScrtRegnSubstD.SubstanceUUID  = _ChmlComponent.SubstanceUUID
                                                                                         and _CmplRqRsltTrdScrtRegnSubstD.CmplRqRsltUUID = _CmplRqRsltTrdScrtRegnDraft.CmplRqRsltUUID

  association [0..1] to I_SubstanceTP       as _Substance         on _ChmlComponent.SubstanceUUID = _Substance.SubstanceUUID

  -- Unit Of Measure Value Help
  association [0..*] to I_UnitOfMeasureText as _UnitOfMeasureText on $projection.ChmlCompReldQtyUnit = _UnitOfMeasureText.UnitOfMeasure

  --Link to 'Chemcial Compliance Info' as root
  association [1..1] to I_ChmlCmplncInfo    as _ChmlCmplncInfo    on $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID


{

      @UI.hidden: true
  key $parameters.P_CmplRqRsltUUID                                                                  as CmplRqRsltUUID,

      @UI.hidden: true
      @UI.selectionField.exclude: true
      @Consumption.semanticObject: 'SubstanceUUID'
  key _ChmlComponent.SubstanceUUID                                                                  as SubstanceUUID,

      @UI: {
        lineItem : {
           position:   10,
           importance: #HIGH
        }
      }
      _Substance.SubstanceName                                                                      as SubstanceName,

      @Search: {
        defaultSearchElement: true,
        fuzzinessThreshold:   0.8,
        ranking: #LOW
      }
      _Substance.SubstanceInternalName                                                              as SubstanceInternalName,

      //used to search within company substance names

      @UI.hidden:true
      @Search:
      {
        defaultSearchElement: true,
        fuzzinessThreshold:   0.8,
        ranking: #HIGH
      }
      _Substance.CompanySubstanceName                                                               as CompanySubstanceName,

      -- ECNumber
      _Substance._ListedSubstance.ECNumber                                                          as ECNumber,

      @UI: {
        lineItem: {
          position:   20,
          importance: #MEDIUM
        }
      }
      _Substance._ListedSubstance.CASNumber                                                         as CASNumber,

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

      --Role of Ingredient
      @ObjectModel.text.element: [ 'ChmlCompTypeName' ]
      @UI.lineItem: [{ position: 30, importance: #MEDIUM }]
      @UI.textArrangement: #TEXT_ONLY
      _ChmlComponent.ChmlCompType                                                                   as ChmlCompType,

      --Description of Component Type
      @Semantics.text: true
      _ChmlComponent._ComponentType._Text[1: Language = $session.system_language ].ChmlCompTypeName as ChmlCompTypeName,

      --Concentration
      _ChmlComponent.ChmlCompQtyAsText                                                              as ChmlCompReldQtyAsText,

      --Concentration Range
      _ChmlComponent.ChmlCompOperatorLowerLimit                                                     as ChmlCompReldLowrLimitQtyOptr,
      _ChmlComponent.ChmlCompQtyLowerLimitAsText                                                    as ChmlCompReldLowrLimitQtyAsText,
      _ChmlComponent.ChmlCompOperatorUpperLimit                                                     as ChmlCompReldUprLimitQtyOptr,
      _ChmlComponent.ChmlCompQtyUpperLimitAsText                                                    as ChmlCompReldUprLimitQtyAsText,

      -- UoM Code (e.g. PPM)
      @ObjectModel.text.element: ['ChmlCompReldQtyUnitText']
      @ObjectModel.mandatory: true
      _ChmlComponent.ChmlCompQtyUnit                                                                as ChmlCompReldQtyUnit,

      -- UoM Short Text (e.g. ppm)
      @Semantics.text: true
      @ObjectModel.readOnly: true
      _UnitOfMeasureText[1: Language = $session.system_language ].UnitOfMeasureName                 as ChmlCompReldQtyUnitText,

      @UI.hidden: true
      _ChmlComposition.ChmlCmplncInfoUUID,

      _Substance,
      _ChmlCmplncInfo

}
where --Select components which are not already assigned
  _CmplRqRsltTrdScrtRegnSubstD.CmplRqRsltUUID is null
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCOMPONENT",
"I_CHMLCOMPOSITION",
"I_CHMLCOMPTYPE",
"I_CHMLCOMPTYPETEXT",
"I_CMPLRQRSLTTRDSCRTREGNDRAFT",
"I_CMPLRQRSLTTRDSCRTSUBSTDRAFT",
"I_SUBSTACTIVEDRAFTLSTDSUBST",
"I_SUBSTANCETP",
"I_UNITOFMEASURETEXT"
],
"ASSOCIATED":
[
"I_CHMLCMPLNCINFO",
"I_SUBSTANCETP",
"I_UNITOFMEASURETEXT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/