@EndUserText.label: 'Substance Indicated as CBI'
@AbapCatalog.sqlViewName: 'CPCTRDSCRTSUBVH'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType: {
serviceQuality: #C,
dataClass: #MIXED,
sizeCategory: #L
}
@ObjectModel.representativeKey: 'SubstanceUUID'
@ObjectModel.semanticKey: [ 'SubstanceName' ]
@ObjectModel.dataCategory: #VALUE_HELP
@Metadata.ignorePropagatedAnnotations: true
@UI:
{
presentationVariant:
{
requestAtLeast: [ 'SubstanceUUID', 'SubstanceName', 'SubstanceTradeSecretName', 'ChmlCompReldQtyAsText', 'ChmlCompReldLowrLimitQtyOptr', 'ChmlCompReldLowrLimitQtyAsText', 'ChmlCompReldUprLimitQtyOptr', 'ChmlCompReldUprLimitQtyAsText', 'ChmlCompReldQtyUnitText' ]
}
}
@Search.searchable: true
/*----------------------------------------------------------------------------------------------------------------------
Value Help view to find and assign produced substances that are not already used in the (draft) composition
------------------------------------------------------------------------------------------------------------------------*/
define view C_PCTrdScrtSubstVH
with parameters
P_ChmlCompositionUUID : sysuuid_x
as select from I_ChmlComponent as _ChmlComponent
inner join I_ChmlCompositionDraft as _PCTrdScrtDraft on _PCTrdScrtDraft.ChmlCompositionUUID = $parameters.P_ChmlCompositionUUID
inner join I_ChmlComposition as _ChmlComposition on _ChmlComposition.ChmlCompositionType = _PCTrdScrtDraft.ProdCmplncLegalAreaRef
and _ChmlComposition.ChmlCompositionUUID = _ChmlComponent.ChmlCompositionUUID
and _ChmlComposition.ChmlCompositionStatus = 'RE'
and _PCTrdScrtDraft.ChmlCmplncInfoUUID = _ChmlComposition.ChmlCmplncInfoUUID
--Join data of draft components of substance-based composition that are already assigned
left outer to one join I_SubstBsdCmpstnComponentDraft as _PCTrdScrtSubstDraft on _PCTrdScrtSubstDraft.SubstanceUUID = _ChmlComponent.SubstanceUUID
and _PCTrdScrtSubstDraft.ChmlCompositionUUID = _PCTrdScrtDraft.ChmlCompositionUUID
association [0..1] to I_SubstanceTP as _Substance on _ChmlComponent.SubstanceUUID = _Substance.SubstanceUUID
-- Unit Of Measure Value Help
association [0..*] to I_UnitOfMeasureText as _UnitOfMeasureText on $projection.ChmlCompReldQtyUnit = _UnitOfMeasureText.UnitOfMeasure
--Link to 'Chemcial Compliance Info' as root
association [1..1] to I_ChmlCmplncInfo as _ChmlCmplncInfo on $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID
-- Trade Secret Name
association [0..1] to C_SubstanceTradeSecretTextTP as _TradeSecretName on $projection.SubstanceUUID = _TradeSecretName.SubstanceUUID
{
@UI.hidden: true
key $parameters.P_ChmlCompositionUUID as ChmlCompositionUUID,
@UI.hidden: true
@UI.selectionField.exclude: true
@Consumption.semanticObject: 'SubstanceUUID'
key _ChmlComponent.SubstanceUUID as SubstanceUUID,
@UI: {
lineItem : [{
position: 10,
importance: #HIGH
}]
}
_Substance.SubstanceName as SubstanceName,
@Search: {
defaultSearchElement: true,
fuzzinessThreshold: 0.8,
ranking: #LOW
}
_Substance.SubstanceInternalName as SubstanceInternalName,
//used to search within company substance names
@UI.hidden:true
@Search:
{
defaultSearchElement: true,
fuzzinessThreshold: 0.8,
ranking: #HIGH
}
_Substance.CompanySubstanceName as CompanySubstanceName,
-- ECNumber
_Substance._ListedSubstance.ECNumber as ECNumber,
@UI: {
lineItem: [{
position: 20,
importance: #MEDIUM
}]
}
_Substance._ListedSubstance.CASNumber as CASNumber,
@UI: {
lineItem: [{
position: 30,
importance: #MEDIUM,
label: 'Generic Name'
}]
}
@ObjectModel.readOnly: true
_TradeSecretName[1:Language = $session.system_language].SubstanceTradeSecretName as SubstanceTradeSecretName,
@UI.hidden: true
_Substance.ResponsibleUnit as ResponsibleUnit,
--Role of Ingredient
@ObjectModel.text.element: [ 'ChmlCompTypeName' ]
@UI.lineItem: [{ position: 40, importance: #MEDIUM }]
@UI.textArrangement: #TEXT_ONLY
_ChmlComponent.ChmlCompType as ChmlCompType,
--Description of Component Type
@Semantics.text: true
_ChmlComponent._ComponentType._Text[1: Language = $session.system_language ].ChmlCompTypeName as ChmlCompTypeName,
--Concentration
_ChmlComponent.ChmlCompQtyAsText as ChmlCompReldQtyAsText,
--Concentration Range
_ChmlComponent.ChmlCompOperatorLowerLimit as ChmlCompReldLowrLimitQtyOptr,
_ChmlComponent.ChmlCompQtyLowerLimitAsText as ChmlCompReldLowrLimitQtyAsText,
_ChmlComponent.ChmlCompOperatorUpperLimit as ChmlCompReldUprLimitQtyOptr,
_ChmlComponent.ChmlCompQtyUpperLimitAsText as ChmlCompReldUprLimitQtyAsText,
-- UoM Code (e.g. PPM)
@ObjectModel.text.element: ['ChmlCompReldQtyUnitText']
@ObjectModel.mandatory: true
_ChmlComponent.ChmlCompQtyUnit as ChmlCompReldQtyUnit,
-- UoM Short Text (e.g. ppm)
@Semantics.text: true
@ObjectModel.readOnly: true
_UnitOfMeasureText[1: Language = $session.system_language ].UnitOfMeasureName as ChmlCompReldQtyUnitText,
@UI.hidden: true
_ChmlComposition.ChmlCmplncInfoUUID,
_Substance,
_ChmlCmplncInfo
}
where --Select components which are not already assigned
_PCTrdScrtSubstDraft.ChmlCompositionUUID is null
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"C_SUBSTANCETRADESECRETTEXTTP",
"I_CHMLCOMPONENT",
"I_CHMLCOMPOSITION",
"I_CHMLCOMPOSITIONDRAFT",
"I_CHMLCOMPTYPE",
"I_CHMLCOMPTYPETEXT",
"I_SUBSTACTIVEDRAFTLSTDSUBST",
"I_SUBSTANCETP",
"I_SUBSTBSDCMPSTNCOMPONENTDRAFT",
"I_UNITOFMEASURETEXT"
],
"ASSOCIATED":
[
"C_SUBSTANCETRADESECRETTEXTTP",
"I_CHMLCMPLNCINFO",
"I_SUBSTANCETP",
"I_UNITOFMEASURETEXT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/