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.
@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
------------------------------------------------------------------------------------------------------------------------*/defineview I_ChmlCmplncCmplRqRsltInPrgrs
// Take into account CRRs of the unpackaged product
asselectfrom I_ChmlCmplncInfo as UnpackagedProduct
// use ChmlCmplncProdUUID to have the same associationlikein 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 withcase statement with constants (notnull-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,
casewhen _Combined.PrelimCmplRqRsltUUID isnotnullthen _Combined.PrelimCmplRqRsltUUID
when _Combined.ReldCmplRqRsltUUID isnotnullthen _Combined.ReldCmplRqRsltUUID
endas CmplRqRsltUUID,
// CK: CRR Refactoring 03.05.2021
--Return the preliminary status
cast(
casewhen _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantInProgress
then _Combined._PrelimCmplRqRslt.CmplRqRsltPrelimCmplncSts
when _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantReleased
then _Combined._ReleasedCmplRqRslt.CmplRqRsltPrelimCmplncSts
endas 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
endas ChmlCompositionType,
-- Indicator that there is a released version
cast(
casewhen _Combined.ReldCmplRqRsltUUID isnotnullthen _Constants[inner].ConstantTrue
endas 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)
unionallselectfrom 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 withcase statement with constants (notnull-preserving topic)
association [1..1] to P_ChmlCmplConstants as _Constants on _Constants.Constant0 = _Constants.Constant0
{
// UUID of packaged product
key PackagedProduct.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID, // incase 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,
casewhen _Combined.PrelimCmplRqRsltUUID isnotnullthen _Combined.PrelimCmplRqRsltUUID
when _Combined.ReldCmplRqRsltUUID isnotnullthen _Combined.ReldCmplRqRsltUUID
endas CmplRqRsltUUID,
--Return the preliminary status
cast(
casewhen _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantInProgress
then _Combined._PrelimCmplRqRslt.CmplRqRsltPrelimCmplncSts
when _Combined.CmplRqRsltProcessingStatus = _Constants[inner].ConstantReleased
then _Combined._ReleasedCmplRqRslt.CmplRqRsltPrelimCmplncSts
endas 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
endas ChmlCompositionType,
-- Indicator that there is a released version
cast(
casewhen _Combined.ReldCmplRqRsltUUID isnotnullthen _Constants[inner].ConstantTrue
endas 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":""
}
}*/