I_ChmlCmplncCmplRqRsltInPrgrs

DDL: I_CHMLCMPLNCCMPLRQRSLTINPRGRS SQL: ICCCRRIP Type: view COMPOSITE

In Progress CRRs for UP and PP

I_ChmlCmplncCmplRqRsltInPrgrs is a Composite CDS View that provides data about "In Progress CRRs for UP and PP" in SAP S/4HANA. It reads from 2 data sources (I_ChmlCmplncInfo, I_ChmlCmplncInfo) and exposes 17 fields with key fields ChmlCmplncInfoUUID, ChmlCmplncProdUUID, CmplRqVersUUID, CmplRqRsltProcessingStatus, ChmlCmplncProdUUID. It has 3 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_ChmlCmplncInfo UnpackagedProduct from
I_ChmlCmplncInfo UnpackagedProduct union_all

Associations (3)

CardinalityTargetAliasCondition
[0..*] I_ChmlCmplncCmplRqRsltCombined _Combined _Combined.ChmlCmplncInfoUUID = $projection.ChmlCmplncInfoUUID and _Combined.CmplRqRsltProcessingStatus = 'IP'
[0..1] I_ChmlCmplncInfo _ChmlCmplncInfo _ChmlCmplncInfo.ChmlCmplncInfoUUID = $projection.ChmlCmplncProdUUID
[1..1] P_ChmlCmplConstants _Constants _Constants.Constant0 = _Constants.Constant0

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName ICCCRRIP view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
EndUserText.label In Progress CRRs for UP and PP view
AccessControl.authorizationCheck #CHECK view
ClientHandling.type #INHERITED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
ObjectModel.Link https view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #C view
Search.searchable false view

Fields (17)

KeyFieldSource TableSource FieldDescription
KEY ChmlCmplncInfoUUID I_ChmlCmplncInfo ChmlCmplncInfoUUID
KEY ChmlCmplncProdUUID I_ChmlCmplncInfo ChmlCmplncInfoUUID
KEY CmplRqVersUUID _Combined CmplRqVersUUID
KEY CmplRqRsltProcessingStatus _Combined CmplRqRsltProcessingStatus
PrelimCmplRqRsltUUID _Combined PrelimCmplRqRsltUUID
Processor _Combined Processor
ReldCmplRqRsltUUIDendasCmplRqRsltUUID
_Combined _Combined
ChmlCmplncInfoUUIDasChmlCmplncInfoUUID
KEY ChmlCmplncProdUUID I_ChmlCmplncInfo ChmlCmplncInfoUUID
KEY CmplRqVersUUID _Combined CmplRqVersUUID
KEY CmplRqRsltProcessingStatus _Combined CmplRqRsltProcessingStatus
PrelimCmplRqRsltUUID _Combined PrelimCmplRqRsltUUID
Processor _Combined Processor
ReldCmplRqRsltUUIDendasCmplRqRsltUUID
_Combined _Combined
_ChmlCmplncInfo _ChmlCmplncInfo
@AbapCatalog.sqlViewName: 'ICCCRRIP'
@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true

@EndUserText.label: 'In Progress CRRs for UP and PP'

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

--Client Handling of the view
@ClientHandling:
{
  type: #INHERITED,
  algorithm: #SESSION_VARIABLE
}

--VDM view type
@VDM.viewType: #COMPOSITE

@ObjectModel:
{

  --Performance Annotations
    --Mandatory for non-private CDS views
    --Optional for private CDS views
    --Link: https://wiki.wdf.sap.corp/wiki/display/SuiteCDS/CDS+View+Performance

  usageType:
  {
    dataClass: #MIXED,
    sizeCategory: #XL,
    serviceQuality: #C
  }
}

@Search.searchable: false

/*----------------------------------------------------------------------------------------------------------------------
 Purpose: This view returns the in progress CRR information of unpackaged product and its related packaged products
------------------------------------------------------------------------------------------------------------------------*/

