@AbapCatalog.sqlViewName: 'PPROCORDMGMTBSC'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AccessControl.privilegedAssociations: ['_MRPController', '_ProductionSupervisor', '_CreatedByUser', '_LastChangedByUser' ]
@ClientHandling.algorithm: #SESSION_VARIABLE
@ClientHandling.type: #CLIENT_DEPENDENT
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.representativeKey: 'ManufacturingOrder'
@ObjectModel.usageType: {serviceQuality: #B, sizeCategory: #L, dataClass: #TRANSACTIONAL}
@VDM.private: true
@VDM.viewType: #COMPOSITE
//@EndUserText.label: 'Process order'
define view P_ProcOrdMgmtBasic
as select from P_ProcessOrderHeader as head
// as select from P_ProcOrdAORListDistinct as _AORList
// inner join I_LogisticsOrder as head on head.OrderID = _AORList.OrderID
// and head.Plant = _AORList.Plant
// and head.ProductionSupervisor = _AORList.ProductionSupervisor
// association [0..1] to P_ProcOrdMgmtBatchCalc as _ProcOrdBatch on $projection.ManufacturingOrder = _ProcOrdBatch.ProcessOrder
// and $projection.ProductionPlant = _ProcOrdBatch.ProductionPlant
// and $projection.ProductionSupervisor = _ProcOrdBatch.ProductionSupervisor
// ----- KB ----- //
// left outer to one join I_ManufacturingOrderItem as item on item.ManufacturingOrder = _AORList.OrderID
// and item.ProductionPlant = _AORList.Plant
// and item.ProductionSupervisor = _AORList.ProductionSupervisor
// and item.ManufacturingOrderItem = '0001'
// and item.ManufacturingOrderCategory = '40'
// ----- KB ----- //
association [1..1] to I_MfgOrderCategory as _MfgOrderCategory on $projection.ManufacturingOrderCategory = _MfgOrderCategory.ManufacturingOrderCategory
association [1..1] to I_MfgOrderType as _MfgOrderType on $projection.ManufacturingOrderType = _MfgOrderType.ManufacturingOrderType
association [0..1] to I_ManufacturingOrder as _ReferenceOrder on $projection.ReferenceOrder = _ReferenceOrder.ManufacturingOrder
association [0..1] to I_ManufacturingOrder as _LeadingOrder on $projection.LeadingOrder = _LeadingOrder.ManufacturingOrder
association [0..1] to I_ManufacturingOrder as _SuperiorOrder on $projection.SuperiorOrder = _SuperiorOrder.ManufacturingOrder
association [1..1] to I_OrderInternalID as _OrderInternalID on $projection.MfgOrderInternalID = _OrderInternalID.OrderInternalID
association [0..1] to I_Language as _LongTextLanguage on $projection.LongTextLanguageCode = _LongTextLanguage.Language
association [1..1] to I_UnitOfMeasure as _ProductionUnit on $projection.ProductionUnit = _ProductionUnit.UnitOfMeasure
association [1..1] to I_User as _CreatedByUser on $projection.CreatedByUser = _CreatedByUser.UserID
association [0..1] to I_User as _LastChangedByUser on $projection.LastChangedByUser = _LastChangedByUser.UserID
association [1..1] to I_Plant as _ProductionPlant on $projection.ProductionPlant = _ProductionPlant.Plant
// ----- KB ----- //
// association [0..1] to I_Plant as _PlanningPlant on $projection.planningplant = _PlanningPlant.Plant
// association [0..1] to I_MRPArea as _MRPArea on $projection.mrparea = _MRPArea.MRPArea
// association [0..1] to I_StorageLocation as _StorageLocation on $projection.ProductionPlant = _StorageLocation.Plant
// and $projection.storagelocation = _StorageLocation.StorageLocation
// association [0..*] to I_Batch as _Batch on $projection.Material = _Batch.Material
// and $projection.batch = _Batch.Batch
// association [0..1] to I_Product as _Product on $projection.product = _Product.Product
// association [1..*] to I_ProductUnitsOfMeasure as _ProductUnitsOfMeasure on $projection.product = _ProductUnitsOfMeasure.Product
// association [0..1] to I_ProductPlant as _ProductPlant on $projection.ProductionPlant = _ProductPlant.Plant
// and $projection.product = _ProductPlant.Product
// association [0..1] to I_ProductStorageLocation as _ProductStorageLocation on $projection.Material = _ProductStorageLocation.Product
// and $projection.ProductionPlant = _ProductStorageLocation.Plant
// and $projection.storagelocation = _ProductStorageLocation.StorageLocation
// association [0..1] to I_ProductPlantMRP as _ProductPlantMRPArea on $projection.product = _ProductPlantMRPArea.Product
// and $projection.ProductionPlant = _ProductPlantMRPArea.Plant
// and $projection.mrparea = _ProductPlantMRPArea.MRPArea
// association [0..1] to I_Product as _BillOfOperationsMaterial on $projection.BillOfOperationsMaterial = _BillOfOperationsMaterial.Product
// //association [0..1] to I_SalesOrder as _SalesOrder on $projection.SalesOrder = _SalesOrder.SalesOrder
// association [0..1] to I_SalesOrderItem as _SalesOrderItem on $projection.salesorder = _SalesOrderItem.SalesOrder
// and $projection.salesorderitem = _SalesOrderItem.SalesOrderItem
// //association [0..1] to I_SalesDocumentBasic as _SalesDocument on $projection.SalesOrder = _SalesDocument.SalesDocument
// //association [0..1] to I_SalesDocumentItem as _SalesDocumentItem on $projection.SalesOrder = _SalesDocumentItem.SalesDocument
// and $projection.SalesOrderItem = _SalesDocumentItem.SalesDocumentItem
// association [0..1] to I_SalesDocumentBasic as _SalesOrder on $projection.SalesOrder = _SalesOrder.SalesDocument
// association [0..1] to I_WBSElementByInternalKey as _WBSElement on $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
// ----- KB ----- //
association [0..1] to I_ChangeMaster as _ChangeNumber on $projection.ChangeNumber = _ChangeNumber.ChangeNumber
association [0..1] to I_ChangeMstrObjTypeRevisionLvl as _MaterialRevisionLevel on $projection.MaterialRevisionLevel = _MaterialRevisionLevel.RevisionLevel
and _MaterialRevisionLevel.ChangeNumberObjectType = '41'
association [0..1] to I_GLAccount as _GLAccount on $projection.GLAccount = _GLAccount.GLAccount
and $projection.CompanyCode = _GLAccount.CompanyCode
association [0..1] to I_CostElement as _CostElement on $projection.ControllingArea = _CostElement.ControllingArea
and $projection.CostElement = _CostElement.CostElement
association [0..1] to I_CostingVariant as _ActualCostsCostingVariant on $projection.ActualCostsCostingVariant = _ActualCostsCostingVariant.CostingVariant
association [0..1] to I_CostingVariant as _PlannedCostsCostingVariant on $projection.PlannedCostsCostingVariant = _PlannedCostsCostingVariant.CostingVariant
association [0..1] to I_MRPController as _MRPController on $projection.ProductionPlant = _MRPController.Plant
and $projection.MRPController = _MRPController.MRPController
association [0..1] to I_ProductionSupervisor as _ProductionSupervisor on $projection.ProductionPlant = _ProductionSupervisor.Plant
and $projection.ProductionSupervisor = _ProductionSupervisor.ProductionSupervisor
association [0..1] to I_ProductionSchedulingProfile as _ProductionSchedulingProfile on $projection.ProductionPlant = _ProductionSchedulingProfile.Plant
and $projection.ProductionSchedulingProfile = _ProductionSchedulingProfile.ProductionSchedulingProfile
association [0..1] to I_ResponsiblePlannerGroup as _ResponsiblePlannerGroup on $projection.ProductionPlant = _ResponsiblePlannerGroup.Plant
and $projection.ResponsiblePlannerGroup = _ResponsiblePlannerGroup.ResponsiblePlannerGroup
association [0..1] to I_MfgBillOfOperations as _BillOfOperations on $projection.BillOfOperationsType = _BillOfOperations.BillOfOperationsType
and $projection.BillOfOperationsGroup = _BillOfOperations.BillOfOperationsGroup
and $projection.BillOfOperationsVariant = _BillOfOperations.BillOfOperationsVariant
association [0..1] to I_MfgBillOfOperationsChgSt as _BillOfOperationsChangeState on $projection.BillOfOperationsType = _BillOfOperationsChangeState.BillOfOperationsType
and $projection.BillOfOperationsGroup = _BillOfOperationsChangeState.BillOfOperationsGroup
and $projection.BillOfOperationsVariant = _BillOfOperationsChangeState.BillOfOperationsVariant
and $projection.BOOInternalVersionCounter = _BillOfOperationsChangeState.BOOInternalVersionCounter
// ----- KB ----- //
// association [0..1] to I_ProductionVersion as _ProductionVersion on $projection.product = _ProductionVersion.Material
// and $projection.ProductionPlant = _ProductionVersion.Plant
// and $projection.productionversion = _ProductionVersion.ProductionVersion
// association [0..1] to I_ProductionVersion as _ProductionVersion2 on $projection.Material = _ProductionVersion2.Material
// and $projection.ProductionPlant = _ProductionVersion2.Plant
// and $projection.productionversion = _ProductionVersion2.ProductionVersion
// association [1..1] to I_ManufacturingOrderItem as _MfgOrderMainItem on $projection.ManufacturingOrder = _MfgOrderMainItem.ManufacturingOrder
// and _MfgOrderMainItem.ManufacturingOrderItem = '0001'
// ----- KB ----- //
-- to child: Items
association [1..*] to I_ManufacturingOrderItem as _MfgOrderItem on $projection.ManufacturingOrder = _MfgOrderItem.ManufacturingOrder
-- to child: Sequences
association [1..*] to I_MfgOrderSequence as _MfgOrderSequence on $projection.ManufacturingOrder = _MfgOrderSequence.ManufacturingOrder
-- to child: Operations
association [1..*] to I_ManufacturingOrderOperation as _MfgOrderOperation on $projection.MfgOrderInternalID = _MfgOrderOperation.MfgOrderInternalID
-- to child: Material document items
association [0..*] to I_MfgOrderMaterialDocumentItem as _MfgOrderMaterialDocItem on $projection.ManufacturingOrder = _MfgOrderMaterialDocItem.ManufacturingOrder
-- to child: Document links
association [0..*] to I_MfgOrderDocInfoRecdObjLink as _MfgOrderDocInfoRecord on $projection.ManufacturingOrder = _MfgOrderDocInfoRecord.ManufacturingOrder
// association [0..1] to I_Material as _Material on $projection.Material = _Material.Material
// 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
{
// Key
//@ObjectModel.text.element: 'ManufacturingOrderText'
key cast(head.OrderID as manufacturingorder preserving type) as ManufacturingOrder,
// Category and Type
@ObjectModel.foreignKey.association: '_MfgOrderCategory'
head.OrderCategory as ManufacturingOrderCategory,
@ObjectModel.foreignKey.association: '_MfgOrderType'
cast(head.OrderType as pppi_manufacturingordertype preserving type ) as ManufacturingOrderType,
_MfgOrderType._Text[1: Language=$session.system_language].ManufacturingOrderTypeName as ManufacturingOrderTypeName,
// Text
@Semantics.text: true
cast(head.OrderDescription as manufacturingordertext preserving type) as ManufacturingOrderText,
// new logic: Since long text indicator does not contain X but the language code, this one is moved to
// language field and longtext indicator is determined separately
cast(case head.OrderHasLongText
when '' then ''
else 'X'
end as aufltext preserving type) as ManufacturingOrderHasLongText,
//Required to disable Long text Facet in Manage Process Orders app
cast(case head.OrderHasLongText
when '' then 'X'
else ''
end as processorderhasnolongtext preserving type) as ProcessOrderHasNoLongText,
@ObjectModel.foreignKey.association: '_LongTextLanguage'
cast(head.OrderHasLongText as pph_longtextlang) as LongTextLanguageCode,
// Attributes
cast(head.PriorityCode as orderimportancecode preserving type) as ManufacturingOrderImportance,
head.IsMarkedForDeletion,
// ----- KB ----- //
// item.IsCompletelyDelivered,
// ----- KB ----- //
head.MfgOrderHasMultipleItems,
head.MfgOrderIsPartOfCollvOrder,
head.MfgOrderHierarchyLevel,
head.OrderIsNotCostedAutomatically,
head.OrdIsNotSchedldAutomatically,
head.ProdnProcgIsFlexible,
head.OrderIsEventBasedPosting,
// Admin data
@Semantics.systemDate.createdAt: true
cast(head.CreationDate as ordercreationdate preserving type) as CreationDate,
@Semantics.systemTime.createdAt: true
cast(head.CreationTime as ordercreationtime preserving type) as CreationTime,
@Semantics.user.createdBy: true
head.CreatedByUser,
@Semantics.systemDate.lastChangedAt: true
head.LastChangeDate,
@Semantics.systemTime.lastChangedAt: true
head.LastChangeTime,
@Semantics.user.lastChangedBy: true
head.LastChangedByUser,
case LastChangeDate
when '00000000' then // not changed yet, use creation date time
case CreationTime when '240000' then
cast(cast(concat(CreationDate,cast('235959' as tims))as abap.numc(15)) as timestamp)
else
cast(cast(concat(CreationDate , CreationTime)as abap.numc(15)) as timestamp)
end
else
case LastChangeTime when '240000' then
cast(cast(concat(LastChangeDate,cast('235959' as tims))as abap.numc(15)) as timestamp)
else
cast(cast(concat(LastChangeDate,LastChangeTime)as abap.numc(15)) as timestamp)
end
end as LastChangeDateTime,
// Header Material data
// ----- KB ----- //
// @Consumption.valueHelpDefinition: [ { entity: { name: 'I_MaterialStdVH', element: 'Material' } } ]
// @ObjectModel.foreignKey.association: '_Material'
// item.Material as Material,
// cast(_Material.MaterialGroup as pppi_materialgroup preserving type) as MaterialGroup,
// cast(_Material.MaterialType as pppi_materialtype preserving type) as MaterialType,
//
// @Consumption.valueHelpDefinition: [ { entity: { name: 'I_ProductVH', element: 'Product' } } ]
// @ObjectModel.foreignKey.association: '_Product'
// cast(item.Material as productnumber preserving type) as Product,
// @ObjectModel.foreignKey.association: '_StorageLocation'
// item.StorageLocation,
// -- @ObjectModel.foreignKey.association: '_Batch'
// item.Batch,
// @Semantics.text: true
// item.GoodsRecipientName,
// @Semantics.text: true
// item.UnloadingPointName,
// item.InventoryUsabilityCode,
// item.MaterialGoodsReceiptDuration,
// item.QuantityDistributionKey,
// item.StockSegment,
// ----- KB ----- //
// Assignments
@ObjectModel.foreignKey.association: '_OrderInternalID'
cast(head.OrderInternalBillOfOperations as pph_aufpl preserving type) as MfgOrderInternalID,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_MfgOrderStdVH', element: 'ManufacturingOrder' } } ]
@ObjectModel.foreignKey.association: '_ReferenceOrder'
head.ReferenceOrder,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_MfgOrderStdVH', element: 'ManufacturingOrder' } } ]
@ObjectModel.foreignKey.association: '_LeadingOrder'
head.LeadingOrder,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_MfgOrderStdVH', element: 'ManufacturingOrder' } } ]
@ObjectModel.foreignKey.association: '_SuperiorOrder'
head.MfgOrderSuperiorMfgOrder as SuperiorOrder,
@ObjectModel.foreignKey.association: '_Currency'
head.Currency,
@ObjectModel.foreignKey.association: '_ProductionPlant'
cast(head.Plant as pwwrk preserving type) as ProductionPlant,
// ----- KB ----- //
// @ObjectModel.foreignKey.association: '_PlanningPlant'
// //item.MRPPlant as PlanningPlant,
// item.PlanningPlant,
// @ObjectModel.foreignKey.association: '_MRPArea'
// item.MRPArea,
// ----- KB ----- //
@ObjectModel.foreignKey.association: '_MRPController'
cast(head.MRPController as pppi_mrpcontroller preserving type) as MRPController,
@ObjectModel.foreignKey.association: '_ProductionSupervisor'
cast(head.ProductionSupervisor as pppi_productionsupervisor preserving type) as ProductionSupervisor,
@ObjectModel.foreignKey.association: '_ProductionSchedulingProfile'
cast(head.ProductionSchedulingProfile as pph_prodprf preserving type) as ProductionSchedulingProfile,
@ObjectModel.foreignKey.association: '_ResponsiblePlannerGroup'
head.ResponsiblePlannerGroup,
// ----- KB ----- //
// @Consumption.valueHelpDefinition: [ { entity: { name: 'I_ProductionVersionStdVH', element: 'ProductionVersion' } } ]
// @ObjectModel.foreignKey.association: '_ProductionVersion2'
// item.ProductionVersion,
// @Consumption.valueHelpDefinition: [ { entity: { name: 'I_SalesOrderStdVH', element: 'SalesOrder' } } ]
// @ObjectModel.foreignKey.association: '_SalesOrder'
// cast(item.SalesOrder as pppi_salesorder preserving type) as SalesOrder,
// @Consumption.valueHelpDefinition: [ { entity: { name: 'I_SalesOrderItemStdVH', element: 'SalesOrderItem' } } ]
// @ObjectModel.foreignKey.association: '_SalesOrderItem'
// cast(item.SalesOrderItem as pppi_salesorderitem preserving type) as SalesOrderItem,
// @Consumption.valueHelpDefinition: [ { entity: { name: 'I_WBSElmntByIntKeyStdVH', element: 'WBSElementInternalID' } } ]
// @ObjectModel.foreignKey.association: '_WBSElement'
// item.WBSElementInternalID,
// cast(_WBSElement.WBSElement as pph_wbselement preserving type ) as WBSElement,
// _WBSElement.WBSDescription,
// ----- KB ----- //
@ObjectModel.foreignKey.association: '_Reservation'
head.Reservation,
@ObjectModel.foreignKey.association: '_SettlementReservation'
cast(head.SettlementReservation as settlmntres preserving type) as SettlementReservation,
@ObjectModel.foreignKey.association: '_ConfirmationGroup'
head.MfgOrderConfirmation,
cast(head.MfgOrderConfirmationCount as pph_noofconf preserving type) as NumberOfMfgOrderConfirmations,
// ----- KB ----- //
// @ObjectModel.foreignKey.association: '_PlannedOrder'
// item.PlannedOrder,
// ----- KB ----- //
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_CapacityRequirementStdVH', element: 'CapacityRequirement' } } ]
@ObjectModel.foreignKey.association: '_CapacityRequirement'
head.CapacityRequirement,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_InspectionLotStdVH', element: 'InspectionLot' } } ]
@ObjectModel.foreignKey.association: '_InspectionLot'
head.InspectionLot,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_ChangeMasterStdVH', element: 'ChangeNumber' } } ]
@ObjectModel.foreignKey.association: '_ChangeNumber'
head.ChangeNumber,
-- @ObjectModel.foreignKey.association: '_MaterialRevisionLevel'
cast(head.MaterialRevisionLevel as qrevlv preserving type) as MaterialRevisionLevel,
@ObjectModel.foreignKey.association: '_BasicSchedulingType'
cast(head.BasicSchedulingType as basicschedtype preserving type) as BasicSchedulingType,
@ObjectModel.foreignKey.association: '_ForecastSchedulingType'
cast(head.ForecastSchedulingType as forecastschedtype preserving type) as ForecastSchedulingType,
cast(head.ObjectInternalID as pph_objnr preserving type) as ObjectInternalID,
// ----- KB ----- //
// cast(item.ProductConfiguration as product_configuration preserving type) as ProductConfiguration,
// item.EffectivityParameterVariant,
// ----- KB ----- //
head.ConditionApplication,
head.CapacityActiveVersion,
head.CapacityRqmtHasNotToBeCreated,
head.OrderSequenceNumber,
// Assignments BOO
// @Consumption.valueHelpDefinition: [ { entity: { name: 'I_MaterialStdVH', element: 'Material' } } ]
// @ObjectModel.foreignKey.association: '_BillOfOperationsMaterial'
head.Material as BillOfOperationsMaterial,
// @ObjectModel.foreignKey.association: '_BillOfOperationsType'
head.BillOfOperationsType,
// @ObjectModel.foreignKey.association: '_BillOfOperationsGroup'
// @VDM.lifecycle.status: #DEPRECATED // default data element change -> deprecated to avoid RTT2 error in ATC
// @VDM.lifecycle.successor: 'BillOfOperationsGroup'
head.BillOfOperations,
// @ObjectModel.foreignKey.association: '_BillOfOperationsGroup2'
head.BillOfOperationsGroup,
// @Consumption.valueHelpDefinition: [ { entity: { name: 'I_MfgBillOfOperationsStdVH', element: 'BillOfOperationsVariant' } } ]
// @ObjectModel.foreignKey.association: '_BillOfOperations'
head.BillOfOperationsVariant,
// @Consumption.valueHelpDefinition: [ { entity: { name: 'I_BOOChgStateStdVH', element: 'BOOInternalVersionCounter' } } ]
// @ObjectModel.foreignKey.association: '_BillOfOperationsChangeState'
head.BOOInternalVersionCounter,
// @ObjectModel.foreignKey.association: '_BillOfOperationsUsage'
head.BillOfOperationsUsage,
head.BillOfOperationsVersion,
head.BOOExplosionDate,
head.BOOValidityStartDate,
// Assignments BOM
head.BillOfMaterialCategory,
//head.BillOfMaterial,
cast(head.BillOfMaterial as pppi_billofmaterial preserving type ) as BillOfMaterial,
head.BillOfMaterialVariant,
head.BillOfMaterialVariantUsage,
head.BillOfMaterialVersion,
head.BOMExplosionDate,
head.BOMValidityStartDate,
// Assignments FI/CO
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_BusinessAreaStdVH', element: 'BusinessArea' } } ]
@ObjectModel.foreignKey.association: '_BusinessArea'
head.BusinessArea,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_CompanyCodeStdVH', element: 'CompanyCode' } } ]
@ObjectModel.foreignKey.association: '_CompanyCode'
head.CompanyCode,
@ObjectModel.foreignKey.association: '_ControllingArea'
head.ControllingArea,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_ProfitCenterStdVH', element: 'ProfitCenter' } } ]
head.ProfitCenter,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_CostCenterStdVH', element: 'CostCenter' } } ]
head.CostCenter,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_CostCenterStdVH', element: 'CostCenter' } } ]
head.ResponsibleCostCenter,
@ObjectModel.foreignKey.association: '_CostElement'
head.CostElement,
head.CostingSheet,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_GLAccountStdVH', element: 'GLAccount' } } ]
@ObjectModel.foreignKey.association: '_GLAccount'
head.GLAccount,
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_ProductCostCtrlgOrderStdVH', element: 'OrderID' } } ]
@ObjectModel.foreignKey.association: '_ProductCostCollector'
head.ProductCostCollector,
@ObjectModel.foreignKey.association: '_ActualCostsCostingVariant'
head.ActualCostsCostingVariant,
@ObjectModel.foreignKey.association: '_PlannedCostsCostingVariant'
head.PlannedCostsCostingVariant,
@ObjectModel.foreignKey.association: '_ControllingObjectClass'
cast(head.ControllingObjectClass as pph_scope preserving type) as ControllingObjectClass,
@ObjectModel.foreignKey.association: '_FunctionalArea'
head.FunctionalArea,
// Dates and Times
cast(head.PlannedStartDate as mfgorderplannedstartdate preserving type) as MfgOrderPlannedStartDate,
cast(head.PlannedStartTime as mfgorderplannedstarttime preserving type) as MfgOrderPlannedStartTime,
cast(head.PlannedEndDate as mfgorderplannedenddate preserving type) as MfgOrderPlannedEndDate,
cast(head.PlannedEndTime as mfgorderplannedendtime preserving type) as MfgOrderPlannedEndTime,
cast(head.PlannedReleaseDate as mfgorderplannedreleasedate preserving type) as MfgOrderPlannedReleaseDate,
cast(head.ScheduledBasicStartDate as mfgorderscheduledstartdate preserving type) as MfgOrderScheduledStartDate,
cast(head.ScheduledBasicStartTime as mfgorderscheduledstarttime preserving type) as MfgOrderScheduledStartTime,
cast(head.ScheduledBasicEndDate as mfgorderscheduledenddate preserving type) as MfgOrderScheduledEndDate,
cast(head.ScheduledBasicEndTime as mfgorderscheduledendtime preserving type) as MfgOrderScheduledEndTime,
cast(head.ScheduledReleaseDate as mfgorderscheduledreleasedate preserving type) as MfgOrderScheduledReleaseDate,
cast(head.ActualStartDate as mfgorderactualstartdate preserving type) as MfgOrderActualStartDate,
cast(head.ActualStartTime as mfgorderactualstarttime preserving type) as MfgOrderActualStartTime,
cast(head.ActualEndDate as mfgorderactualenddate preserving type) as MfgOrderActualEndDate,
cast(head.ActualReleasedDate as mfgorderactualreleasedate preserving type) as MfgOrderActualReleaseDate,
cast(head.ConfirmedEndDate as mfgorderconfirmedenddate preserving type) as MfgOrderConfirmedEndDate,
cast(head.ConfirmedEndTime as mfgorderconfirmedendtime preserving type) as MfgOrderConfirmedEndTime,
head.TotalCommitmentDate as MfgOrderTotalCommitmentDate,
head.TechnicalCompletionDate as MfgOrderActualCompletionDate,
// ----- KB ----- //
// //item.ActualDeliveryDate as MfgOrderItemActualDeliveryDate,
// item.MfgOrderItemActualDeliveryDate,
// ----- KB ----- //
// Quantities and UoM
@Semantics.unitOfMeasure: true
cast(head.BaseUnit as productionunit preserving type) as ProductionUnit,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
@DefaultAggregation: #SUM
cast(head.OrderPlannedTotalQty as mfgorderplannedtotalqty preserving type) as MfgOrderPlannedTotalQty,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
@DefaultAggregation: #SUM
cast(head.OrderPlannedScrapQty as mfgorderplannedscrapqty preserving type) as MfgOrderPlannedScrapQty,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
@DefaultAggregation: #SUM
cast(head.OrderConfirmedYieldQty as co_igmng preserving type) as MfgOrderConfirmedYieldQty,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
@DefaultAggregation: #SUM
cast(head.OrderConfirmedScrapQty as co_iasmg preserving type) as MfgOrderConfirmedScrapQty,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
@DefaultAggregation: #SUM
head.MfgOrderConfirmedReworkQty,
// ----- KB ----- //
// @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
// @DefaultAggregation: #SUM
// cast(item.MfgOrderItemActualDeviationQty as co_mimez preserving type) as ExpectedDeviationQuantity,
// @Semantics.unitOfMeasure: true
// item.ProductionUnit as MfgOrderItemProductionUnit,
// @Semantics.quantity.unitOfMeasure: 'MfgOrderItemProductionUnit'
// @DefaultAggregation: #SUM
// item.MfgOrderItemGoodsReceiptQty as ActualDeliveredQuantity,
// ----- KB ----- //
@Semantics.unitOfMeasure: true
head.MaterialBaseUnit as BaseUnit,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
@DefaultAggregation: #SUM
head.PlannedTotalQtyInBaseUnit as PlndQtyInBaseUnit,
// Fashion Manufacturing Fields
head.MasterProductionOrder as MasterProductionOrder,
// ----- KB ----- //
// item.UnderdelivTolrtdLmtRatioInPct,
// item.OverdelivTolrtdLmtRatioInPct,
// ----- KB ----- //
_SalesOrder._SoldToParty.Customer as Customer,
_SalesOrder._SoldToParty.CustomerName as CustomerName,
_SalesOrder.SoldToParty as SoldToParty,
//_ProcOrdBatch.Batch as GoodsMovementBatch,
// Associations
_MfgOrderCategory,
_MfgOrderType,
_MfgOrderItem,
// ----- KB ----- //
// _MfgOrderMainItem,
// ----- KB ----- //
_MfgOrderSequence,
_MfgOrderOperation,
_MfgOrderMaterialDocItem,
_MfgOrderDocInfoRecord,
_OrderTypeDetails,
_CreatedByUser,
_LastChangedByUser,
_LongTextLanguage,
_ProductionUnit,
_Currency,
_SuperiorOrder,
_ReferenceOrder,
_LeadingOrder,
_OrderInternalID,
// ----- KB ----- //
// _BillOfOperationsMaterial,
// ----- KB ----- //
_BillOfOperationsType,
_BillOfOperationsGroup,
_BillOfOperationsGroup2,
_BillOfOperations,
_BillOfOperationsChangeState,
_BillOfOperationsUsage,
_ConfirmationGroup,
_Reservation,
head._SettlementReservation,
_ProductionPlant,
// ----- KB ----- //
// _PlanningPlant,
// _Material,
// _Product,
// _ProductPlant,
// _ProductStorageLocation,
// _ProductPlantMRPArea,
// _ProductUnitsOfMeasure,
// _StorageLocation,
// _Batch,
// _MRPArea,
// ----- KB ----- //
_MRPController,
_ProductionSupervisor,
_ProductionSchedulingProfile,
_ResponsiblePlannerGroup,
// ----- KB ----- //
// _ProductionVersion,
// _ProductionVersion2,
// ----- KB ----- //
_CapacityRequirement,
_ChangeNumber,
_MaterialRevisionLevel,
_InspectionLot,
// ----- KB ----- //
// _SalesOrder,
// _SalesOrderItem,
// //_SalesDocument,
// //_SalesDocumentItem,
// _WBSElement,
// _PlannedOrder,
// ----- KB ----- //
_BasicSchedulingType,
_ForecastSchedulingType,
head._BusinessArea,
_ProfitCenter,
_CostCenter,
_ResponsibleCostCenter,
_CompanyCode,
_ControllingArea,
_ControllingObjectClass,
_CostElement,
_ActualCostsCostingVariant,
_PlannedCostsCostingVariant,
_FunctionalArea,
_GLAccount,
_ProductCostCollector,
_LongText
// _MaterialType,
// _MaterialGroup
}
where
(
head.OrderCategory = '40'
); //process orders only