@EndUserText.label: 'Value Help for Replaced Substances for Matl Bsd Composition'
@AbapCatalog.sqlViewName: 'CMCRPLCDSUBVH'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType: {
serviceQuality: #C,
dataClass: #MIXED,
sizeCategory: #L
}
@ObjectModel.semanticKey: [ 'SubstanceName' ]
@ObjectModel.representativeKey: 'SubstanceUUID'
@ObjectModel.dataCategory: #VALUE_HELP
@Metadata.ignorePropagatedAnnotations: true
@UI:
{
presentationVariant:
[{
sortOrder:
[{
by: 'SubstanceName',
direction: 'ASC'
}],
requestAtLeast:['SubstanceUUID','SubstanceName']
}]
}
@Search.searchable: true
/*----------------------------------------------------------------------------------------------------------------------
Value Help view to find and assign replaced substances
------------------------------------------------------------------------------------------------------------------------*/
define view C_MatlBasedReplacedSubstanceVH
with parameters
-- Legal Deviation UUID
P_LegalDeviationUUID : sysuuid_x,
-- Replaced Substance UUID
P_ReplacedSubstanceUUID : sysuuid_x,
-- Substance Type (Produced or Remaining)
P_MatlBsdCmpstnSubstType : ehfnd_cci_ccomp_mbc_subst_type
-- select Substances
as select from I_SubstanceTP as _Substance
--Join data with draft legal deviations
inner join I_MatlBsdCmpstnLglDvtnDrft as _LegalDeviationDraft on _LegalDeviationDraft.LegalDeviationUUID = $parameters.P_LegalDeviationUUID
--Join data of draft components of material based composition that are already assigned
left outer to one join I_MatlBsdReplacedSubstDraft as _ReplacedSubstanceDraft on _Substance.SubstanceUUID = _ReplacedSubstanceDraft.SubstituteSubstanceUUID
and _ReplacedSubstanceDraft.ReplacedSubstanceUUID = $parameters.P_ReplacedSubstanceUUID
and _ReplacedSubstanceDraft.LegalDeviationUUID = $parameters.P_LegalDeviationUUID
and _ReplacedSubstanceDraft.MatlBsdCmpstnSubstType = $parameters.P_MatlBsdCmpstnSubstType
association [0..*] to I_SubstanceText as _SubstanceText on $projection.SubstanceUUID = _SubstanceText.SubstanceUUID
{
@UI.hidden: true
key $parameters.P_LegalDeviationUUID as LegalDeviationUUID,
@UI.hidden: true
@Consumption.semanticObject: 'SubstanceUUID'
key _Substance.SubstanceUUID,
@UI.hidden: true
@UI.selectionField: [{ exclude: true }]
_Substance.ListedSubstanceUUID,
@UI: {
lineItem : [{
position: 10,
importance: #HIGH
}],
identification : [{
position: 10,
importance: #HIGH
}]
}
_Substance.SubstanceName,
@UI: {
lineItem : [{
position: 20,
importance: #HIGH
}],
identification : [{
position: 20,
importance: #HIGH
}]
}
@Search: {
defaultSearchElement: true,
fuzzinessThreshold: 0.8,
ranking: #LOW
}
_Substance.SubstanceInternalName,
// used to search within listed substance names
// Remark: Do not search on ListedSubstanceDefaultName because it is a calculated field
@UI.hidden:true
@Search:
{
defaultSearchElement: true,
fuzzinessThreshold: 0.8,
ranking: #MEDIUM
}
_Substance._ListedSubstance.CustListedSubstanceDfltName,
// used to search within listed substance names
// Remark: Do not search on ListedSubstanceDefaultName because it is a calculated field
@UI.hidden:true
@Search:
{
defaultSearchElement: true,
fuzzinessThreshold: 0.8,
ranking: #MEDIUM
}
_Substance._ListedSubstance.CntntListedSubstanceDfltName,
//used to search within company substance names
@UI.hidden:true
@Search:
{
defaultSearchElement: true,
fuzzinessThreshold: 0.8,
ranking: #HIGH
}
_Substance.CompanySubstanceName,
// used to search within listed substance names
// Remark: Do not search on ListedSubstance because it is a calculated field
@UI.hidden:true
@Search:
{
defaultSearchElement: true,
fuzzinessThreshold: 0.8,
ranking: #MEDIUM
}
_Substance._ListedSubstance.CustListedSubstance,
// used to search within listed substance names
// Remark: Do not search on ListedSubstance because it is a calculated field
@UI.hidden:true
@Search:
{
defaultSearchElement: true,
fuzzinessThreshold: 0.8,
ranking: #MEDIUM
}
_Substance._ListedSubstance.CntntListedSubstance,
@UI.lineItem: [{
position: 30,
importance: #MEDIUM
}]
_Substance._ListedSubstance.ECNumber,
// used to search for EC number
// Remark: Do not search on EC Number because it is a calculated field
@UI.hidden:true
@Search: {
defaultSearchElement: true,
fuzzinessThreshold: 0.9,
ranking: #MEDIUM
}
_Substance._ListedSubstance.CustECNumber,
// used to search for EC number
// Remark: Do not search on EC Number because it is a calculated field
@UI.hidden:true
@Search: {
defaultSearchElement: true,
fuzzinessThreshold: 0.9,
ranking: #MEDIUM
}
_Substance._ListedSubstance.CntntECNumber,
@UI: {
lineItem: [{
position: 40,
importance: #MEDIUM
}]
}
_Substance._ListedSubstance.CASNumber,
// used to search for EC number
// Remark: Do not search on CAS Number because it is a calculated field
@UI.hidden:true
@Search: {
defaultSearchElement: true,
fuzzinessThreshold: 0.9,
ranking: #MEDIUM
}
_Substance._ListedSubstance.CustCASNumber,
// used to search for EC number
// Remark: Do not search on CAS Number because it is a calculated field
@UI.hidden:true
@Search: {
defaultSearchElement: true,
fuzzinessThreshold: 0.9,
ranking: #MEDIUM
}
_Substance._ListedSubstance.CntntCASNumber,
// used to search for EC number
// Remark: Do not search on MolecularFormula because it is a calculated field
@UI.hidden:true
@Search: {
defaultSearchElement: true,
fuzzinessThreshold: 0.7,
ranking: #LOW
}
_Substance._ListedSubstance.CustMolecularFormula,
// used to search for EC number
// Remark: Do not search on MolecularFormula because it is a calculated field
@UI.hidden:true
@Search: {
defaultSearchElement: true,
fuzzinessThreshold: 0.7,
ranking: #LOW
}
_Substance._ListedSubstance.CntntMolecularFormula,
@UI.hidden: true
_Substance.ResponsibleUnit,
// Associations
_SubstanceText
}
where --Select components which are not assigned in before production in the current draft table
_ReplacedSubstanceDraft.LegalDeviationUUID is null
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATLBSDCMPSTNLGLDVTNDRFT",
"I_MATLBSDREPLACEDSUBSTDRAFT",
"I_SUBSTACTIVEDRAFTLSTDSUBST",
"I_SUBSTANCETP"
],
"ASSOCIATED":
[
"I_SUBSTANCETEXT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/