C_SubstanceQryTP

DDL: C_SUBSTANCEQRYTP Type: view CONSUMPTION

Manage Substances Compliance

C_SubstanceQryTP is a Consumption CDS View that provides data about "Manage Substances Compliance" in SAP S/4HANA. It reads from 1 data source (I_SubstanceTP) and exposes 53 fields with key field SubstanceUUID. It has 16 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_SubstanceTP Substance from

Associations (16)

CardinalityTargetAliasCondition
[0..*] C_SubstanceVarAssgmtQryTP _SubstanceVarAssgmt $projection.SubstanceUUID = _SubstanceVarAssgmt.SubstanceUUID --Group Assignment
[0..*] C_SubstanceGrpAssgmt _SubstanceGrpAsgmt $projection.listedsubstance = _SubstanceGrpAsgmt.ListedSubstance --Group Assignment IN EDIT MODE
[0..*] C_SubstanceGrpAssgmtTP _SubstanceGrpAssgmtTP $projection.SubstanceUUID = _SubstanceGrpAssgmtTP.SubstanceUUID -- Additional Identifiers
[0..*] C_SubstanceAdditionalIdfrTP _SubstanceAdditionalIdfrTP $projection.SubstanceUUID = _SubstanceAdditionalIdfrTP.SubstanceUUID --Listed Substance Primary Names
[0..*] C_SubstanceListedSubstanceTxt _ListedSubPrimNames $projection.ListedSubstanceUUID = _ListedSubPrimNames.ListedSubstanceUUID and $projection.ActiveSubstanceUUID = _ListedSubPrimNames.ActiveSubstanceUUID -- Language Dependent Substance Names
[0..*] C_SubstanceTextTP _SubstanceText $projection.SubstanceUUID = _SubstanceText.SubstanceUUID -- Substance Trade Secret Name
[0..*] C_SubstanceTradeSecretTextTP _SubstanceTradeSecretText $projection.SubstanceUUID = _SubstanceTradeSecretText.SubstanceUUID -- Polymer
[0..*] C_SubstanceAssgdCmpstn _Composition $projection.SubstanceUUID = _Composition.SubstanceUUID -- Properties
[0..*] C_SubstanceAssgdPCPrpty _Properties _Properties.SubstanceUUID = $projection.SubstanceUUID
[0..1] P_SubstanceAssgdPCEctx _PCEctxProperty _PCEctxProperty.SubstanceUUID = $projection.SubstanceUUID
[0..1] P_SubstanceAssgdPCPhys _PCPhysProperty _PCPhysProperty.SubstanceUUID = $projection.SubstanceUUID
[0..1] P_SubstanceAssgdPCTx _PCPToxProperty _PCPToxProperty.SubstanceUUID = $projection.SubstanceUUID
[0..1] P_SubstanceAssgdPCSfty _PCPSftyProperty _PCPSftyProperty.SubstanceUUID = $projection.SubstanceUUID -- Counters to determine if variants facet shall be shown
[0..1] P_SubstanceVariantsCt _ListedSubstanceVariantsCt $projection.ListedSubstanceUUID = _ListedSubstanceVariantsCt.ListedSubstanceUUID
[0..1] P_SubstanceVarAssgmtCt _ListedSubstanceVarAssCt $projection.ActiveSubstanceUUID = _ListedSubstanceVarAssCt.SubstanceUUID --Value help
[0..1] I_RespUnitSubstanceVH _ResponsibleUnit $projection.ResponsibleUnit = _ResponsibleUnit.ResponsibleUnit

Annotations (20)

NameValueLevelField
EndUserText.label Manage Substances Compliance view
VDM.viewType #CONSUMPTION view
AbapCatalog.sqlViewName CSUBQRYTP view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.allowExtensions true view
ObjectModel.transactionalProcessingDelegated true view
ObjectModel.compositionRoot true view
ObjectModel.draftEnabled true view
ObjectModel.createEnabled true view
ObjectModel.updateEnabled EXTERNAL_CALCULATION view
ObjectModel.deleteEnabled EXTERNAL_CALCULATION view
ObjectModel.representativeKey SubstanceUUID view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #L view
Consumption.semanticObject CompanySubstance view
Search.searchable true view