define view I_ChmlCmplncCmplRqRsltInPrgrs

  // Take into account CRRs of the unpackaged product

  as select from I_ChmlCmplncInfo as UnpackagedProduct

  // use ChmlCmplncProdUUID to have the same association like in the lower select (no issue as info and prod UUID are equal here)

  association [0..*] to I_ChmlCmplncCmplRqRsltCombined as _Combined       on  _Combined.ChmlCmplncInfoUUID         = $projection.ChmlCmplncInfoUUID
                                                                          and _Combined.CmplRqRsltProcessingStatus = 'IP'
  association [0..1] to I_ChmlCmplncInfo               as _ChmlCmplncInfo on  _ChmlCmplncInfo.ChmlCmplncInfoUUID = $projection.ChmlCmplncProdUUID

  // dummy constant selection to avoid issues with case statement with constants (not null-preserving topic)

  association [1..1] to P_ChmlCmplConstants            as _Constants      on  _Constants.Constant0 = _Constants.Constant0
{
      // UUID of unpackaged product

  key UnpackagedProduct.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,

      // as the UUID of packaged product does not exist we set the UUID of the unpackaged product instead

  key UnpackagedProduct.ChmlCmplncInfoUUID as ChmlCmplncProdUUID,

      // CRR Info

  key _Combined.CmplRqVersUUID, // D054696 - 350813 (2018)

  key _Combined.CmplRqRsltProcessingStatus, // D054696 - 350813 (2018)


      _Combined.PrelimCmplRqRsltUUID,
      //      _Combined.ReldCmplRqRsltUUID,

      _Combined.Processor,

      case
        when _Combined.PrelimCmplRqRsltUUID is not null then _Combined.PrelimCmplRqRsltUUID
        when _Combined.ReldCmplRqRsltUUID is not null then _Combined.ReldCmplRqRsltUUID
      end                                  as CmplRqRsltUUID,

      // CK: CRR Refactoring 03.05.2021

      --Return the preliminary status
      cast(
        case
          when _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantInProgress
            then _Combined._PrelimCmplRqRslt.CmplRqRsltPrelimCmplncSts
          when _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantReleased
            then _Combined._ReleasedCmplRqRslt.CmplRqRsltPrelimCmplncSts
          end as ehfnd_crr_prelim_comp_stat preserving type
      )                                    as CmplRqRsltPrelimCmplncSts,

      --Related composition type
      case
      //        when _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantInProgress

        when _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantInProgress
//                then _Combined._CalcdCmplRqRslt.ChmlCompositionType

          then _Combined._PrelimCmplRqRslt.ChmlCompositionType
        when _Combined.CmplRqRsltProcessingStatus <> _Constants[inner].ConstantInProgress
          then _Combined._ReleasedCmplRqRslt.ChmlCompositionType
      end                                  as ChmlCompositionType,

      -- Indicator that there is a released version
      cast(
        case
          when _Combined.ReldCmplRqRsltUUID is not null
          then _Constants[inner].ConstantTrue
        end as ehfnd_crr_has_rel_version preserving type
      )                                    as CmplRqRsltHasReleasedVersion,

      _Combined,
      _ChmlCmplncInfo
}
-- Only for Unpackaged Product
where
       UnpackagedProduct.ChmlCmplncInfoType    = 'BU'
  and(
       UnpackagedProduct.MaterialIsSold        = 'X'
    or UnpackagedProduct.MaterialIsTransported = 'X'
    or UnpackagedProduct.MaterialIsProduced    = 'X'
  )

// Take into account CRRs of the packaged product(s)

union all select from I_ChmlCmplncInfo       as UnpackagedProduct
  join                I_ChmlCmplncProdAssgmt as PackagedProduct on PackagedProduct.ChmlCmplncProdUUID = UnpackagedProduct.ChmlCmplncInfoUUID

association [0..*] to I_ChmlCmplncCmplRqRsltCombined as _Combined       on  _Combined.ChmlCmplncInfoUUID         = $projection.ChmlCmplncInfoUUID
                                                                        and _Combined.CmplRqRsltProcessingStatus = 'IP'
association [0..1] to I_ChmlCmplncInfo               as _ChmlCmplncInfo on  _ChmlCmplncInfo.ChmlCmplncInfoUUID = $projection.ChmlCmplncProdUUID

// dummy constant selection to avoid issues with case statement with constants (not null-preserving topic)

association [1..1] to P_ChmlCmplConstants            as _Constants      on  _Constants.Constant0 = _Constants.Constant0

{
       // UUID of packaged product

  key  PackagedProduct.ChmlCmplncInfoUUID   as ChmlCmplncInfoUUID, // in case of a packaged product set UUID of the packaged product


       // UUID of unpackaged product

  key  UnpackagedProduct.ChmlCmplncInfoUUID as ChmlCmplncProdUUID,

       // CRR Info

  key  _Combined.CmplRqVersUUID,
  key  _Combined.CmplRqRsltProcessingStatus,
       _Combined.PrelimCmplRqRsltUUID,
       //       _Combined.ReldCmplRqRsltUUID,

       _Combined.Processor,

       case
         when _Combined.PrelimCmplRqRsltUUID is not null then _Combined.PrelimCmplRqRsltUUID
         when _Combined.ReldCmplRqRsltUUID is not null then _Combined.ReldCmplRqRsltUUID
       end                                  as CmplRqRsltUUID,


       --Return the preliminary status
      cast(
        case
          when _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantInProgress
            then _Combined._PrelimCmplRqRslt.CmplRqRsltPrelimCmplncSts
          when _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantReleased
            then _Combined._ReleasedCmplRqRslt.CmplRqRsltPrelimCmplncSts
          end as ehfnd_crr_prelim_comp_stat preserving type
      )                                    as CmplRqRsltPrelimCmplncSts,

       --Related composition type
       case
       //         when _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantInProgress

          when _Combined.CmplRqRsltProcessingStatus <> _Constants[inner].ConstantInProgress
       //           then _Combined._CalcdCmplRqRslt.ChmlCompositionType

         then _Combined.ReldCmplRqRsltChmlCmpstnType
       end                                  as ChmlCompositionType,

       -- Indicator that there is a released version
       cast(
         case
           when _Combined.ReldCmplRqRsltUUID is not null
           then _Constants[inner].ConstantTrue
         end as ehfnd_crr_has_rel_version preserving type
       )                                    as CmplRqRsltHasReleasedVersion,

       _Combined,
       _ChmlCmplncInfo
}
-- Only for Unpackaged Product
where
       UnpackagedProduct.ChmlCmplncInfoType    = 'BU'
  and(
       UnpackagedProduct.MaterialIsSold        = 'X'
    or UnpackagedProduct.MaterialIsTransported = 'X'
    or UnpackagedProduct.MaterialIsProduced    = 'X'
  )
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCCMPLRQRSLTCOMBINED",
"I_CHMLCMPLNCINFO",
"I_CHMLCMPLNCPRODASSGMT",
"I_CMPLRQRSLT",
"P_CHMLCMPLCONSTANTS"
],
"ASSOCIATED":
[
"I_CHMLCMPLNCCMPLRQRSLTCOMBINED",
"I_CHMLCMPLNCINFO",
"P_CHMLCMPLCONSTANTS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/