C_SftyDataShtRelatedAssmt is a Consumption CDS View that provides data about "SDS Related Assmt for unpackaged prods" in SAP S/4HANA. It reads from 1 data source (I_CmplRqRslt) and exposes 22 fields with key fields ChmlCmplncInfoUUID, SubstanceUUID, CmplRqVersUUID, CmplRqRsltUUID. It has 5 associations to related views. It is exposed through 1 OData service (UI_EHS_FND_CRR_OVERVIEW).
@AbapCatalog.sqlViewName: 'CCCCRRSDSRELASSM'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@EndUserText.label: 'SDS Related Assmt for unpackaged prods'
@AccessControl:
{
authorizationCheck: #MANDATORY,
// blocking of personal data not required (no personal data fields exposed for material; user can not be blocked)
personalData.blocking: #NOT_REQUIRED
}@ClientHandling.algorithm: #SESSION_VARIABLE@Metadata.allowExtensions: true@VDM.viewType: #CONSUMPTION@ObjectModel:
{
semanticKey: [ 'CmplRqVersName' ],
usageType:
{
dataClass: #MIXED,
sizeCategory: #XL,
serviceQuality: #C
}
}
@UI:
{
headerInfo : {
typeName : 'Safety Data Sheet: Related Assessment',
typeNamePlural : 'Safety Data Sheet: Related Assessments',
title.value : 'CmplRqVersName' // Needed to enable CoPilot
},
presentationVariant: {
sortOrder: [ {by: 'CmplRqVersName', direction: #ASC }],
requestAtLeast :
[
'CmplRqPattern',
'CmplRqRsltNavgnLink',
'CmplRqVersName', // Used for draft indicator in UI
'HasDraftEntity', // Used for draft indicator in UI
'IsActiveEntity', // Used for draft indicator in UI
'SemanticObjectAction'
]
}
}
--Search
@Search.searchable : true// AllView (In Progress and Released Versions) for SDS Related Assessments for UPs
// Text has been renamed after development from "Safety Data Sheet Related Assessments" to "First Aid Measures Assessments" and for CE2011 to "Safety Data Sheet: Related Assessments"
defineview C_SftyDataShtRelatedAssmt
asselectfrom I_CmplRqRslt as CmplRqRslt
-- association to Compliance Requirement Version
association [0..1] to I_CmplRqVersEnhanced as _CmplRqVers on $projection.CmplRqVersUUID = _CmplRqVers.CmplRqVersUUID
-- Association used in DCL to determine responsible unit
association [1..1] to I_ChmlCmplncInfo as _ChmlCmplncInfo on $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID
--required to show a draft-indicator
association [1..1] to C_CmplRqRsltDraftAdminvData as _DraftAdministrativeData on $projection.CmplRqRsltUUID = _DraftAdministrativeData.CmplRqRsltUUID
association [0..1] to I_BusinessUserBasic as _ProcessorUser on $projection.Processor = _ProcessorUser.BusinessPartner
-- Determines the full name of the business user who has released the CRR
association [0..1] to I_BusinessUserBasic as _ReleasedByUser on $projection.ReleasedByUser = _ReleasedByUser.BusinessPartner
{
// UUID of packaged or unpackaged product
@ObjectModel.readOnly: truekey ChmlCmplncInfoUUID,
@ObjectModel.readOnly: truekey SubstanceUUID,
// UUID of compliance requirement version
@ObjectModel.readOnly: truekey CmplRqVersUUID,
@ObjectModel.readOnly: truekey CmplRqRsltUUID,
@Semantics.text: true@ObjectModel.readOnly: truecast( _CmplRqVers.CmplRqVersName as ehfnd_crr_crv_name preserving type ) as CmplRqVersName,
@ObjectModel.readOnly: true@Search: { defaultSearchElement: true, fuzzinessThreshold: 0.7 }// changed from 0.8 to 0.7 -> 2070494787
_CmplRqVers._CmplRqVersTextInCurrentLang.CmplRqVersName as CmplRqVersNameInCurLang,
@ObjectModel.readOnly: true@Search: { defaultSearchElement: true, fuzzinessThreshold: 0.7 }// changed from 0.8 to 0.7 -> 2070494787
_CmplRqVers.CmplRqVersEnglishName as CmplRqVersEnglishName,
_CmplRqVers.ComplianceRequirement,
@ObjectModel.readOnly: true
_CmplRqVers.CmplRqPattern,
@ObjectModel.readOnly: true
CmplRqRsltUUID as CmplRqRsltNavgnLink,
// for segmented button (In Progress/Released)
CmplRqRsltProcessingStatus,
@ObjectModel.readOnly: true
Processor,
@ObjectModel.readOnly: true@Search: { defaultSearchElement: true, fuzzinessThreshold: 0.8 }cast(_ProcessorUser.PersonFullName as ehpma_processor_name preserving type) as CmplRqRsltPrelimProcessorName,
@ObjectModel.readOnly: true@ObjectModel.text.element: ['ReleasedByUserName']
ReleasedByUser,
@ObjectModel.readOnly: true@Semantics.text: true@Search: { defaultSearchElement: true, fuzzinessThreshold: 0.8 }cast(_ReleasedByUser.PersonFullName as ehpma_processor_name preserving type) as ReleasedByUserName,
// displayed Processor/Released By@ObjectModel.readOnly: true@ObjectModel: {
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRR_PROC_RELDBY_EXIT'
}cast( '' as ehpma_processor_name ) as CmplRqRsltProcessorName,
---- draft data ----
@ObjectModel: {
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRR_DRAFT_IND_EXIT'
}@ObjectModel.readOnly: truecast( '' as boole_d ) as HasDraftEntity,
@ObjectModel: {
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRR_DRAFT_IND_EXIT'
}@ObjectModel.readOnly: truecast( '' as boole_d ) as IsActiveEntity,
-- SemanticObjectAction
@ObjectModel: {
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRV_CONFIG_CALC_EXT'
}@ObjectModel.readOnly: truecast( '' asabap.char( 30 ) ) as SemanticObjectAction,
/* Associations */
_CmplRqVers,
_ChmlCmplncInfo,
_DraftAdministrativeData,
_ReleasedByUser
}
where
CmplRqRslt.CmplRqVersUUID isnotnulland _CmplRqVers.CmplRqApplicationComponent = 'SDS'
and _CmplRqVers.CmplRqPattern <> 'CompliancePatternSDSManagement'
and(
CmplRqRslt.CmplRqRsltProcessingStatus = 'IP'
or CmplRqRslt.CmplRqRsltProcessingStatus = 'RE'
)