Fields (53)

KeyFieldSource TableSource FieldDescription
KEY SubstanceUUID I_SubstanceTP SubstanceUUID
ActiveSubstanceUUID I_SubstanceTP ActiveSubstanceUUID
SubstanceName I_SubstanceTP SubstanceName
SubstanceInternalName I_SubstanceTP SubstanceInternalName
ListedSubstanceName
CntntListedSubstanceDfltName
CustListedSubstanceDfltName
CompanySubstanceName I_SubstanceTP CompanySubstanceName
ListedSubstanceUUID I_SubstanceTP ListedSubstanceUUID
ListedSubstance
CntntListedSubstance
CustListedSubstance
CASNumber
CntntCASNumber
CustCASNumber
ECNumber
CntntECNumber
CustECNumber
MolecularFormula
CntntMolecularFormula
CustMolecularFormula
ResponsibleUnit I_SubstanceTP ResponsibleUnit
ResponsibleUnitName _ResponsibleUnit ResponsibleUnitName
CreationUTCDateTime I_SubstanceTP CreationUTCDateTime
CreatedByUser I_SubstanceTP CreatedByUser
LastChangeUTCDateTime I_SubstanceTP LastChangeUTCDateTime
LastChangedByUser I_SubstanceTP LastChangedByUser
Specification I_SubstanceTP Specification
NmbrOfAvailLstdSubstVariants _ListedSubstanceVariantsCt VariantCount
NmbrOfAssgdLstdSubstVariants _ListedSubstanceVarAssCt VariantAssignmentCount
SubstGrpAssgmtRankingIsVisible
PCEctxPrptyNavgnLinkUUID _PCEctxProperty PCPrptyNavgnLinkUUID
PCEctxPrptyIsActive _PCEctxProperty PCPrptyIsActive
PCPhysPrptyNavgnLinkUUID _PCPhysProperty PCPrptyNavgnLinkUUID
PCPhysPrptyIsActive _PCPhysProperty PCPrptyIsActive
PCPrptyNavgnLinkUUID _PCPToxProperty PCPrptyNavgnLinkUUID
PCPrptyIsActive _PCPToxProperty PCPrptyIsActive
PCSftyPrptyNavgnLinkUUID _PCPSftyProperty PCPrptyNavgnLinkUUID
PCSftyPrptyIsActive _PCPSftyProperty PCPrptyIsActive
PolymerIsBsdOnOECDDef I_SubstanceTP PolymerIsBsdOnOECDDef
ProdCmplncLegalAreaasProdCmplncLegalArea
SubstanceAdditionalIdfrType
SubstanceAdditionalIdfrDesc
_SubstanceText _SubstanceText
_SubstanceTradeSecretText _SubstanceTradeSecretText
_SubstanceVarAssgmt _SubstanceVarAssgmt
_SubstanceGrpAssgmtTP _SubstanceGrpAssgmtTP
_SubstanceAdditionalIdfrTP _SubstanceAdditionalIdfrTP
_SubstanceGrpAsgmt _SubstanceGrpAsgmt
_ListedSubPrimNames _ListedSubPrimNames
_ResponsibleUnit _ResponsibleUnit
_Properties _Properties
_Composition _Composition
@EndUserText.label: 'Manage Substances Compliance'

@VDM.viewType: #CONSUMPTION

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

@AccessControl:
{
  authorizationCheck: #MANDATORY,
  // blocking not required (view does not expose personal data fields from sales data; user can not be blocked and no bp fields from user are exposed)

  personalData.blocking: #NOT_REQUIRED
}

@ClientHandling.algorithm: #SESSION_VARIABLE

@Metadata: {
  allowExtensions: true
}

