P_SubstanceAssgdPCEctx

DDL: P_SUBSTANCEASSGDPCECTX Type: view CONSUMPTION

Assoc. Ecological Information Property

P_SubstanceAssgdPCEctx is a Consumption CDS View that provides data about "Assoc. Ecological Information Property" in SAP S/4HANA. It reads from 1 data source (I_Substance) and exposes 7 fields. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_Substance Substance from

Associations (1)

CardinalityTargetAliasCondition
[1..1] P_CChmlCmplConstants _Constants _Constants.Constant1 = _Constants.Constant1

Annotations (8)

NameValueLevelField
EndUserText.label Assoc. Ecological Information Property view
AbapCatalog.sqlViewName PSUBASGDECTX view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
VDM.private true view

Fields (7)

KeyFieldSource TableSource FieldDescription
SubstanceUUIDasSubstanceUUID
PCEctxPrptyUUIDasPCPrptyInProcessUUID
PCPrptyProcgStsasPCPrptyInProcProcgSts
PCEctxPrptyUUIDasPCPrptyReleasedUUID
PCPrptyProcgStsasPCPrptyReldProcgSts
ResponsibleUnit I_Substance ResponsibleUnit
ConstantFalseendasPCPrptyIsActive
@EndUserText.label: 'Assoc. Ecological Information Property'
--                  for Substance
@AbapCatalog:
{
  -- SQL view name (16 characters)
  sqlViewName: 'PSUBASGDECTX',

  --If it's true, the filter conditions are compared and, if they match, the associated join expression is evaluated only once
  compiler.compareFilter: true,
  preserveKey: true
}

--Access Control: Authorizations Checks
@AccessControl:
{
   authorizationCheck: #NOT_REQUIRED
}

--Client Handling of the view
@ClientHandling.algorithm: #SESSION_VARIABLE

--VDM view type
@VDM.viewType: #CONSUMPTION
@VDM.private: true

define view P_SubstanceAssgdPCEctx
  --Select data from basic view 'Substance'
  as select from           I_Substance      as Substance

  --Join data from physical chemical propertes with status In Process
    left outer to one join I_PCEctxProperty as EcotoxInProcess on  Substance.SubstanceUUID         = EcotoxInProcess.SubstanceUUID
                                                               and EcotoxInProcess.PCPrptyProcgSts = 'IP'

  --Join data from physical chemical propertes with status Released
    left outer to one join I_PCEctxProperty as EcotoxReleased  on  Substance.SubstanceUUID        = EcotoxReleased.SubstanceUUID
                                                               and EcotoxReleased.PCPrptyProcgSts = 'RE'

  --Dummy constant selection to solve issues with case-statements with constants (not null-preserving)
  association [1..1] to P_CChmlCmplConstants as _Constants on _Constants.Constant1 = _Constants.Constant1

{
      --UUID of substance
  key Substance.SubstanceUUID                                                   as SubstanceUUID,

      --Property Type
  key cast('EHFNDD_ECTX' as ehfnd_prop_property_root )                          as PCPrptyRootType,

      --UUID of in process version
      EcotoxInProcess.PCEctxPrptyUUID                                           as PCPrptyInProcessUUID,

      --Status In Process
      EcotoxInProcess.PCPrptyProcgSts                                           as PCPrptyInProcProcgSts,

      --Is Active entity
      cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as PCPrptyInProcIsActive,

      --UUID of released version
      EcotoxReleased.PCEctxPrptyUUID                                            as PCPrptyReleasedUUID,

      --Status Released
      EcotoxReleased.PCPrptyProcgSts                                            as PCPrptyReldProcgSts,

      --Is Active entity
      cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as PCPrptyReldIsActive,

      Substance.ResponsibleUnit                                                 as ResponsibleUnit,
      
      --Navigation Link UUID
      case
        when EcotoxInProcess.PCPrptyProcgSts = 'IP' then
          EcotoxInProcess.PCEctxPrptyUUID
        when EcotoxReleased.PCPrptyProcgSts = 'RE' then
          EcotoxReleased.PCEctxPrptyUUID
        else
          _Constants.ConstantEmptyRaw16
      end                                                                       as PCPrptyNavgnLinkUUID,

      --Active Indicator
      case
        when EcotoxInProcess.PCPrptyProcgSts = 'IP'
          then cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type )
        when EcotoxReleased.PCPrptyProcgSts = 'RE'
          then cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type )
        else
          _Constants.ConstantFalse
      end                                                                       as PCPrptyIsActive      
      
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PCECTXPROPERTY",
"I_SUBSTANCE",
"P_CCHMLCMPLCONSTANTS"
],
"ASSOCIATED":
[
"P_CCHMLCMPLCONSTANTS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/