I_SubstanceLstdSubstAnlyts1

DDL: I_SUBSTANCELSTDSUBSTANLYTS1 SQL: ISUBLSTDSUBA1 Type: view COMPOSITE

Company Substance and Listed Substance

I_SubstanceLstdSubstAnlyts1 is a Composite CDS View that provides data about "Company Substance and Listed Substance" in SAP S/4HANA. It reads from 1 data source (I_Substance) and exposes 4 fields. It has 4 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_Substance Substance from

Associations (4)

CardinalityTargetAliasCondition
[0..1] I_ListedSubstanceCust _LisuCustRoot Substance.ListedSubstanceUUID = _LisuCustRoot.ListedSubstanceUUID --
[0..1] I_ListedSubstanceSAP _LisuContRoot Substance.ListedSubstanceUUID = _LisuContRoot.ListedSubstanceUUID --
[0..1] I_ListedSubstanceDefNameCust _LisuCustName Substance.ListedSubstanceUUID = _LisuCustName.ListedSubstanceUUID and _LisuCustName.Language = $session.system_language --
[0..1] I_ListedSubstanceDefNameSAP _LisuContName Substance.ListedSubstanceUUID = _LisuContName.ListedSubstanceUUID and _LisuContName.Language = $session.system_language

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName ISUBLSTDSUBA1 view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
EndUserText.label Company Substance and Listed Substance view
AccessControl.authorizationCheck #CHECK view
ClientHandling.type #INHERITED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #MIXED view

Fields (4)

KeyFieldSource TableSource FieldDescription
SubstanceUUIDasSubstanceUUID
ListedSubstanceUUIDasListedSubstanceUUID
ResponsibleUnitasResponsibleUnit
SubstanceName
@AbapCatalog.sqlViewName: 'ISUBLSTDSUBA1'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true

@EndUserText.label: 'Company Substance and Listed Substance'

@AccessControl.authorizationCheck: #CHECK

@ClientHandling:
{
  type: #INHERITED,
  algorithm: #SESSION_VARIABLE
}

@VDM.viewType: #COMPOSITE

@ObjectModel.usageType:{ serviceQuality: #C,
                         sizeCategory:  #L,
                         dataClass: #MIXED }
                         
                         
/*----------------------------------------------------------------------------------------------------------------------
    Company substance and its related listed substance from Customer (ehfndd_lisu_rt) and SAP (ehfndi_lisu_rt)
------------------------------------------------------------------------------------------------------------------------*/
define view I_SubstanceLstdSubstAnlyts1
  as select from I_Substance as Substance
  -- Association to Listed Substance from Customer
  association [0..1] to I_ListedSubstanceCust        as _LisuCustRoot on  Substance.ListedSubstanceUUID = _LisuCustRoot.ListedSubstanceUUID
  -- Association to Listed Substance from SAP
  association [0..1] to I_ListedSubstanceSAP         as _LisuContRoot on  Substance.ListedSubstanceUUID = _LisuContRoot.ListedSubstanceUUID
  -- Association to Listed Substance Default Name from Customer
  association [0..1] to I_ListedSubstanceDefNameCust as _LisuCustName on  Substance.ListedSubstanceUUID = _LisuCustName.ListedSubstanceUUID
                                                                      and _LisuCustName.Language        = $session.system_language
  -- Association to  Listed Substance Default Name from SAP
  association [0..1] to I_ListedSubstanceDefNameSAP  as _LisuContName on  Substance.ListedSubstanceUUID = _LisuContName.ListedSubstanceUUID
                                                                      and _LisuContName.Language        = $session.system_language

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

      -- UUID of Listed Substance
  key Substance.ListedSubstanceUUID                                                                  as       ListedSubstanceUUID,

      -- Responsible Unit (used for DCL)
      Substance.ResponsibleUnit                                                                      as       ResponsibleUnit,

      -- Internal Name of Company Substance respectifely Default Name of Listed Substance (Remark: Coalesce does not work on intitial value)
      case
        when SubstanceInternalName is not initial then SubstanceInternalName
        when _LisuCustName.ListedSubstanceName is not null then _LisuCustName.ListedSubstanceName // Remark: Do not use 'is not initial'

        else _LisuContName.ListedSubstanceName
      end                                                                                            as       CompanySubstanceName,
      -- Listed Substance
      cast( coalesce(
                      _LisuCustRoot.ListedSubstance,
                      _LisuContRoot.ListedSubstance
                    ) as ehfnd_regbaslst_sub preserving type )                                       as       ListedSubstance,
      -- CAS Number of Listed Substance
      cast( coalesce(
                      _LisuCustRoot.CASNumber,
                      _LisuContRoot.CASNumber
                    ) as ehfnd_chm_cas_no preserving type )                                          as       CASNumber,
      -- EC Number of Listed Substance
      cast( coalesce(
                      _LisuCustRoot.ECNumber,
                      _LisuContRoot.ECNumber
                    )  as ehfnd_lisu_ec_number preserving type )                                     as       ECNumber,
      -- Group Indicator of Listed Substance
      cast( coalesce(
                      _LisuCustRoot.ListedSubstanceIsGroup,
                      _LisuContRoot.ListedSubstanceIsGroup
                    )  as ehfnd_lisu_isgroup_ind preserving type )                                   as       ListedSubstanceIsGroup,

      // Substance Name

      _SubstanceText[1: Language = $session.system_language].SubstanceName                           as       SubstanceName
      
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_LISTEDSUBSTANCECUST",
"I_LISTEDSUBSTANCEDEFNAMECUST",
"I_LISTEDSUBSTANCEDEFNAMESAP",
"I_LISTEDSUBSTANCESAP",
"I_SUBSTANCE",
"I_SUBSTANCETEXT"
],
"ASSOCIATED":
[
"I_LISTEDSUBSTANCECUST",
"I_LISTEDSUBSTANCEDEFNAMECUST",
"I_LISTEDSUBSTANCEDEFNAMESAP",
"I_LISTEDSUBSTANCESAP"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/