@ObjectModel:
{
   transactionalProcessingDelegated: true,
   compositionRoot:   true,
   draftEnabled:      true,
   createEnabled:     true,
   updateEnabled:     'EXTERNAL_CALCULATION',
   //switched delete from false to dynamic: to tackle raised exception when canceling a draft

   deleteEnabled:     'EXTERNAL_CALCULATION',
   //use the specification id as semantic key (instead of substance name)

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

// for navigation from CoPilot

@Consumption.semanticObject: 'CompanySubstance'

@Search.searchable : true

/*----------------------------------------------------------------------------------------------------------------------
    Consumption view for the company substance.
------------------------------------------------------------------------------------------------------------------------*/

define view C_SubstanceQryTP

  --Select data from transactional view of substance
  as select from I_SubstanceTP as Substance

  --Variant Assignment
  association [0..*] to C_SubstanceVarAssgmtQryTP     as _SubstanceVarAssgmt        on  $projection.SubstanceUUID = _SubstanceVarAssgmt.SubstanceUUID

  --Group Assignment
  association [0..*] to C_SubstanceGrpAssgmt          as _SubstanceGrpAsgmt         on  $projection.listedsubstance = _SubstanceGrpAsgmt.ListedSubstance

  --Group Assignment IN EDIT MODE
  association [0..*] to C_SubstanceGrpAssgmtTP        as _SubstanceGrpAssgmtTP      on  $projection.SubstanceUUID = _SubstanceGrpAssgmtTP.SubstanceUUID

  -- Additional Identifiers
  association [0..*] to C_SubstanceAdditionalIdfrTP   as _SubstanceAdditionalIdfrTP on  $projection.SubstanceUUID = _SubstanceAdditionalIdfrTP.SubstanceUUID

  --Listed Substance Primary Names
  association [0..*] to C_SubstanceListedSubstanceTxt as _ListedSubPrimNames        on  $projection.ListedSubstanceUUID = _ListedSubPrimNames.ListedSubstanceUUID
  // Using SubstanceUUID as join condition should work because within I_SubstanceActiveDraft

  // the SubstanceUUID is determined dynamically (either draft UUID or active UUID depending

  // on draft exists or not). However the join condition via SubstanceUUID does not work and

  // no texts are shown in edit mode. As a work around we use the ActiveSubstanceUUID in the

  //  join condition

                                                                                    and $projection.ActiveSubstanceUUID = _ListedSubPrimNames.ActiveSubstanceUUID

  -- Language Dependent Substance Names
  association [0..*] to C_SubstanceTextTP             as _SubstanceText             on  $projection.SubstanceUUID = _SubstanceText.SubstanceUUID
  -- Substance Trade Secret Name
  association [0..*] to C_SubstanceTradeSecretTextTP  as _SubstanceTradeSecretText  on  $projection.SubstanceUUID = _SubstanceTradeSecretText.SubstanceUUID
  -- Polymer Composition
  association [0..*] to C_SubstanceAssgdCmpstn        as _Composition               on  $projection.SubstanceUUID = _Composition.SubstanceUUID

  -- Properties
  association [0..*] to C_SubstanceAssgdPCPrpty       as _Properties                on  _Properties.SubstanceUUID = $projection.SubstanceUUID
  association [0..1] to P_SubstanceAssgdPCEctx        as _PCEctxProperty            on  _PCEctxProperty.SubstanceUUID = $projection.SubstanceUUID
  association [0..1] to P_SubstanceAssgdPCPhys        as _PCPhysProperty            on  _PCPhysProperty.SubstanceUUID = $projection.SubstanceUUID
  association [0..1] to P_SubstanceAssgdPCTx          as _PCPToxProperty            on  _PCPToxProperty.SubstanceUUID = $projection.SubstanceUUID
  association [0..1] to P_SubstanceAssgdPCSfty        as _PCPSftyProperty           on  _PCPSftyProperty.SubstanceUUID = $projection.SubstanceUUID

  -- Counters to determine if variants facet shall be shown
  association [0..1] to P_SubstanceVariantsCt         as _ListedSubstanceVariantsCt on  $projection.ListedSubstanceUUID = _ListedSubstanceVariantsCt.ListedSubstanceUUID
  association [0..1] to P_SubstanceVarAssgmtCt        as _ListedSubstanceVarAssCt   on  $projection.ActiveSubstanceUUID = _ListedSubstanceVarAssCt.SubstanceUUID

  --Value help
  association [0..1] to I_RespUnitSubstanceVH         as _ResponsibleUnit           on  $projection.ResponsibleUnit = _ResponsibleUnit.ResponsibleUnit

{

  key Substance.SubstanceUUID,

      Substance.ActiveSubstanceUUID,

      @ObjectModel.readOnly: true
      Substance.SubstanceName,

      Substance.SubstanceInternalName,

      @ObjectModel:
      {
        readOnly: true
      //      foreignKey.association: '_ListedSubstanceVH' -> see comment for association _ListedSubstanceVH

      }
      cast(Substance._ListedSubstance.ListedSubstanceDefaultName as ehfnd_lisu_name_text_long) as ListedSubstanceName,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CntntListedSubstanceDfltName,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CustListedSubstanceDfltName,

      //used to search within company substance names

      @ObjectModel.readOnly: true
      Substance.CompanySubstanceName,

      @ObjectModel.readOnly: true
      Substance.ListedSubstanceUUID                                                            as ListedSubstanceUUID,

      // use association to read the listed substance data;

      // if data is read in views below, a refresh does not take place after the listed substance link was changed

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.ListedSubstance,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CntntListedSubstance,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CustListedSubstance,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CASNumber,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CntntCASNumber,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CustCASNumber,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.ECNumber,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CntntECNumber,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CustECNumber,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.MolecularFormula,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CntntMolecularFormula,

      @ObjectModel.readOnly: true
      Substance._ListedSubstance.CustMolecularFormula,

      @Consumption.valueHelp: '_ResponsibleUnit'
      @ObjectModel.text.element: ['ResponsibleUnitName']
      @UI.textArrangement: #TEXT_ONLY
      Substance.ResponsibleUnit,
      
      @ObjectModel.readOnly: true
      _ResponsibleUnit.ResponsibleUnitName as ResponsibleUnitName,

      Substance.CreationUTCDateTime,

      Substance.CreatedByUser,

      Substance.LastChangeUTCDateTime,

      //      Do not show Last Changed By

      //      @ObjectModel:

      //      {

      //        text.element:  [ 'UserDescription' ]

      //      }

      Substance.LastChangedByUser,

      //      Do not show Last Changed By

      //      @ObjectModel.readOnly : true

      //      @Semantics.text: true

      //      Substance._LastChangedByUser.UserDescription,


      @ObjectModel.readOnly: true
      @Search:
      {
        defaultSearchElement : true,
        fuzzinessThreshold: 0.8,
        ranking: #HIGH
      }
      Substance.Specification                                                                  as Specification,

      //used to set variants facet invisible

      @ObjectModel.readOnly: true
      _ListedSubstanceVariantsCt.VariantCount                                                  as NmbrOfAvailLstdSubstVariants,


      //used to set variants facet invisible

      @ObjectModel.readOnly: true
      _ListedSubstanceVarAssCt.VariantAssignmentCount                                          as NmbrOfAssgdLstdSubstVariants,


      // Substance Group Ranking Visability

      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_SUB_CALC_EXIT1'
      @ObjectModel.readOnly: true
      cast( 'X' as ehfnd_boolean )                                                             as SubstGrpAssgmtRankingIsVisible,

      // UUID for Navigation into Ecotox Property

      @ObjectModel.readOnly: true
      _PCEctxProperty.PCPrptyNavgnLinkUUID                                                     as PCEctxPrptyNavgnLinkUUID,

      // Active Indicator of Ecotox Property (needed for navigation)

      @ObjectModel.readOnly: true
      _PCEctxProperty.PCPrptyIsActive                                                          as PCEctxPrptyIsActive,

      // UUID for Navigation into PhysChem Property

      @ObjectModel.readOnly: true
      _PCPhysProperty.PCPrptyNavgnLinkUUID                                                     as PCPhysPrptyNavgnLinkUUID,

      // Active Indicator of Phys-Chem Property (needed for navigation)

      @ObjectModel.readOnly: true
      _PCPhysProperty.PCPrptyIsActive                                                          as PCPhysPrptyIsActive,

      // UUID for Navigation into Tox Property

      @ObjectModel.readOnly: true
      _PCPToxProperty.PCPrptyNavgnLinkUUID                                                     as PCPrptyNavgnLinkUUID,

      // Active Indicator of Tox Property (needed for navigation)

      @ObjectModel.readOnly: true
      _PCPToxProperty.PCPrptyIsActive                                                          as PCPrptyIsActive,

      // UUID for Navigation into SR Property

      @ObjectModel.readOnly: true
      _PCPSftyProperty.PCPrptyNavgnLinkUUID                                                    as PCSftyPrptyNavgnLinkUUID,

      // Active Indicator of SR Property (needed for navigation)

      @ObjectModel.readOnly: true
      _PCPSftyProperty.PCPrptyIsActive                                                         as PCSftyPrptyIsActive,


      Substance.PolymerIsBsdOnOECDDef                                                          as PolymerIsBsdOnOECDDef,

      --@ObjectModel.readOnly: true
      --_MonomerComposition.ProdCmplncLegalArea as ProdCmplncLegalArea,

      
      @ObjectModel: {
        readOnly: true,
        virtualElement: true,
        virtualElementCalculatedBy: 'ABAP:CL_EHFND_SUB_ADDIT_IDENT_EXIT',
        filter.transformedBy: 'ABAP:CL_EHFND_SUB_ADDIT_IDENT_EXIT'
      }
      cast('' as ehfnd_sub_add_identifier )                                                    as SubstanceAdditionalIdfrType,

     
      @ObjectModel: {
        readOnly: true,
        virtualElement: true,
        virtualElementCalculatedBy: 'ABAP:CL_EHFND_SUB_ADDIT_IDENT_EXIT',
        filter.transformedBy: 'ABAP:CL_EHFND_SUB_ADDIT_IDENT_EXIT'
      }
      cast('' as ehfnd_sub_add_identif_concat )                                                as SubstanceAdditionalIdfrDesc,

      // Exposed Associations

      @ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
      _SubstanceText,

      @ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
      _SubstanceTradeSecretText,

      @ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
      _SubstanceVarAssgmt,

      @ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
      _SubstanceGrpAssgmtTP,

      @ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
      _SubstanceAdditionalIdfrTP,

      _SubstanceGrpAsgmt,
      _ListedSubPrimNames,
      _ResponsibleUnit,
      _Properties,
      _Composition

}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_RESPUNITSUBSTANCEVH",
"I_SUBSTACTIVEDRAFTLSTDSUBST",
"I_SUBSTANCETP",
"P_SUBSTANCEASSGDPCECTX",
"P_SUBSTANCEASSGDPCPHYS",
"P_SUBSTANCEASSGDPCSFTY",
"P_SUBSTANCEASSGDPCTX",
"P_SUBSTANCEVARASSGMTCT",
"P_SUBSTANCEVARIANTSCT"
],
"ASSOCIATED":
[
"C_SUBSTANCEADDITIONALIDFRTP",
"C_SUBSTANCEASSGDCMPSTN",
"C_SUBSTANCEASSGDPCPRPTY",
"C_SUBSTANCEGRPASSGMT",
"C_SUBSTANCEGRPASSGMTTP",
"C_SUBSTANCELISTEDSUBSTANCETXT",
"C_SUBSTANCETEXTTP",
"C_SUBSTANCETRADESECRETTEXTTP",
"C_SUBSTANCEVARASSGMTQRYTP",
"I_RESPUNITSUBSTANCEVH",
"P_SUBSTANCEASSGDPCECTX",
"P_SUBSTANCEASSGDPCPHYS",
"P_SUBSTANCEASSGDPCSFTY",
"P_SUBSTANCEASSGDPCTX",
"P_SUBSTANCEVARASSGMTCT",
"P_SUBSTANCEVARIANTSCT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/