P_CmplRqRsltTransientFields

DDL: P_CMPLRQRSLTTRANSIENTFIELDS SQL: PCRRCCITRANSIENT Type: view CONSUMPTION

P_CmplRqRsltTransientFields is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_CmplRqRslt) and exposes 5 fields with key field CmplRqRsltUUID. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_CmplRqRslt CmplRqRslt from

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_ChmlCmplncInfo _ChmlCmplncInfo $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID

Annotations (7)

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

Fields (5)

KeyFieldSource TableSource FieldDescription
KEY CmplRqRsltUUID CmplRqRsltUUID
ChmlCmplncInfoUUID ChmlCmplncInfoUUID
ChmlSuplrMatlUUID ChmlSuplrMatlUUID
SubstanceUUID SubstanceUUID
CmplRqVersUUID CmplRqVersUUID
@AbapCatalog.sqlViewName: 'PCRRCCITRANSIENT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM: {
  private: true,
  viewType: #CONSUMPTION
}
/* 
   Purpose of the view: Provides several flags which are calculated depending on the processingstatus of the corresponding CRR
                        Those flags being relevant to determine whether the CCI is a RM or not for example
   
   The role flags are stored at a CRR when it is released.
   That's why we need to read these role flags from different sources depending on the processing status
   
   Following logic is applied in the calculation:
    - If the ProcessingStatus of the CRR is "In Process":             take the required information from the CCI
    - If the ProcessingStatus of the CRR is "Released" or "Outdated": take the required information from the CRR
   
*/

define view P_CmplRqRsltTransientFields
  as select from I_CmplRqRslt as CmplRqRslt

  // Relevant for calculation of the "MaterialIs"-flags

  association [0..1] to I_ChmlCmplncInfo             as _ChmlCmplncInfo            on  $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID
{
  key CmplRqRsltUUID,
      ChmlCmplncInfoUUID,
      ChmlSuplrMatlUUID,
      SubstanceUUID,
      CmplRqVersUUID,

      case
        when CmplRqRsltProcessingStatus = 'IP'
          then _ChmlCmplncInfo.MaterialIsSold
        when CmplRqRsltProcessingStatus = 'RE'
          or CmplRqRsltProcessingStatus = 'OD'
          then MaterialIsSold
      end                                                   as MaterialIsSold,

      case
        when CmplRqRsltProcessingStatus = 'IP'
          then _ChmlCmplncInfo.MaterialIsTransported
        when CmplRqRsltProcessingStatus = 'RE'
          or CmplRqRsltProcessingStatus = 'OD'
          then MaterialIsTransported
      end                                                   as MaterialIsTransported,

      case
        when CmplRqRsltProcessingStatus = 'IP'
          then _ChmlCmplncInfo.MaterialIsSourced
        when CmplRqRsltProcessingStatus = 'RE'
          or CmplRqRsltProcessingStatus = 'OD'
          then MaterialIsSourced
      end                                                   as MaterialIsSourced,

      case
        when CmplRqRsltProcessingStatus = 'IP'
          then _ChmlCmplncInfo.MaterialIsProduced
        when CmplRqRsltProcessingStatus = 'RE'
          or CmplRqRsltProcessingStatus = 'OD'
          then MaterialIsProduced
      end                                                   as MaterialIsProduced

}
where
     CmplRqRsltProcessingStatus = 'IP'
  or CmplRqRsltProcessingStatus = 'RE'
  or CmplRqRsltProcessingStatus = 'OD'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCINFO",
"I_CMPLRQRSLT"
],
"ASSOCIATED":
[
"I_CHMLCMPLNCINFO"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/