@AbapCatalog.sqlViewName: 'CMMMATL_VH'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@VDM.viewType: #CONSUMPTION
@ObjectModel.dataCategory: #VALUE_HELP
@Search.searchable: true
@ObjectModel.semanticKey: [ 'Material', 'Plant' ]
@ObjectModel.representativeKey: [ 'Material' , 'Plant' ]
@ObjectModel.usageType.dataClass: #MASTER
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #S
@EndUserText.label: 'Material Value Help'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #NOT_REQUIRED
@Consumption.ranked: true
define view C_MM_MaterialValueHelp
as select from I_MaterialPlant
// left outer to one join I_Material as _Material on I_MaterialPlant.Material = _Material.Material
left outer to one join I_Product as _Material on I_MaterialPlant.Material = _Material.Product
association [0..1] to I_MaterialText as _MaterialText on $projection.Material = _MaterialText.Material
and _MaterialText.Language = $session.system_language
association [0..1] to I_Plant as _Plant on $projection.Plant = _Plant.Plant
association [0..1] to I_MaterialGroupText as _MaterialGroupText on $projection.MaterialGroup = _MaterialGroupText.MaterialGroup
and _MaterialGroupText.Language = $session.system_language
association [0..1] to I_MaterialTypeText as _MaterialTypeText on $projection.MaterialType = _MaterialTypeText.MaterialType
and _MaterialTypeText.Language = $session.system_language
association [0..1] to I_Producttype as _ProductType on $projection.MaterialType = _ProductType.ProductType
association [0..1] to I_MaterialType as _MaterialType on $projection.MaterialType = _MaterialType.MaterialType
association [0..1] to I_MaterialGroup as _MaterialGroup on $projection.MaterialGroup = _MaterialGroup.MaterialGroup
association [0..1] to I_CO2eqFprntAvgRltvBaseUoM as _CO2eqFprntAvgRltvBaseUoM on $projection.Material = _CO2eqFprntAvgRltvBaseUoM.Product
and $projection.Plant = _CO2eqFprntAvgRltvBaseUoM.Plant
association [0..1] to I_UnitOfMeasure as _UnitOfMeasure on $projection.PFMFootprintUnit = _UnitOfMeasure.UnitOfMeasure
{
@ObjectModel.text.element: [ 'MaterialName' ]
@Search: { defaultSearchElement: true, ranking: #HIGH , fuzzinessThreshold: 0.7}
key I_MaterialPlant.Material as Material,
// @Search: { defaultSearchElement: true, ranking: #HIGH , fuzzinessThreshold: 0.7 }
// @EndUserText.label: 'MaterialExternal'
// key _Material.ProductExternalID as MaterialExternal,
//
@Search: { defaultSearchElement: true, ranking: #LOW , fuzzinessThreshold: 0.8}
@ObjectModel.foreignKey.association: '_Plant'
key I_MaterialPlant.Plant as Plant,
@UI.hidden: true
@Search: { defaultSearchElement: true, ranking: #HIGH , fuzzinessThreshold: 0.8}
@EndUserText.label: 'MaterialExternal'
_Material.ProductExternalID as ProductExternalID,
@Semantics.text: true
@Search: { defaultSearchElement: true, ranking: #MEDIUM , fuzzinessThreshold: 0.8}
_MaterialText[1: Language = $session.system_language].MaterialName as MaterialName,
@Search: { defaultSearchElement: true, ranking: #LOW, fuzzinessThreshold: 0.7 }
_Plant.PlantName as PlantName,
@Search: { defaultSearchElement: true, ranking: #LOW, fuzzinessThreshold: 0.7}
// _Material.MaterialGroup as MaterialGroup,
_Material.ProductGroup as MaterialGroup,
@Search: { defaultSearchElement: true, ranking: #LOW, fuzzinessThreshold: 0.7 }
_MaterialGroupText.MaterialGroupName as MaterialGroupName,
@Search: { defaultSearchElement: true, ranking: #LOW, fuzzinessThreshold: 0.7}
// _Material.MaterialType as MaterialType,
_Material.ProductType as MaterialType,
// _Material.AuthorizationGroup as AuthorizationGroup,
_Material.AuthorizationGroup as AuthorizationGroup,
@EndUserText.label: 'Material Type Desc.'
@Search: { defaultSearchElement: true, ranking: #LOW, fuzzinessThreshold: 0.7 }
_MaterialTypeText.MaterialTypeName as MaterialTypeName,
@Search: { defaultSearchElement: true, ranking: #LOW, fuzzinessThreshold: 0.7}
@UI.hidden: true
// _Material.MaterialBaseUnit as MaterialBaseUnit,
_Material.BaseUnit as MaterialBaseUnit,
@ObjectModel.text.element: [ 'ProductTypeName' ]
@Search: { defaultSearchElement: true, ranking: #LOW, fuzzinessThreshold: 0.7}
_ProductType.ProductTypeCode as ProductTypeCode ,
@EndUserText.label: 'Product Type Desc.'
@Semantics.text: true
_ProductType._ProductTypeCode._Text[1: Language = $session.system_language].Name as ProductTypeName ,
@Feature: 'BF:PFM_PROCESSINTEGRATION'
// @EndUserText.label: 'CO2eq Footprint Quantity'
@Semantics.quantity.unitOfMeasure: 'PFMFootprintUnit'
//cast( _CO2eqFprntAvgRltvBaseUoM.PFMFootprintQuantity as abap.dec(24,6) ) as PFMFootprintQuantity,
_CO2eqFprntAvgRltvBaseUoM.PFMFootprintFxdPtDcmlQuantity as PFMFootprintQuantity,
@Feature: 'BF:PFM_PROCESSINTEGRATION'
@EndUserText.label: 'CO2e Footprint Unit'
@ObjectModel.foreignKey.association: '_UnitOfMeasure'
@Semantics.unitOfMeasure: true
_CO2eqFprntAvgRltvBaseUoM.PFMFootprintUnit as PFMFootprintUnit,
// @Consumption.hidden: true
// @Search: { defaultSearchElement: true, ranking: #HIGH , fuzzinessThreshold: 0.8 }
// cast ( Material.Material as odata_mm_matnr preserving type ) as MaterialWithAlphaForSearch,
_Plant,
_MaterialType,
_ProductType,
_MaterialGroup,
// _BaseUnit,
_BaseUnitOfMeasure as _BaseUnit,
_UnitOfMeasure,
_Material
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CO2EQFPRNTAVGRLTVBASEUOM",
"I_MATERIALGROUPTEXT",
"I_MATERIALPLANT",
"I_MATERIALTEXT",
"I_MATERIALTYPETEXT",
"I_PLANT",
"I_PRODUCT",
"I_PRODUCTTYPE",
"I_PRODUCTTYPECODE",
"I_PRODUCTTYPECODETEXT"
],
"ASSOCIATED":
[
"I_CO2EQFPRNTAVGRLTVBASEUOM",
"I_MATERIAL",
"I_MATERIALGROUP",
"I_MATERIALGROUPTEXT",
"I_MATERIALTEXT",
"I_MATERIALTYPE",
"I_MATERIALTYPETEXT",
"I_PLANT",
"I_PRODUCTTYPE",
"I_UNITOFMEASURE"
],
"BASE":
[
"I_MATERIALPLANT",
"I_PRODUCT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/