I_PckgdCmplRqRsltMkt

DDL: I_PCKGDCMPLRQRSLTMKT SQL: IPCKGDCRRM Type: view COMPOSITE

CmplRqRslt Marketability for Packaged Products

I_PckgdCmplRqRsltMkt is a Composite CDS View that provides data about "CmplRqRslt Marketability for Packaged Products" in SAP S/4HANA. It reads from 1 data source (I_CmplRqRslt) and exposes 24 fields with key field CmplRqRsltUUID. It has 3 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_CmplRqRslt CmplRqRslt from

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_BusinessUserBasic _ProcessorUser $projection.Processor = _ProcessorUser.BusinessPartner
[0..1] I_BusinessUserBasic _ReleasedByUser $projection.ReleasedByUser = _ReleasedByUser.BusinessPartner
[1..*] I_ChmlCmplncMatlAssgmt _ChmlCmplncMatlAssgmt $projection.ChmlCmplncInfoUUID = _ChmlCmplncMatlAssgmt.ChmlCmplncInfoUUID

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName IPCKGDCRRM view
EndUserText.label CmplRqRslt Marketability for Packaged Products view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking #NOT_REQUIRED 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

Fields (24)

KeyFieldSource TableSource FieldDescription
KEY CmplRqRsltUUID I_CmplRqRslt CmplRqRsltUUID
ChmlCmplncInfoUUID I_CmplRqRslt ChmlCmplncInfoUUID
ChmlCmplncProdUUID
SubstanceUUID I_CmplRqRslt SubstanceUUID
ChmlSuplrMatlUUID I_CmplRqRslt ChmlSuplrMatlUUID
CmplRqVersUUID I_CmplRqRslt CmplRqVersUUID
ComplianceRequirement I_CmplRqRslt ComplianceRequirement
Product _ChmlCmplncMatlAssgmt Material
CmplRqRsltProcessingStatus I_CmplRqRslt CmplRqRsltProcessingStatus
CmplRqRsltManualStatus I_CmplRqRslt CmplRqRsltManualStatus
CmplRqRsltCalculatedStatus I_CmplRqRslt CmplRqRsltCalculatedStatus
Processor I_CmplRqRslt Processor
CmplRqRsltPrelimProcessorName
ReleasedByUser I_CmplRqRslt ReleasedByUser
ReleasedByUserName
ReldCmplRqRsltUUID
_ChmlCmplncInfo _ChmlCmplncInfo
_CmplRqVers _CmplRqVers
_Substance _Substance
_SupplierMaterial _SupplierMaterial
_ProcessorUser _ProcessorUser
_ReleasedByUser _ReleasedByUser
_ChmlCmplncMatlAssgmt _ChmlCmplncMatlAssgmt
_Product _ChmlCmplncMatlAssgmt _Product
@AbapCatalog.sqlViewName: 'IPCKGDCRRM'
@EndUserText.label: 'CmplRqRslt Marketability for Packaged Products'
@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter:true

--Access Control: Authorizations Checks
@AccessControl:
{
  authorizationCheck: #MANDATORY,
  personalData.blocking: #NOT_REQUIRED
}

--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
  }
}

define view I_PckgdCmplRqRsltMkt
  as select from I_CmplRqRslt           as CmplRqRslt

  // Join is to make sure that only CRVs of the ApplicationComponent 'PMA' are selected --> Where clause!

    join         I_CmplRqVers           as CmplRqVers      on CmplRqVers.CmplRqVersUUID = CmplRqRslt.CmplRqVersUUID

  // Make sure that only CRRs for packagedproducts are selected

    join         I_ChmlCmplncProdAssgmt as PackagedProduct on PackagedProduct.ChmlCmplncInfoUUID = CmplRqRslt.ChmlCmplncInfoUUID

  // Provide the full name of the Processor; e.g. "John Doe"

  association [0..1] to I_BusinessUserBasic    as _ProcessorUser        on $projection.Processor = _ProcessorUser.BusinessPartner

  // Provide the full name of the User who released a CRR

  association [0..1] to I_BusinessUserBasic    as _ReleasedByUser       on $projection.ReleasedByUser = _ReleasedByUser.BusinessPartner

  association [1..*] to I_ChmlCmplncMatlAssgmt as _ChmlCmplncMatlAssgmt on $projection.ChmlCmplncInfoUUID = _ChmlCmplncMatlAssgmt.ChmlCmplncInfoUUID

