@AbapCatalog.sqlViewName: 'ICCCRR'
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Compliance Requirement Results 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 CRR information of unpackaged product and its related packaged products
This view provides information for the all views: In Progress and Released Versions, but showing only the released compliance status
It returns always one record for each CRV-CCI combination:
- the "in process" result if an "in process" result exists
- the "released" result if a "released" result exists
- a combined result if both - an "in process" and a "released" result exists
------------------------------------------------------------------------------------------------------------------------*/
define view I_ChmlCmplncCmplRqRslt
// 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
association [0..1] to I_ChmlCmplncInfo as _ChmlCmplncInfo on _ChmlCmplncInfo.ChmlCmplncInfoUUID = $projection.ChmlCmplncProdUUID
{
// 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,
key _Combined.CmplRqVersUUID,
// CRR Info
_Combined.ReldCmplRqRsltUUID,
_Combined.CmplRqRsltProcessingStatus,
case
when _Combined.PrelimCmplRqRsltUUID is not null then _Combined.PrelimCmplRqRsltUUID
when _Combined.ReldCmplRqRsltUUID is not null then _Combined.ReldCmplRqRsltUUID
end as CmplRqRsltUUID,
// If no released status is set, ne released version exists. So the value shall be "No released version exists".
// --> Therefore we set the domain value to '03'
case
when _Combined.CmplRqRsltReldCmplncSts is not null then _Combined.CmplRqRsltReldCmplncSts
when _Combined.CmplRqRsltReldCmplncSts is null then '03'
end as CmplRqRsltReldCmplncSts,
-- Indicator that there is an in progress version
cast(
case
when _Combined.PrelimCmplRqRsltUUID is not null
then 'X'
end as ehfnd_crr_has_prelim_version preserving type
) as CmplRqRsltHasInProgressVersion,
--Released On
_Combined.ReleaseDate,
--Released By
_Combined.ReleasedByUser,
_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
association [0..1] to I_ChmlCmplncInfo as _ChmlCmplncInfo on _ChmlCmplncInfo.ChmlCmplncInfoUUID = $projection.ChmlCmplncProdUUID
{
// 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,
key _Combined.CmplRqVersUUID,
// CRR Info
_Combined.ReldCmplRqRsltUUID,
_Combined.CmplRqRsltProcessingStatus,
case
when _Combined.PrelimCmplRqRsltUUID is not null then _Combined.PrelimCmplRqRsltUUID
when _Combined.ReldCmplRqRsltUUID is not null then _Combined.ReldCmplRqRsltUUID
end as CmplRqRsltUUID,
// If no released status is set, ne released version exists. So the value shall be "No released version exists".
// --> Therefore we set the domain value to '03'
case
when _Combined.CmplRqRsltReldCmplncSts is not null then _Combined.CmplRqRsltReldCmplncSts
when _Combined.CmplRqRsltReldCmplncSts is null then '03'
end as CmplRqRsltReldCmplncSts,
-- Indicator that there is an in progress version
cast(
case
when _Combined.PrelimCmplRqRsltUUID is not null
then 'X'
end as ehfnd_crr_has_prelim_version preserving type
) as CmplRqRsltHasInProgressVersion,
--Released On
_Combined.ReleaseDate,
--Released By
_Combined.ReleasedByUser,
_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"
],
"ASSOCIATED":
[
"I_CHMLCMPLNCCMPLRQRSLTCOMBINED",
"I_CHMLCMPLNCINFO"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/