P_AssociatedMatlCmpstnProd

DDL: P_ASSOCIATEDMATLCMPSTNPROD Type: view CONSUMPTION

Assoc. MatlBased Compositon In Process and Released for UP

P_AssociatedMatlCmpstnProd is a Consumption CDS View that provides data about "Assoc. MatlBased Compositon In Process and Released for UP" in SAP S/4HANA. It reads from 1 data source (I_ChmlCmplncInfo) and exposes 8 fields. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_ChmlCmplncInfo ChemicalComplianceInfo from

Associations (1)

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

Annotations (8)

NameValueLevelField
EndUserText.label Assoc. MatlBased Compositon In Process and Released for UP view
AbapCatalog.sqlViewName PAAMBCMPSUP 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 (8)

KeyFieldSource TableSource FieldDescription
ChmlCmplncInfoUUID
ChmlCompositionInProcessUUID
ChmlCmpstnInProcIsActiveEntity
ChmlCompositionReleasedUUID
ReleasedByUser
ChmlCmpstnReldIsActiveEntity
ChmlCompositionTypeasChmlCompositionType
ProdCmplncLegalAreaasProdCmplncLegalArea
@EndUserText.label: 'Assoc. MatlBased Compositon In Process and Released for UP'
--                  for Unpackaged Product
@AbapCatalog:
{
  -- SQL view name (16 characters)
  sqlViewName: 'PAAMBCMPSUP',

  --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_AssociatedMatlCmpstnProd
  --Select data from basic view 'Chemical Compliance Information' (Logical key of composition)
  as select from           I_ChmlCmplncInfo             as ChemicalComplianceInfo

  --Join data from composition with status In Process => Active or draft composition
    left outer to one join P_AssociatedMatlInProcCmpstn as CompositionInProcess on ChemicalComplianceInfo.ChmlCmplncInfoUUID = CompositionInProcess.ChmlCmplncInfoUUID

  --Join data from composition with status Released => only active chemical composition, because released composition is not editable
    left outer to one join P_AssociatedMatlReldCmpstn   as CompositionReleased  on ChemicalComplianceInfo.ChmlCmplncInfoUUID = CompositionReleased.ChmlCmplncInfoUUID

  --Constants
  association [1..1] to P_CChmlCmplConstants as _Constants on _Constants.Constant1 = _Constants.Constant1
{
      --UUID of chemical compliance information
  key ChemicalComplianceInfo.ChmlCmplncInfoUUID,

      --UUID of chemical composition in process
      CompositionInProcess.ChmlCompositionInProcessUUID,

      --Status In Process
      case
        when CompositionInProcess.ChmlCmpstnInProcStatus = 'IP' then
          CompositionInProcess.ChmlCmpstnInProcStatus
        when CompositionInProcess.ChmlCmpstnInProcStatus = '' or CompositionInProcess.ChmlCmpstnInProcStatus is null then
      --Set NE if the In Process Version is not existing
          _Constants[inner].ConstantNotExisting
      end                                                                                           as ChmlCmpstnInProcStatus,

      --Indicator: Is active entity of chemical composition with status In Process
      CompositionInProcess.ChmlCmpstnInProcIsActiveEntity,

      --UUID of chemical composition released
      CompositionReleased.ChmlCompositionReleasedUUID,

      --Status Released
      case
        when CompositionReleased.ChmlCmpstnReldStatus = 'RE'
          then CompositionReleased.ChmlCmpstnReldStatus
        when CompositionReleased.ChmlCmpstnReldStatus = ''
             or CompositionReleased.ChmlCmpstnReldStatus is null
      --Set NE if the Released Version is not existing
          then _Constants[inner].ConstantNotExisting
      end                                                                                           as ChmlCmpstnReldStatus,

      --Released by User
      CompositionReleased.ReleasedByUser,

      --Indicator: Is active entity of chemical composition with status In Process
      CompositionReleased.ChmlCmpstnReldIsActiveEntity,

      -- Composition Type
      coalesce( CompositionInProcess.ChmlCompositionType, CompositionReleased.ChmlCompositionType ) as ChmlCompositionType,

      -- Legal Area
      coalesce( CompositionInProcess.ProdCmplncLegalArea, CompositionReleased.ProdCmplncLegalArea ) as ProdCmplncLegalArea,

      --Navigation Link UUID
      case
        when CompositionInProcess.ChmlCmpstnInProcStatus = 'IP' then
          CompositionInProcess.ChmlCompositionInProcessUUID
        when CompositionReleased.ChmlCmpstnReldStatus = 'RE' then
          CompositionReleased.ChmlCompositionReleasedUUID
      end                                                                                           as ChmlCmpstnNavgnLinkUUID,

      --Active Indicator
      --We always navigate to the active version
      cast( _Constants[inner].ConstantTrue as sdraft_is_active preserving type )                    as ChmlCmpstnIsActive

}
-- Only for CCI type 'Bulk' and CCI role 'Produced'
where
      ChmlCmplncInfoType = 'BU'
  and MaterialIsProduced = 'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCINFO",
"P_ASSOCIATEDMATLINPROCCMPSTN",
"P_ASSOCIATEDMATLRELDCMPSTN",
"P_CCHMLCMPLCONSTANTS"
],
"ASSOCIATED":
[
"P_CCHMLCMPLCONSTANTS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/