@EndUserText.label: 'Production Model Component Instance'
@AccessControl.authorizationCheck: #MANDATORY
@VDM.viewType: #COMPOSITE
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #C,
sizeCategory: #L,
dataClass: #TRANSACTIONAL
}
define view entity I_ProdnModelComponentInstance
as select from I_BillOfMaterialComponent as BOMItem
inner join I_ProductionModel as ProductionModel on ProductionModel.BillOfMaterialCategory = BOMItem.BillOfMaterialCategory
and ProductionModel.BillOfMaterial = BOMItem.BillOfMaterial
and ProductionModel.BillOfMaterialVariant = BOMItem.BillOfMaterialVariant
and ProductionModel.BillOfMaterialVersion = BOMItem.BillOfMaterialVersion
// inner join I_ProductionModelComponent as HeaderComponent on HeaderComponent.ProductionModelUUID = ProductionModel.ProductionModelUUID
// and HeaderComponent.ProductionModelComponentUUID = BOMItem.BillOfMaterialItemUUID
// and HeaderComponent.BillOfOperationsGroup = ProductionModel.BillOfOperationsGroup
// and HeaderComponent.BillOfOperationsType = ProductionModel.BillOfOperationsType
// and HeaderComponent.BillOfOperationsVariant = ProductionModel.BillOfOperationsVariant
// and HeaderComponent.BillOfOperationsVersion = ProductionModel.BillOfOperationsVersion
inner join I_DigitalMockUp as ComponentInstance on ComponentInstance.DgtlMockUpUUID = BOMItem.BillOfMaterialItemUUID
inner join P_ProdnModelDgtlMockUpInstance as DgtlMockUpInstance on DgtlMockUpInstance.DgtlMockUpUUID = BOMItem.BillOfMaterialItemUUID
inner join I_DigitalMockUpCharcs as DigitalMockUpCharcs on DigitalMockUpCharcs.DgtlMockUpCharcsUUID = ComponentInstance.DgtlMockUpCharcsUUID
and DigitalMockUpCharcs.DgtlMockUpCharcsName = 'ORIGINAL_TMXGUID'
// association [0..1] to I_MaterialText as _MaterialText on _MaterialText.Material = BOMItem.BillOfMaterialComponent
// and _MaterialText.Language = $session.system_language
// association [0..1] to I_BomItemCategoryText as _BOMItemCategoryText on $projection.BillOfMaterialItemCategory = _BOMItemCategoryText.BillOfMaterialItemCategory
// and _BOMItemCategoryText.Language = $session.system_language
// association [0..1] to I_MRPQuantityDistrKeyText as _DistrKeyText on $projection.Plant = _DistrKeyText.Plant
// and $projection.DistrKeyCompConsumption = _DistrKeyText.QuantityDistributionKey
// and _DistrKeyText.Language = $session.system_language
// association [0..1] to I_ExplosionTypeVH as _ExplosionTypeText on $projection.ExplosionType = _ExplosionTypeText.ExplosionType
// association [0..1] to I_SpecialProcurementType as _SpecialProcTypeText on $projection.Plant = _SpecialProcTypeText.Plant
// and $projection.SpecialProcurementType = _SpecialProcTypeText.SpecialProcurementType
// association [0..1] to I_AltItemStrategyVH as _AltItemStrategyText on $projection.AlternativeItemStrategy = _AltItemStrategyText.AlternativeItemStrategy
// and _AltItemStrategyText.Language = $session.system_language
// association [0..1] to I_ReferencePointVH as _ReferencePointText on $projection.ReferencePoint = _ReferencePointText.ReferencePoint
// association [0..1] to I_BOMItemCostingRelevant as _CostingRelevantText on $projection.BOMItemIsCostingRelevant = _CostingRelevantText.BOMItemIsCostingRelevant
// association [0..1] to I_MatProvisionIndicatorVH as _MatProvisionIndText on $projection.IsMaterialProvision = _MatProvisionIndText.IsMaterialProvision
// association [0..1] to I_StorageLocation as _IssueLocationText on $projection.Plant = _IssueLocationText.Plant
// and $projection.ProdOrderIssueLocation = _IssueLocationText.StorageLocation
// association [0..1] to I_ProductionSupplyAreaText as _ProdSupplyAreaText on $projection.Plant = _ProdSupplyAreaText.Plant
// and $projection.ProductionSupplyArea = _ProdSupplyAreaText.ProductionSupplyArea
// and _ProdSupplyAreaText.Language = $session.system_language
// association [0..1] to I_BOMItemSparePart as _SparePartText on $projection.BOMItemIsSparePart = _SparePartText.BOMItemIsSparePart
// association [0..1] to I_BOMItemSalesRelevant as _SalesRelevantText on $projection.BOMItemSalesRelevancy = _SalesRelevantText.BOMItemIsSalesRelevant
// association [0..1] to I_PurchasingOrganization as _PurchasingOrgText on $projection.PurchasingOrganization = _PurchasingOrgText.PurchasingOrganization
// association [0..1] to I_PurchasingGroup as _PurchasingGroupText on $projection.PurchasingGroup = _PurchasingGroupText.PurchasingGroup
// association [0..1] to I_MaterialGroupText as _MaterialGroupText on $projection.MaterialGroup = _MaterialGroupText.MaterialGroup
// and _MaterialGroupText.Language = $session.system_language
// association [0..1] to I_Supplier as _SupplierText on $projection.Creditor = _SupplierText.Supplier
// association [0..1] to I_CostElementText as _CostElementText on $projection.CostElement = _CostElementText.CostElement // Need to add key fields
// and _CostElementText.Language = $session.system_language
// association [0..1] to I_ProductSupplyPlanning as _MaterialPlant on $projection.BillOfMaterialComponent = _MaterialPlant.Product
// and $projection.Plant = _MaterialPlant.Plant
association [1..1] to I_ProductionModel as _ProductionModel on $projection.ProductionModelUUID = _ProductionModel.ProductionModelUUID
association [1..1] to I_ProductionModelComponent as _HeaderComponent on $projection.ProductionModelUUID = _HeaderComponent.ProductionModelUUID
and $projection.ProductionModelComponentUUID = _HeaderComponent.ProductionModelComponentUUID
association [0..1] to P_ProdnModCompInstceRefDsgntr as _CompInstceRefDesignator on $projection.DgtlMockUpCharcsUUID = _CompInstceRefDesignator.DgtlMockUpCharcsUUID
{
key ProductionModel.ProductionModelUUID,
key BOMItem.BillOfMaterialItemUUID as ProductionModelComponentUUID,
key ComponentInstance.DgtlMockUpTrnsfmtnMatrixCount,
key ComponentInstance.DgtlMockUpInstceCount,
ComponentInstance.DgtlMockUpCharcsUUID,
DigitalMockUpCharcs.DgtlMockUpCharcsValue,
_CompInstceRefDesignator.ReferenceDesignatorValue,
BOMItem.BillOfMaterialCategory,
// cast( BOMItem.BillOfMaterial as cs_stlnr preserving type ) as BillOfMaterial,
// HeaderComponent.Material,
ProductionModel.Plant,
ProductionModel.BillOfMaterialVariantUsage,
// BOMItem.BillOfMaterialVariant,
BOMItem.BillOfMaterialItemNodeNumber,
// BOMItem.BillOfMaterialVersion,
// HeaderComponent.BillOfOperationsGroup,
ProductionModel.BillOfOperationsType,
// HeaderComponent.BillOfOperationsVariant,
// HeaderComponent.BillOfOperationsVersion,
// BOMItem.ValidityStartDate,
// BOMItem.ValidityEndDate,
// BOMItem.EngineeringChangeDocument,
// BOMItem.ChgToEngineeringChgDocument,
BOMItem.InheritedNodeNumberForBOMItem,
BOMItem.InheritedNodeNumberVersionBOM,
BOMItem.BOMItemInternalChangeCount,
// BOMItem.BillOfMaterialComponent,
// BOMItem.ComponentDescription,
// BOMItem.BillOfMaterialItemCategory,
// cast( BOMItem.BillOfMaterialItemNumber as cs_sposn preserving type ) as BillOfMaterialItemNumber,
BOMItem.BillOfMaterialItemUnit,
@Semantics.quantity.unitOfMeasure: 'BillOfMaterialItemUnit'
cast('1.000' as kmpmg ) as BillOfMaterialItemQuantity,
@Semantics.booleanIndicator: true
// BOMItem.IsAssembly,
// @Semantics.booleanIndicator: true
// BOMItem.IsSubItem,
// @Semantics.booleanIndicator: true
// BOMItem.IsDeleted,
// BOMItem.IdentifierBOMItem,
// BOMItem.BOMItemSorter,
// @Semantics.booleanIndicator: true
// BOMItem.BOMItemHasFixedQuantity,
// BOMItem.ComponentScrapInPercent,
// BOMItem.OperationScrapInPercent,
// @Semantics.booleanIndicator: true
// BOMItem.IsNetScrap,
// @Semantics.booleanIndicator: true
// BOMItem.IsBulkMaterial,
// @Semantics.booleanIndicator: true
// _MaterialPlant.IsBulkMaterialComponent,
// @Semantics.booleanIndicator: true
// BOMItem.IsMaterialProvision,
// @Semantics.booleanIndicator: true
// BOMItem.BOMItemIsSparePart,
// @Semantics.booleanIndicator: true
// BOMItem.BOMItemIsSalesRelevant as BOMItemSalesRelevancy,
// @Semantics.booleanIndicator: true
// BOMItem.IsEngineeringRelevant,
// @Semantics.booleanIndicator: true
// BOMItem.BOMItemIsPlantMaintRelevant,
// @Semantics.booleanIndicator: true
// BOMItem.IsProductionRelevant,
// @Semantics.booleanIndicator: true
// BOMItem.BOMItemIsCostingRelevant,
// @Semantics.booleanIndicator: true
// BOMItem.BOMIsRecursive,
// @Semantics.booleanIndicator: true
// BOMItem.IsBOMRecursiveAllowed,
// BOMItem.FollowUpGroup,
// BOMItem.AlternativeItemGroup,
// BOMItem.MaterialIsCoProduct,
// BOMItem.AlternativeItemPriority,
// BOMItem.AlternativeItemStrategy,
// @Semantics.booleanIndicator: true
// BOMItem.IsALE,
// BOMItem.UsageProbabilityPercent,
// BOMItem.DocumentIsCreatedByCAD,
// BOMItem.DependencyObjectNumber,
// BOMItem.DiscontinuationGroup,
// BOMItem.LeadTimeOffset,
// BOMItem.OperationLeadTimeOffset,
// BOMItem.OpsLeadTimeOffsetUnit,
// BOMItem.DistrKeyCompConsumption,
// BOMItem.IsPhantomItem,
// BOMItem.PurchasingGroup,
// BOMItem.DeliveryDurationInDays,
// BOMItem.Creditor,
// @Semantics.amount.currencyCode : 'Currency'
// BOMItem.MaterialComponentPrice,
// // BOMItem.MaterialPriceUnitQty,
// BOMItem.Currency,
// BOMItem.CostElement,
// BOMItem.MaterialGroup,
// BOMItem.GoodsReceiptDuration,
// BOMItem.PurchasingOrganization,
// @Semantics.quantity.unitOfMeasure: 'UnitOfMeasureForSize1To3'
// BOMItem.Size1,
// @Semantics.quantity.unitOfMeasure: 'UnitOfMeasureForSize1To3'
// BOMItem.Size2,
// @Semantics.quantity.unitOfMeasure: 'UnitOfMeasureForSize1To3'
// BOMItem.Size3,
// BOMItem.UnitOfMeasureForSize1To3,
// @Semantics.quantity.unitOfMeasure: 'VariableSizeCompUnitOfMeasure'
// BOMItem.QuantityVariableSizeItem,
// // @Semantics.quantity.unitOfMeasure: 'BillOfMaterialItemUnit'
// // BOMItem.NumberOfVariableSizeItem,
// // BOMItem.UnitOfMeasureForVarSizeItem,
// BOMItem.FormulaKey,
// BOMItem.VariableSizeCompUnitOfMeasure,
// BOMItem.BOMItemDescription,
// BOMItem.BOMItemText2,
// BOMItem.DocumentType,
// BOMItem.DocNumber,
// BOMItem.DocumentVersion,
// BOMItem.DocumentPart,
// BOMItem.ProdOrderIssueLocation,
// BOMItem.ProductionSupplyArea,
// BOMItem.ExplosionType,
// BOMItem.SpecialProcurementType,
// BOMItem.ReferencePoint,
// BOMItem.PreliminaryMaterial,
// BOMItem.IsPMAssemblyRelevant,
// BOMItem.BOMItemRecordCreationDate,
// BOMItem.BOMItemCreatedByUser,
// BOMItem.BOMItemLastChangeDate,
// BOMItem.BOMItemLastChangedByUser,
//
// /* Associations */
// _BOMItemCategoryText,
// _DistrKeyText,
// _ExplosionTypeText,
// _SpecialProcTypeText,
// _AltItemStrategyText,
// _ReferencePointText,
// _CostingRelevantText,
// _MatProvisionIndText,
// _IssueLocationText,
// _ProdSupplyAreaText,
// _SparePartText,
// _SalesRelevantText,
// _PurchasingOrgText,
// _PurchasingGroupText,
// _MaterialGroupText,
// _SupplierText,
// _CostElementText,
/* Associations */
_ProductionModel,
_HeaderComponent
}
where
(
BOMItem.BillOfMaterialCategory = 'K'
or BOMItem.BillOfMaterialCategory = 'M'
)
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLOFMATERIALCOMPONENT",
"I_DIGITALMOCKUP",
"I_DIGITALMOCKUPCHARCS",
"I_PRODUCTIONMODEL",
"P_PRODNMODCOMPINSTCEREFDSGNTR",
"P_PRODNMODELDGTLMOCKUPINSTANCE"
],
"ASSOCIATED":
[
"I_PRODUCTIONMODEL",
"I_PRODUCTIONMODELCOMPONENT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/