@AbapCatalog.sqlViewName: 'CCRSVTSBYLGLENMN'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Monitor Substance Volumes'
@VDM.viewType: #CONSUMPTION
@ObjectModel: {
usageType:{
dataClass: #MIXED,
serviceQuality: #D,
sizeCategory: #L
}
}
@Metadata.allowExtensions: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.semanticKey: ['ComplianceRequirement', 'LegalEntity', 'SubstanceName', 'SubstanceListName' ]
@UI.presentationVariant: [{ requestAtLeast: ['TrackingPeriodType'] }]
define view C_LegalEntitySVTStatusMonitor
as select from I_SVTAggregationItem as SVTAggregationItem
association [0..*] to C_LegalEntitySubstVolByMonth as _LegalEntitySubstVolByMonth on $projection.SVTAggregationItemUUID = _LegalEntitySubstVolByMonth.SVTAggregationItemUUID
association [0..*] to C_LegalEntitySubstVolByProduct as _LegalEntitySubstVolByProduct on $projection.SVTAggregationItemUUID = _LegalEntitySubstVolByProduct.SVTAggregationItemUUID
association [1..1] to I_UnitOfMeasure as _UnitOfMeasurePercent on SVTAggregationItem.LglEntitySubstVolThldReachUnit = _UnitOfMeasurePercent.UnitOfMeasure
association [1..1] to I_UnitOfMeasure as _UnitOfMeasureMass on $projection.TotalSubstanceVolumeUnit = _UnitOfMeasureMass.UnitOfMeasure
association [1..1] to I_CmplRqSVTStatus as _CmplRqSVTStatus on SVTAggregationItem.LegalEntitySVTStatus = _CmplRqSVTStatus.CmplRqSVTStatus
association [1..1] to P_SVTTrackingPeriods as _SVTTrackingPeriods on $projection.SVTAggregationHeaderUUID = _SVTTrackingPeriods.SVTAggregationHeaderUUID
association [1..1] to P_CmplRqLatestSubstanceList as _CmplRqLatestSubstanceList on SVTAggregationItem.SubstanceList = _CmplRqLatestSubstanceList.SubstanceList and SVTAggregationItem.ComplianceRequirement = _CmplRqLatestSubstanceList.ComplianceRequirement
association [0..1] to I_OTRText as _OTRNotAssignText on _OTRNotAssignText.OnlnTxtRpstryConceptID = '42010AEF4C8E1EED81D263B7DCBAB68B' and _OTRNotAssignText.Language = $session.system_language
association [0..1] to P_ChmlCmplConstants as _Constants on _Constants.Dummy = _Constants.Dummy
{
//SVTAggregationItem
key SVTAggregationItemUUID,
LegalEntity,
ComplianceRequirement,
_SVTAggregationHeader._Substance.ResponsibleUnit,
_SVTAggregationHeader._Substance._ListedSubstance.ECNumber,
_SVTAggregationHeader._Substance._ListedSubstance.ListedSubstance,
@ObjectModel.text.element: ['SubstanceListName']
@UI.textArrangement: #TEXT_ONLY
@EndUserText.label: 'Substance list'
_CmplRqLatestSubstanceList.SubstanceList,
case
when _CmplRqLatestSubstanceList.SubstanceListType = _Constants[inner].ConstantESL then ''
else cast( coalesce(_CmplRqLatestSubstanceList._Text[ 1: Language = $session.system_language ].SubstanceListName,
coalesce( _CmplRqLatestSubstanceList.SubstanceList, _OTRNotAssignText.Text ) ) as ehpma_svt_sublist_name_ltd )
end as SubstanceListName,
@ObjectModel:
{
readOnly: true,
text.element: [ 'CmplRqSVTStatusText' ]
}
LegalEntitySVTStatus,
@ObjectModel.readOnly: true
_CmplRqSVTStatus._Text[ 1: Language = $session.system_language ].CmplRqSVTStatusText,
_CmplRqSVTStatus.CmplRqSVTStatusCriticality,
_SVTAggregationHeader.SubstanceUUID,
@Semantics.text: true
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_SUBSTANCE_EXIT'
}
cast( ''
as ehfnd_sub_substance_name_ltd ) as SubstanceName,
cast( SVTAggregationItem._SVTAggregationHeader._Substance.Specification
as ehpma_svt_sub_specification preserving type ) as Specification,
SVTAggregationItem._SVTAggregationHeader._Substance.SubstanceInternalName,
// Following fields on Substance Names are just required/read in case of a search
---- Company substance name ----
SVTAggregationItem._SVTAggregationHeader._Substance._SubstanceText[1:Language = $session.system_language].SubstanceName as CompanySubstanceName,
---- Listed substance default name ----
SVTAggregationItem._SVTAggregationHeader._Substance._ListedSubstance.CustListedSubstanceDfltName as CustListedSubstanceDfltName,
SVTAggregationItem._SVTAggregationHeader._Substance._ListedSubstance.CntntListedSubstanceDfltName as CntntListedSubstanceDfltName,
cast( PlannedSubstanceVolume as ehpma_svt_subst_vol_ui ) as PlannedSubstanceVolume,
PlannedSubstanceVolumeUnit,
@Semantics.quantity.unitOfMeasure: 'SubstanceVolumeThresholdUnit'
cast( ConfirmedSubstanceVolume as ehpma_svt_subst_vol_ui ) as ConfirmedSubstanceVolume,
ConfirmedSubstanceVolumeUnit,
@Semantics.quantity.unitOfMeasure: 'SubstanceVolumeThresholdUnit'
cast( TotalSubstanceVolume as ehpma_svt_subst_vol_ui ) as TotalSubstanceVolume,
@Semantics.unitOfMeasure: true
TotalSubstanceVolumeUnit,
@Semantics.quantity.unitOfMeasure : 'SubstanceVolumeThresholdUnit'
cast( SubstanceVolumeThresholdQty as ehpma_svt_subst_vol_ui ) as SubstanceVolumeThresholdQty,
@Semantics.unitOfMeasure: true
_UnitOfMeasureMass._Text[1:Language = $session.system_language].UnitOfMeasure as SubstanceVolumeThresholdUnit,
@Semantics.unitOfMeasure: true
@ObjectModel.readOnly: true
LglEntitySubstVolThldReachUnit,
@ObjectModel.readOnly: true
@Semantics.quantity.unitOfMeasure : 'ProdAllocPercentUnit'
LglEntitySubstVolThldReachPct,
@Semantics.unitOfMeasure: true
_UnitOfMeasurePercent._Text[1:Language = $session.system_language].UnitOfMeasure as ProdAllocPercentUnit,
CmplncRqmtSubstRegnNumber,
_SVTAggregationHeader.TrackingPeriodStartDate,
_SVTAggregationHeader.TrackingPeriodEndDate,
SVTAggregationHeaderUUID,
@ObjectModel: {
readOnly: true,
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHPMA_SVT_MNTR_SADL_EXIT'
}
cast( '' as abap.char( 250 )) as CmplRqVersTrackingPeriodText,
_SVTAggregationHeader._Substance._ListedSubstance.CASNumber,
cast( _SVTTrackingPeriods.TrackingPeriodType as ehpma_svt_track_per_type ) as TrackingPeriodType,
// Associations
_LegalEntitySubstVolByMonth,
_LegalEntitySubstVolByProduct,
_SVTAggregationHeader,
_UnitOfMeasureMass,
_UnitOfMeasurePercent
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CMPLRQSVTSTATUS",
"I_CMPLRQSVTSTATUSTEXT",
"I_CMPLRQVERSSUBSTANCELISTTEXT",
"I_OTRTEXT",
"I_SUBSTACTIVEDRAFTLSTDSUBST",
"I_SUBSTANCE",
"I_SUBSTANCETEXT",
"I_SVTAGGREGATIONHEADER",
"I_SVTAGGREGATIONITEM",
"I_UNITOFMEASURE",
"I_UNITOFMEASURETEXT",
"P_CHMLCMPLCONSTANTS",
"P_CMPLRQLATESTSUBSTANCELIST",
"P_SVTTRACKINGPERIODS"
],
"ASSOCIATED":
[
"C_LEGALENTITYSUBSTVOLBYMONTH",
"C_LEGALENTITYSUBSTVOLBYPRODUCT",
"I_CMPLRQSVTSTATUS",
"I_OTRTEXT",
"I_SVTAGGREGATIONHEADER",
"I_UNITOFMEASURE",
"P_CHMLCMPLCONSTANTS",
"P_CMPLRQLATESTSUBSTANCELIST",
"P_SVTTRACKINGPERIODS"
],
"BASE":
[
"I_SVTAGGREGATIONITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/