C_WorkViewCmplncData is a Consumption CDS View that provides data about "Work View Compliance Data" in SAP S/4HANA. It reads from 1 data source (P_WorkViewCmplncDataUnion) and exposes 32 fields with key fields ChmlCmplncInfoUUID, WorkView, ComplianceDataNavgnLinkUUID, PCPrptyRootType, ChmlCompositionType. It has 1 association to related views.
@AbapCatalog: {
sqlViewName: 'CWVCMPLNCD',
compiler.compareFilter: true,
preserveKey: true
}@AccessControl.authorizationCheck: #CHECK@VDM.viewType: #CONSUMPTION@ClientHandling.algorithm: #SESSION_VARIABLE@ObjectModel: {
usageType: {
dataClass: #MIXED,
sizeCategory: #L,
serviceQuality: #C
}
}
@UI:{presentationVariant: [{requestAtLeast: [
'ComplianceDataName',
'SemanticObject',
'SemanticObjectAction',
'PCPrptyNavgnLinkParamName',
'PCPrptyActiveIndParamName',
'PCPrptyRootTypeName',
'CmplRqPattern',
'CmplRqVersName',
'PCPrptyProcgSts',
'PCPrptyProcgStsText',
'ComplianceDataUserName',
'WorkViewGroupName',
'WorkView',
'ChmlCmplncInfoType', // needed for setting the header field and facet visibility and the Object Page Header Icon determination
'ChmlCmplncProdIsResearched', // needed for the Object Page Header Icon determination
'MaterialIsProduced', // needed for setting the header field and facet visibility and the Object Page Header Icon determination
'MaterialIsSold', // needed for setting the header field and facet visibility and the Object Page Header Icon determination
'MaterialIsSourced', // needed for setting the header field and facet visibility and the Object Page Header Icon determination
'MaterialIsTransported' // needed for setting the header field and facet visibility and the Object Page Header Icon determination
]
}]
}
@Metadata.allowExtensions: true@EndUserText.label: 'Work View Compliance Data'
defineview C_WorkViewCmplncData
asselectfrom P_WorkViewCmplncDataUnion
-- Link to customizing data (Composition Type Name)
// association [0..1] to I_ChmlCompositionType as _CompositionType on $projection.ChmlCompositionType = _CompositionType.ChmlCompositionType
-- Link to domain data (Property Type Name)
association [0..1] to I_PCPrptyRootType as _PCPrptyRootType on $projection.PCPrptyRootType = _PCPrptyRootType.PCPrptyRootType
association to I_ChmlCmplncInfo as ChmlCmplncInfo on $projection.ChmlCmplncInfoUUID = ChmlCmplncInfo.ChmlCmplncInfoUUID
{
@UI.hidden: truekey ChmlCmplncInfoUUID,
@UI.hidden: truekey WorkView,
key ComplianceDataNavgnLinkUUID,
key PCPrptyRootType,
key ChmlCompositionType,
ProdCmplncLegalArea,
@UI.hidden: true
ChmlCmplncInfo.ChmlCmplncInfoType,
@UI.hidden: true
ChmlCmplncInfo.ChmlCmplncProdIsResearched,
@UI.hidden: true
ChmlCmplncInfo.MaterialIsProduced,
@UI.hidden: true
ChmlCmplncInfo.MaterialIsSold,
@UI.hidden: true
ChmlCmplncInfo.MaterialIsSourced,
@UI.hidden: true
ChmlCmplncInfo.MaterialIsTransported,
@UI.hidden: true@ObjectModel.readOnly: true@ObjectModel:{
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_WV_CMPSTN_NAME_EXIT'
}cast('' as ehfnd_cci_ccmps_type_dsc ) as ChmlCompositionTypeName,
@UI.hidden: true
coalesce(
_PCPrptyRootType._Text[ 1: Language = $session.system_language ].PCPrptyRootTypeName,
_PCPrptyRootType._Text[ 1: Language = 'E' ].PCPrptyRootTypeName ) as PCPrptyRootTypeName,
ComplianceRequirement,
CmplRqVersUUID,
CmplRqVersName,
@ObjectModel: {
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_WV_CMPLNC_DATA_EXIT'
}cast('' as ehfnd_crr_crv_name ) as ComplianceDataName,
// IP processing status for properties and compositions
PCPrptyInProcProcgSts,
// RE processing status for properties and compositions
PCPrptyReldProcgSts,
-- Overall Status
@ObjectModel.virtualElement@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_WV_CMPLNC_DATA_EXIT'
@ObjectModel.readOnly: true@ObjectModel.text.element: ['PCPrptyProcgStsText']@UI.textArrangement: #TEXT_ONLYcast('' as ehfnd_property_status) as PCPrptyProcgSts,
@ObjectModel.virtualElement@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_WV_CMPLNC_DATA_EXIT'
@ObjectModel.readOnly: truecast('' as val_text) as PCPrptyProcgStsText,
// IP or RE processing status for CRRs
ProcessingStatus,
@UI.hidden: true@ObjectModel.virtualElement@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_WV_CMPLNC_DATA_EXIT'
@ObjectModel.readOnly: truecast(0 asabap.int1) as PCPrptyProcgStsCritlty,
// Processor for CRRs
ProcessorUserName,
// Released by user for properties, compositions ot CRRs
ReleasedByUserName,
// Field that shows the User Name for two different situations based on the ProcessingStatus for CRRs and PCPrptyInProcProcgSts / PCPrptyReldProcgSts for properties and compositions.
// CRR
// If ProcessingStatus == IP: Show the CRR processor name. If empty, show "(No Processor)"
// If ProcessingStatus == RE: Show the CRR released-by-user name. If empty, show "SAP System"
// Properties and Compositions
// If PCPrptyInProcProcgSts == IP: Show nothing
// If PCPrptyReldProcgSts == RE: Show the released-by-user name
@ObjectModel: {
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_WV_CMPLNC_DATA_EXIT'
}cast('' as ehpma_processor_name) as ComplianceDataUserName,
@UI.hidden: true
WorkViewGroupName,
--SemanticObject
@ObjectModel.virtualElement@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_WV_CMPLNC_DATA_EXIT'
@ObjectModel.readOnly: truecast('' as val_text) as SemanticObject,
--SemanticObjectAction
@ObjectModel.virtualElement@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_WV_CMPLNC_DATA_EXIT'
@ObjectModel.readOnly: truecast('' as val_text) as SemanticObjectAction,
--Paramter Name for Navigation Link
@ObjectModel.virtualElement@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_WV_CMPLNC_DATA_EXIT'
@ObjectModel.readOnly: truecast('' as val_text) as PCPrptyNavgnLinkParamName,
--Paramter Name for Activation Indicator
@ObjectModel.virtualElement@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_WV_CMPLNC_DATA_EXIT'
@ObjectModel.readOnly: truecast('' as val_text) as PCPrptyActiveIndParamName,
ChmlCmplncInfo.ProdStewardshipRespUnit,
ChmlCmplncInfo.DngrsGdsRespUnit,
ChmlCmplncInfo.ChmlCmplncInternalName,
CmplRqPattern,
PCPrptySequence
}