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.
@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 ornot 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
*/defineview P_CmplRqRsltTransientFields
asselectfrom 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,
casewhen CmplRqRsltProcessingStatus = 'IP'
then _ChmlCmplncInfo.MaterialIsSold
when CmplRqRsltProcessingStatus = 'RE'
or CmplRqRsltProcessingStatus = 'OD'
then MaterialIsSold
endas MaterialIsSold,
casewhen CmplRqRsltProcessingStatus = 'IP'
then _ChmlCmplncInfo.MaterialIsTransported
when CmplRqRsltProcessingStatus = 'RE'
or CmplRqRsltProcessingStatus = 'OD'
then MaterialIsTransported
endas MaterialIsTransported,
casewhen CmplRqRsltProcessingStatus = 'IP'
then _ChmlCmplncInfo.MaterialIsSourced
when CmplRqRsltProcessingStatus = 'RE'
or CmplRqRsltProcessingStatus = 'OD'
then MaterialIsSourced
endas MaterialIsSourced,
casewhen CmplRqRsltProcessingStatus = 'IP'
then _ChmlCmplncInfo.MaterialIsProduced
when CmplRqRsltProcessingStatus = 'RE'
or CmplRqRsltProcessingStatus = 'OD'
then MaterialIsProduced
endas 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":""
}
}*/