Value Help for Produced Substances for Matl Bsd Composition
C_MatlBasedProducedSubstanceVH is a Consumption CDS View that provides data about "Value Help for Produced Substances for Matl Bsd Composition" in SAP S/4HANA. It reads from 2 data sources (I_MatlBasedCompositionDraft, I_SubstanceTP) and exposes 20 fields with key fields ChmlCompositionUUID, SubstanceUUID. It has 1 association to related views. Part of development package EHFND_CNS_CMPS_MATLBASED.
@EndUserText.label: 'Value Help for Produced Substances for Matl Bsd Composition'
@AbapCatalog.sqlViewName: 'CMCPRODSUBVH'
@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', 'CASNumber' ]
}]
}
@Search.searchable: true/*----------------------------------------------------------------------------------------------------------------------
Value Help view to find and assign produced substances that are not already used in the (draft) composition
------------------------------------------------------------------------------------------------------------------------*/defineview C_MatlBasedProducedSubstanceVH
withparameters
P_ChmlCompositionUUID : sysuuid_x
-- select Substances
asselectfrom I_SubstanceTP as _Substance
--Join data with draft compositions
innerjoin I_MatlBasedCompositionDraft as _MatlBasedCompositionDraft on _MatlBasedCompositionDraft.ChmlCompositionUUID = $parameters.P_ChmlCompositionUUID
--Join data of draft components of material based composition that are already assigned
leftouter to one join I_MatlBsdProducedSubstDraft as _MatlBsdProducedSubstDraft on _MatlBsdProducedSubstDraft.ChmlCompositionUUID = $parameters.P_ChmlCompositionUUID
and _MatlBsdProducedSubstDraft.SubstanceUUID = _Substance.SubstanceUUID
and (
_MatlBsdProducedSubstDraft.MatlBsdCmpstnSubstType = 'PROD'
or _MatlBsdProducedSubstDraft.MatlBsdCmpstnSubstType isnullor _MatlBsdProducedSubstDraft.MatlBsdCmpstnSubstType is initial
)
association [0..*] to I_SubstanceText as _SubstanceText on $projection.SubstanceUUID = _SubstanceText.SubstanceUUID
{
@UI.hidden: truekey $parameters.P_ChmlCompositionUUID as ChmlCompositionUUID,
@UI.hidden: true@UI.selectionField: [{ exclude: true }]@Consumption.semanticObject: 'SubstanceUUID'
key _Substance.SubstanceUUID,
@UI.hidden: true@UI.selectionField: [{ exclude: true }]
_Substance.ListedSubstanceUUID,
_Substance.SubstanceName,
@UI.hidden:true@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.hidden:true
_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: 20,
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
_MatlBsdProducedSubstDraft.ChmlCompositionUUID isnull