P_ChmlAnalyticComposition

DDL: P_CHMLANALYTICCOMPOSITION Type: view CONSUMPTION Package: EHFND_BO_CCI

Chemical Analytical Composition

P_ChmlAnalyticComposition is a Consumption CDS View that provides data about "Chemical Analytical Composition" in SAP S/4HANA. It reads from 1 data source (I_ChmlCmplncInfo) and exposes 3 fields. It has 2 associations to related views. Part of development package EHFND_BO_CCI.

Data Sources (1)

SourceAliasJoin Type
I_ChmlCmplncInfo ChemicalComplianceInfo from

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_ChmlCompositionStsActnText _StatusDetailText _StatusDetailText.ChmlCompositionStatus = 'NE' and _StatusDetailText.Language = $session.system_language
[1..1] P_CChmlCmplConstants _Constants _Constants.ConstantNotExisting = _Constants.ConstantNotExisting

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PCCANCMPSTN view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
VDM.private true view

Fields (3)

KeyFieldSource TableSource FieldDescription
ChmlCmplncInfoUUID
ValidityStartDateTimeasReleaseDateTime
_Constants _Constants
--Chemical Analytical Composition
@AbapCatalog:
{
  -- SQL view name (16 characters)
  sqlViewName: 'PCCANCMPSTN',

  --If it's true, the filter conditions are compared and, if they match, the associated join expression is evaluated only once
  compiler.compareFilter: 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_ChmlAnalyticComposition
  --Select data from basic view 'Chemical Compliance Information'
  as select from           I_ChmlCmplncInfo  as ChemicalComplianceInfo

  --Join data from analytical composition with status In Process => only active chemical composition
    left outer to one join I_ChmlComposition as AnalyticCompositionInProcess on  ChemicalComplianceInfo.ChmlCmplncInfoUUID          = AnalyticCompositionInProcess.ChmlCmplncInfoUUID
                                                                             and AnalyticCompositionInProcess.ChmlCompositionType   = 'ANALYTIC1'
                                                                             and AnalyticCompositionInProcess.ChmlCompositionStatus = 'IP'

  --Join data from analytical composition with status Released => only active chemical composition, because released composition is not editable
    left outer to one join I_ChmlComposition as AnalyticCompositionReleased  on  ChemicalComplianceInfo.ChmlCmplncInfoUUID         = AnalyticCompositionReleased.ChmlCmplncInfoUUID
                                                                             and AnalyticCompositionReleased.ChmlCompositionType   = 'ANALYTIC1'
                                                                             and AnalyticCompositionReleased.ChmlCompositionStatus = 'RE'

  association [0..1] to I_ChmlCompositionStsActnText as _StatusDetailText on  _StatusDetailText.ChmlCompositionStatus = 'NE'
                                                                          and _StatusDetailText.Language              = $session.system_language

  association [1..1] to P_CChmlCmplConstants         as _Constants        on  _Constants.ConstantNotExisting = _Constants.ConstantNotExisting

{
      --UUID of chemical compliance information
  key ChemicalComplianceInfo.ChmlCmplncInfoUUID,

      --UUID of chemical composition in process
      AnalyticCompositionInProcess.ChmlCompositionUUID                                     as ChmlCompositionInProcessUUID,

      --Change date of composition in status In Process
      cast( AnalyticCompositionInProcess.LastChangeUTCDateTime as ehfnd_cci_processed_ts ) as LastChangeUTCDateTime,

      --Status In Process
      case
        when AnalyticCompositionInProcess.ChmlCompositionStatus = 'IP'
          then AnalyticCompositionInProcess.ChmlCompositionStatus
        else
          _Constants[inner].ConstantNotExisting
      end                                                                                  as ChmlCmpstnInProcStatus,

      --Action Name
      case
        when AnalyticCompositionInProcess.ChmlCompositionStatus = 'IP'
          then AnalyticCompositionInProcess._CompositionStatus._DetailText[1: Language = $session.system_language ].ChmlCompositionStatusName
        else
          _StatusDetailText.ChmlCompositionStatusName
      end                                                                                  as ChmlCmpstnInProcActionName,

      --Indicator: Is active entity of chemical composition with status In Process
      cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type )            as ChmlCmpstnInProcIsActiveEntity,

      --UUID of chemical composition released
      AnalyticCompositionReleased.ChmlCompositionUUID                                      as ChmlCompositionReleasedUUID,

      --Release date of composition is status Released
      AnalyticCompositionReleased.ValidityStartDateTime                                    as ReleaseDateTime,

      --Status Released
      case
        when AnalyticCompositionReleased.ChmlCompositionStatus = 'RE'
          then AnalyticCompositionReleased.ChmlCompositionStatus
        else
          _Constants[inner].ConstantNotExisting
      end                                                                                  as ChmlCmpstnReldStatus,

      case
        when AnalyticCompositionReleased.ChmlCompositionStatus = 'RE'
          then AnalyticCompositionReleased._CompositionStatus._DetailText[1: Language = $session.system_language ].ChmlCompositionStatusName
        else
          _StatusDetailText.ChmlCompositionStatusName
      end                                                                                  as ChmlCmpstnReldActionName,

      --Indicator: Is active entity of chemical composition with status In Process
      cast(_Constants[inner].ConstantTrue as sdraft_is_active preserving type )            as ChmlCmpstnReldIsActiveEntity,

      _Constants
}