@EndUserText.label: 'Manage Substances Compliance'
@VDM.viewType: #CONSUMPTION
@AbapCatalog:
{
sqlViewName: 'CSUBQRYTP',
compiler.compareFilter: true
}
@AccessControl:
{
authorizationCheck: #MANDATORY,
// blocking not required (view does not expose personal data fields from sales data; user can not be blocked and no bp fields from user are exposed)
personalData.blocking: #NOT_REQUIRED
}
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata: {
allowExtensions: true
}
@ObjectModel:
{
transactionalProcessingDelegated: true,
compositionRoot: true,
draftEnabled: true,
createEnabled: true,
updateEnabled: 'EXTERNAL_CALCULATION',
//switched delete from false to dynamic: to tackle raised exception when canceling a draft
deleteEnabled: 'EXTERNAL_CALCULATION',
//use the specification id as semantic key (instead of substance name)
semanticKey: [ 'Specification' ],
representativeKey: 'SubstanceUUID',
usageType:
{
serviceQuality: #C,
dataClass: #MIXED,
sizeCategory: #L
}
}
// for navigation from CoPilot
@Consumption.semanticObject: 'CompanySubstance'
@Search.searchable : true
/*----------------------------------------------------------------------------------------------------------------------
Consumption view for the company substance.
------------------------------------------------------------------------------------------------------------------------*/
define view C_SubstanceQryTP
--Select data from transactional view of substance
as select from I_SubstanceTP as Substance
--Variant Assignment
association [0..*] to C_SubstanceVarAssgmtQryTP as _SubstanceVarAssgmt on $projection.SubstanceUUID = _SubstanceVarAssgmt.SubstanceUUID
--Group Assignment
association [0..*] to C_SubstanceGrpAssgmt as _SubstanceGrpAsgmt on $projection.listedsubstance = _SubstanceGrpAsgmt.ListedSubstance
--Group Assignment IN EDIT MODE
association [0..*] to C_SubstanceGrpAssgmtTP as _SubstanceGrpAssgmtTP on $projection.SubstanceUUID = _SubstanceGrpAssgmtTP.SubstanceUUID
-- Additional Identifiers
association [0..*] to C_SubstanceAdditionalIdfrTP as _SubstanceAdditionalIdfrTP on $projection.SubstanceUUID = _SubstanceAdditionalIdfrTP.SubstanceUUID
--Listed Substance Primary Names
association [0..*] to C_SubstanceListedSubstanceTxt as _ListedSubPrimNames on $projection.ListedSubstanceUUID = _ListedSubPrimNames.ListedSubstanceUUID
// Using SubstanceUUID as join condition should work because within I_SubstanceActiveDraft
// the SubstanceUUID is determined dynamically (either draft UUID or active UUID depending
// on draft exists or not). However the join condition via SubstanceUUID does not work and
// no texts are shown in edit mode. As a work around we use the ActiveSubstanceUUID in the
// join condition
and $projection.ActiveSubstanceUUID = _ListedSubPrimNames.ActiveSubstanceUUID
-- Language Dependent Substance Names
association [0..*] to C_SubstanceTextTP as _SubstanceText on $projection.SubstanceUUID = _SubstanceText.SubstanceUUID
-- Substance Trade Secret Name
association [0..*] to C_SubstanceTradeSecretTextTP as _SubstanceTradeSecretText on $projection.SubstanceUUID = _SubstanceTradeSecretText.SubstanceUUID
-- Polymer Composition
association [0..*] to C_SubstanceAssgdCmpstn as _Composition on $projection.SubstanceUUID = _Composition.SubstanceUUID
-- Properties
association [0..*] to C_SubstanceAssgdPCPrpty as _Properties on _Properties.SubstanceUUID = $projection.SubstanceUUID
association [0..1] to P_SubstanceAssgdPCEctx as _PCEctxProperty on _PCEctxProperty.SubstanceUUID = $projection.SubstanceUUID
association [0..1] to P_SubstanceAssgdPCPhys as _PCPhysProperty on _PCPhysProperty.SubstanceUUID = $projection.SubstanceUUID
association [0..1] to P_SubstanceAssgdPCTx as _PCPToxProperty on _PCPToxProperty.SubstanceUUID = $projection.SubstanceUUID
association [0..1] to P_SubstanceAssgdPCSfty as _PCPSftyProperty on _PCPSftyProperty.SubstanceUUID = $projection.SubstanceUUID
-- Counters to determine if variants facet shall be shown
association [0..1] to P_SubstanceVariantsCt as _ListedSubstanceVariantsCt on $projection.ListedSubstanceUUID = _ListedSubstanceVariantsCt.ListedSubstanceUUID
association [0..1] to P_SubstanceVarAssgmtCt as _ListedSubstanceVarAssCt on $projection.ActiveSubstanceUUID = _ListedSubstanceVarAssCt.SubstanceUUID
--Value help
association [0..1] to I_RespUnitSubstanceVH as _ResponsibleUnit on $projection.ResponsibleUnit = _ResponsibleUnit.ResponsibleUnit
{
key Substance.SubstanceUUID,
Substance.ActiveSubstanceUUID,
@ObjectModel.readOnly: true
Substance.SubstanceName,
Substance.SubstanceInternalName,
@ObjectModel:
{
readOnly: true
// foreignKey.association: '_ListedSubstanceVH' -> see comment for association _ListedSubstanceVH
}
cast(Substance._ListedSubstance.ListedSubstanceDefaultName as ehfnd_lisu_name_text_long) as ListedSubstanceName,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CntntListedSubstanceDfltName,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CustListedSubstanceDfltName,
//used to search within company substance names
@ObjectModel.readOnly: true
Substance.CompanySubstanceName,
@ObjectModel.readOnly: true
Substance.ListedSubstanceUUID as ListedSubstanceUUID,
// use association to read the listed substance data;
// if data is read in views below, a refresh does not take place after the listed substance link was changed
@ObjectModel.readOnly: true
Substance._ListedSubstance.ListedSubstance,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CntntListedSubstance,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CustListedSubstance,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CASNumber,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CntntCASNumber,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CustCASNumber,
@ObjectModel.readOnly: true
Substance._ListedSubstance.ECNumber,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CntntECNumber,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CustECNumber,
@ObjectModel.readOnly: true
Substance._ListedSubstance.MolecularFormula,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CntntMolecularFormula,
@ObjectModel.readOnly: true
Substance._ListedSubstance.CustMolecularFormula,
@Consumption.valueHelp: '_ResponsibleUnit'
@ObjectModel.text.element: ['ResponsibleUnitName']
@UI.textArrangement: #TEXT_ONLY
Substance.ResponsibleUnit,
@ObjectModel.readOnly: true
_ResponsibleUnit.ResponsibleUnitName as ResponsibleUnitName,
Substance.CreationUTCDateTime,
Substance.CreatedByUser,
Substance.LastChangeUTCDateTime,
// Do not show Last Changed By
// @ObjectModel:
// {
// text.element: [ 'UserDescription' ]
// }
Substance.LastChangedByUser,
// Do not show Last Changed By
// @ObjectModel.readOnly : true
// @Semantics.text: true
// Substance._LastChangedByUser.UserDescription,
@ObjectModel.readOnly: true
@Search:
{
defaultSearchElement : true,
fuzzinessThreshold: 0.8,
ranking: #HIGH
}
Substance.Specification as Specification,
//used to set variants facet invisible
@ObjectModel.readOnly: true
_ListedSubstanceVariantsCt.VariantCount as NmbrOfAvailLstdSubstVariants,
//used to set variants facet invisible
@ObjectModel.readOnly: true
_ListedSubstanceVarAssCt.VariantAssignmentCount as NmbrOfAssgdLstdSubstVariants,
// Substance Group Ranking Visability
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_SUB_CALC_EXIT1'
@ObjectModel.readOnly: true
cast( 'X' as ehfnd_boolean ) as SubstGrpAssgmtRankingIsVisible,
// UUID for Navigation into Ecotox Property
@ObjectModel.readOnly: true
_PCEctxProperty.PCPrptyNavgnLinkUUID as PCEctxPrptyNavgnLinkUUID,
// Active Indicator of Ecotox Property (needed for navigation)
@ObjectModel.readOnly: true
_PCEctxProperty.PCPrptyIsActive as PCEctxPrptyIsActive,
// UUID for Navigation into PhysChem Property
@ObjectModel.readOnly: true
_PCPhysProperty.PCPrptyNavgnLinkUUID as PCPhysPrptyNavgnLinkUUID,
// Active Indicator of Phys-Chem Property (needed for navigation)
@ObjectModel.readOnly: true
_PCPhysProperty.PCPrptyIsActive as PCPhysPrptyIsActive,
// UUID for Navigation into Tox Property
@ObjectModel.readOnly: true
_PCPToxProperty.PCPrptyNavgnLinkUUID as PCPrptyNavgnLinkUUID,
// Active Indicator of Tox Property (needed for navigation)
@ObjectModel.readOnly: true
_PCPToxProperty.PCPrptyIsActive as PCPrptyIsActive,
// UUID for Navigation into SR Property
@ObjectModel.readOnly: true
_PCPSftyProperty.PCPrptyNavgnLinkUUID as PCSftyPrptyNavgnLinkUUID,
// Active Indicator of SR Property (needed for navigation)
@ObjectModel.readOnly: true
_PCPSftyProperty.PCPrptyIsActive as PCSftyPrptyIsActive,
Substance.PolymerIsBsdOnOECDDef as PolymerIsBsdOnOECDDef,
--@ObjectModel.readOnly: true
--_MonomerComposition.ProdCmplncLegalArea as ProdCmplncLegalArea,
@ObjectModel: {
readOnly: true,
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_SUB_ADDIT_IDENT_EXIT',
filter.transformedBy: 'ABAP:CL_EHFND_SUB_ADDIT_IDENT_EXIT'
}
cast('' as ehfnd_sub_add_identifier ) as SubstanceAdditionalIdfrType,
@ObjectModel: {
readOnly: true,
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_SUB_ADDIT_IDENT_EXIT',
filter.transformedBy: 'ABAP:CL_EHFND_SUB_ADDIT_IDENT_EXIT'
}
cast('' as ehfnd_sub_add_identif_concat ) as SubstanceAdditionalIdfrDesc,
// Exposed Associations
@ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
_SubstanceText,
@ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
_SubstanceTradeSecretText,
@ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
_SubstanceVarAssgmt,
@ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
_SubstanceGrpAssgmtTP,
@ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
_SubstanceAdditionalIdfrTP,
_SubstanceGrpAsgmt,
_ListedSubPrimNames,
_ResponsibleUnit,
_Properties,
_Composition
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_RESPUNITSUBSTANCEVH",
"I_SUBSTACTIVEDRAFTLSTDSUBST",
"I_SUBSTANCETP",
"P_SUBSTANCEASSGDPCECTX",
"P_SUBSTANCEASSGDPCPHYS",
"P_SUBSTANCEASSGDPCSFTY",
"P_SUBSTANCEASSGDPCTX",
"P_SUBSTANCEVARASSGMTCT",
"P_SUBSTANCEVARIANTSCT"
],
"ASSOCIATED":
[
"C_SUBSTANCEADDITIONALIDFRTP",
"C_SUBSTANCEASSGDCMPSTN",
"C_SUBSTANCEASSGDPCPRPTY",
"C_SUBSTANCEGRPASSGMT",
"C_SUBSTANCEGRPASSGMTTP",
"C_SUBSTANCELISTEDSUBSTANCETXT",
"C_SUBSTANCETEXTTP",
"C_SUBSTANCETRADESECRETTEXTTP",
"C_SUBSTANCEVARASSGMTQRYTP",
"I_RESPUNITSUBSTANCEVH",
"P_SUBSTANCEASSGDPCECTX",
"P_SUBSTANCEASSGDPCPHYS",
"P_SUBSTANCEASSGDPCSFTY",
"P_SUBSTANCEASSGDPCTX",
"P_SUBSTANCEVARASSGMTCT",
"P_SUBSTANCEVARIANTSCT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/