{
  key CmplRqRslt.CmplRqRsltUUID,

      CmplRqRslt.ChmlCmplncInfoUUID,

      cast( PackagedProduct.ChmlCmplncProdUUID as  ehfnd_cci_up_uuid preserving type )       as ChmlCmplncProdUUID,

      CmplRqRslt.SubstanceUUID,

      CmplRqRslt.ChmlSuplrMatlUUID,

      CmplRqRslt.CmplRqVersUUID,

      CmplRqRslt.ComplianceRequirement,

      _ChmlCmplncMatlAssgmt.Material                                                         as Product,

      CmplRqRslt.CmplRqRsltProcessingStatus,

      CmplRqRslt.CmplRqRsltManualStatus,

      CmplRqRslt.CmplRqRsltCalculatedStatus,

      // Changed the logic of determination of CmplRqRsltCmplncSts due to merge of CRRs (IP and CA)

      cast(
        case
      // If CRR is in progress...

          when CmplRqRslt.CmplRqRsltProcessingStatus = 'IP'
            then
              case
                // ...and manual status is 'Use Calculated'/'Unknown' and the calculated status is not initial...

                when CmplRqRslt.CmplRqRsltManualStatus = '03' and CmplRqRslt.CmplRqRsltCalculatedStatus is not initial // Check for initial since the default value of CmplRqRsltCalculatedStatus is ''

                  // ...take the calculated status

                  then CmplRqRslt.CmplRqRsltCalculatedStatus
                // ... and manual status is not 'Unknown' OR calculated status is initial

                when CmplRqRslt.CmplRqRsltManualStatus <> '03' or CmplRqRslt.CmplRqRsltCalculatedStatus is initial
                  // ... take the manual status

                  then CmplRqRslt.CmplRqRsltManualStatus
              end
          // If CRR is in released...

          when CmplRqRslt.CmplRqRsltProcessingStatus = 'RE'
            // ... take the released compliance status

            then CmplRqRslt.CmplRqRsltReldCmplncSts
      end   as ehfnd_crr_comp_stat preserving type )                                         as CmplRqRsltCmplncSts,

      CmplRqRslt.Processor,

      cast( _ProcessorUser.PersonFullName as  ehfnd_processor_name preserving type )         as CmplRqRsltPrelimProcessorName,

      CmplRqRslt.ReleasedByUser,

      cast( _ReleasedByUser.PersonFullName as  ehfnd_released_by_user_name preserving type ) as ReleasedByUserName,

      //_CmplRqRsltTransientFields.ReldCmplRqRsltUUID,

      cast( CmplRqRslt.CmplRqVersUUID as  ehfnd_crr_reld_uuid        preserving type )       as ReldCmplRqRsltUUID,

      /* Associations */
      _ChmlCmplncInfo,
      _CmplRqVers,
      _Substance,
      _SupplierMaterial,
      _ProcessorUser,
      _ReleasedByUser,
      _ChmlCmplncMatlAssgmt,
      _ChmlCmplncMatlAssgmt._Product
}
where
  CmplRqVers.CmplRqApplicationComponent = 'PMA'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BUSINESSUSERBASIC",
"I_CHMLCMPLNCMATLASSGMT",
"I_CHMLCMPLNCPRODASSGMT",
"I_CMPLRQRSLT",
"I_CMPLRQVERS"
],
"ASSOCIATED":
[
"I_BUSINESSUSERBASIC",
"I_CHMLCMPLNCINFO",
"I_CHMLCMPLNCMATLASSGMT",
"I_CHMLSUPLRMATL",
"I_CMPLRQVERSENHANCED",
"I_PRODUCT",
"I_SUBSTANCEENHANCED"
],
"BASE":
[
"I_CHMLCMPLNCMATLASSGMT",
"I_CMPLRQRSLT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/