I_ManufacturingOrder

DDL: I_MANUFACTURINGORDER SQL: IMFGORDER Type: view BASIC

Manufacturing Order

I_ManufacturingOrder is a Basic CDS View (Dimension) that provides data about "Manufacturing Order" in SAP S/4HANA. It reads from 2 data sources (I_LogisticsOrder, I_OrderItem) and exposes 90 fields with key field ManufacturingOrder. It has 58 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_LogisticsOrder head from
I_OrderItem item inner

Associations (58)

CardinalityTargetAliasCondition
[1..1] I_MfgOrderCategory _MfgOrderCategory $projection.ManufacturingOrderCategory = _MfgOrderCategory.ManufacturingOrderCategory
[1..1] I_MfgOrderType _MfgOrderType $projection.ManufacturingOrderType = _MfgOrderType.ManufacturingOrderType
[0..1] I_ManufacturingOrder _ReferenceOrder $projection.ReferenceOrder = _ReferenceOrder.ManufacturingOrder
[0..1] I_ManufacturingOrder _LeadingOrder $projection.LeadingOrder = _LeadingOrder.ManufacturingOrder
[0..1] I_ManufacturingOrder _SuperiorOrder $projection.SuperiorOrder = _SuperiorOrder.ManufacturingOrder
[0..1] I_ManufacturingOrderImportance _MfgOrderImportance $projection.ManufacturingOrderCategory = _MfgOrderImportance.ManufacturingOrderCategory and $projection.ManufacturingOrderImportance = _MfgOrderImportance.ManufacturingOrderImportance
[1..1] I_OrderInternalID _OrderInternalID $projection.MfgOrderInternalID = _OrderInternalID.OrderInternalID
[0..1] I_Language _LongTextLanguage $projection.LongTextLanguageCode = _LongTextLanguage.Language
[1..1] I_UnitOfMeasure _ProductionUnit $projection.ProductionUnit = _ProductionUnit.UnitOfMeasure
[1..1] I_User _CreatedByUser $projection.CreatedByUser = _CreatedByUser.UserID
[0..1] I_User _LastChangedByUser $projection.LastChangedByUser = _LastChangedByUser.UserID
[1..1] I_Plant _ProductionPlant $projection.ProductionPlant = _ProductionPlant.Plant
[0..1] I_Plant _PlanningPlant $projection.PlanningPlant = _PlanningPlant.Plant
[0..1] I_MRPArea _MRPArea $projection.MRPArea = _MRPArea.MRPArea
[0..1] I_StorageLocation _StorageLocation $projection.ProductionPlant = _StorageLocation.Plant and $projection.StorageLocation = _StorageLocation.StorageLocation
[0..*] I_Batch _Batch $projection.Material = _Batch.Material and $projection.Batch = _Batch.Batch
[0..1] I_Batch _Batch_2 $projection.ProductionPlant = _Batch_2.Plant and $projection.Material = _Batch_2.Material and $projection.Batch = _Batch_2.Batch
[0..1] I_Product _Product $projection.Product = _Product.Product
[1..*] I_ProductUnitsOfMeasure _ProductUnitsOfMeasure $projection.Product = _ProductUnitsOfMeasure.Product
[0..1] I_ProductPlant _ProductPlant $projection.ProductionPlant = _ProductPlant.Plant and $projection.Product = _ProductPlant.Product
[0..1] I_ProductStorageLocation _ProductStorageLocation $projection.Material = _ProductStorageLocation.Product and $projection.ProductionPlant = _ProductStorageLocation.Plant and $projection.StorageLocation = _ProductStorageLocation.StorageLocation
[0..1] I_ProductPlantBasic _ProductPlant2 $projection.ProductionPlant = _ProductPlant2.Plant and $projection.Product = _ProductPlant2.Product
[0..1] I_ProductStorageLocationBasic _ProductStorageLocation2 $projection.Product = _ProductStorageLocation2.Product and $projection.ProductionPlant = _ProductStorageLocation2.Plant and $projection.StorageLocation = _ProductStorageLocation2.StorageLocation
[0..1] I_ProductPlantMRP _ProductPlantMRPArea $projection.Product = _ProductPlantMRPArea.Product and $projection.ProductionPlant = _ProductPlantMRPArea.Plant and $projection.MRPArea = _ProductPlantMRPArea.MRPArea
[0..1] I_Product _BillOfOperationsMaterial $projection.BillOfOperationsMaterial = _BillOfOperationsMaterial.Product
[0..1] I_SalesOrder _SalesOrder $projection.SalesOrder = _SalesOrder.SalesOrder
[0..1] I_SalesOrderItem _SalesOrderItem $projection.SalesOrder = _SalesOrderItem.SalesOrder and $projection.SalesOrderItem = _SalesOrderItem.SalesOrderItem
[0..1] I_SalesDocument _SalesDocument $projection.SalesOrder = _SalesDocument.SalesDocument
[0..1] I_SalesDocumentItem _SalesDocumentItem $projection.SalesOrder = _SalesDocumentItem.SalesDocument and $projection.SalesOrderItem = _SalesDocumentItem.SalesDocumentItem
[0..1] I_WBSElementByInternalKey _WBSElement $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
[0..1] I_WBSElementBasicData _WBSElementBasicData $projection.WBSElementInternalID = _WBSElementBasicData.WBSElementInternalID
[0..1] I_ChangeMaster _ChangeNumber $projection.ChangeNumber = _ChangeNumber.ChangeNumber
[0..1] I_ChangeMstrObjTypeRevisionLvl _MaterialRevisionLevel $projection.MaterialRevisionLevel = _MaterialRevisionLevel.RevisionLevel and _MaterialRevisionLevel.ChangeNumberObjectType = '41'
[0..1] I_ChangeMstrObjTypeRevisionLvl _MaterialRevisionLevel2 $projection.MaterialRevisionLevel_2 = _MaterialRevisionLevel2.RevisionLevel and _MaterialRevisionLevel2.ChangeNumberObjectType = '41'
[0..1] I_GLAccount _GLAccount $projection.GLAccount = _GLAccount.GLAccount and $projection.CompanyCode = _GLAccount.CompanyCode
[0..1] I_CostElement _CostElement $projection.ControllingArea = _CostElement.ControllingArea and $projection.CostElement = _CostElement.CostElement
[0..1] I_CostingVariant _ActualCostsCostingVariant $projection.ActualCostsCostingVariant = _ActualCostsCostingVariant.CostingVariant
[0..1] I_CostingVariant _PlannedCostsCostingVariant $projection.PlannedCostsCostingVariant = _PlannedCostsCostingVariant.CostingVariant
[0..1] I_MRPController _MRPController $projection.ProductionPlant = _MRPController.Plant and $projection.MRPController = _MRPController.MRPController
[0..1] I_ProductionSupervisor _ProductionSupervisor $projection.ProductionPlant = _ProductionSupervisor.Plant and $projection.ProductionSupervisor = _ProductionSupervisor.ProductionSupervisor
[0..1] I_ProductionSchedulingProfile _ProductionSchedulingProfile $projection.ProductionPlant = _ProductionSchedulingProfile.Plant and $projection.ProductionSchedulingProfile = _ProductionSchedulingProfile.ProductionSchedulingProfile
[0..1] I_ResponsiblePlannerGroup _ResponsiblePlannerGroup $projection.ProductionPlant = _ResponsiblePlannerGroup.Plant and $projection.ResponsiblePlannerGroup = _ResponsiblePlannerGroup.ResponsiblePlannerGroup
[0..1] I_MfgBillOfOperations _BillOfOperations $projection.BillOfOperationsType = _BillOfOperations.BillOfOperationsType and $projection.BillOfOperations = _BillOfOperations.BillOfOperationsGroup and $projection.BillOfOperationsVariant = _BillOfOperations.BillOfOperationsVariant
[0..1] I_MfgBillOfOperationsChgSt _BillOfOperationsChangeState $projection.BillOfOperationsType = _BillOfOperationsChangeState.BillOfOperationsType and $projection.BillOfOperations = _BillOfOperationsChangeState.BillOfOperationsGroup and $projection.BillOfOperationsVariant = _BillOfOperationsChangeState.BillOfOperationsVariant and $projection.BOOInternalVersionCounter = _BillOfOperationsChangeState.BOOInternalVersionCounter
[0..1] I_MfgBillOfOperations _BillOfOperations2 $projection.BillOfOperationsType = _BillOfOperations2.BillOfOperationsType and $projection.BillOfOperationsGroup = _BillOfOperations2.BillOfOperationsGroup and $projection.BillOfOperationsVariant = _BillOfOperations2.BillOfOperationsVariant
[0..1] I_MfgBillOfOperationsChgSt _BillOfOperationsChangeState2 $projection.BillOfOperationsType = _BillOfOperationsChangeState2.BillOfOperationsType and $projection.BillOfOperationsGroup = _BillOfOperationsChangeState2.BillOfOperationsGroup and $projection.BillOfOperationsVariant = _BillOfOperationsChangeState2.BillOfOperationsVariant and $projection.BOOInternalVersionCounter = _BillOfOperationsChangeState2.BOOInternalVersionCounter
[0..1] I_ProductionVersion _ProductionVersion $projection.Product = _ProductionVersion.Material and $projection.ProductionPlant = _ProductionVersion.Plant and $projection.ProductionVersion = _ProductionVersion.ProductionVersion
[0..1] I_ProductionVersion _ProductionVersion2 $projection.Material = _ProductionVersion2.Material and $projection.ProductionPlant = _ProductionVersion2.Plant and $projection.ProductionVersion = _ProductionVersion2.ProductionVersion -- to child: Items
[1..*] I_ManufacturingOrderItem _MfgOrderItem $projection.ManufacturingOrder = _MfgOrderItem.ManufacturingOrder
[1..1] I_ManufacturingOrderItem _MfgOrderMainItem $projection.ManufacturingOrder = _MfgOrderMainItem.ManufacturingOrder and _MfgOrderMainItem.ManufacturingOrderItem = '0001' -- to child: Sequences
[1..*] I_MfgOrderSequence _MfgOrderSequence $projection.ManufacturingOrder = _MfgOrderSequence.ManufacturingOrder -- to child: Operations
[1..*] I_ManufacturingOrderOperation _MfgOrderOperation $projection.MfgOrderInternalID = _MfgOrderOperation.MfgOrderInternalID -- to child: Material document items
[0..*] I_MfgOrderMaterialDocumentItem _MfgOrderMaterialDocItem $projection.ManufacturingOrder = _MfgOrderMaterialDocItem.ManufacturingOrder -- to child: Documented goods movements
[0..*] I_MfgOrderDocdGoodsMovement _MfgOrderDocdGoodsMovement $projection.ManufacturingOrder = _MfgOrderDocdGoodsMovement.ManufacturingOrder -- to child: Document links
[0..*] I_MfgOrderDocumentLink _MfgOrderDocumentLink $projection.ManufacturingOrder = _MfgOrderDocumentLink.ManufacturingOrder
[0..*] I_MfgOrderDocInfoRecdObjLink _MfgOrderDocInfoRecord $projection.ManufacturingOrder = _MfgOrderDocInfoRecord.ManufacturingOrder -- to child: Long text
[0..1] I_ManufacturingOrderLongText _MfgOrderLongText $projection.ManufacturingOrder = _MfgOrderLongText.ManufacturingOrder and $projection.LongTextLanguageCode = _MfgOrderLongText.LongTextLanguage -- to extensionLongtextlanguageCode = _LongTextLanguage.Language
[1..1] E_LogisticsOrder _Extension $projection.ManufacturingOrder = _Extension.OrderID

Annotations (22)

NameValueLevelField
AbapCatalog.sqlViewName IMFGORDER view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking #NOT_REQUIRED view
Analytics.dataCategory #DIMENSION view
Analytics.dataExtraction.enabled true view
Analytics.internalName #LOCAL view
ClientHandling.algorithm #SESSION_VARIABLE view
ClientHandling.type #CLIENT_DEPENDENT view
Consumption.ranked true view
Metadata.allowExtensions true view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.compositionRoot true view
ObjectModel.modelingPattern #ANALYTICAL_DIMENSION view
ObjectModel.representativeKey ManufacturingOrder view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
VDM.viewType #BASIC view
Search.searchable true view
EndUserText.label Manufacturing Order view

Fields (90)

KeyFieldSource TableSource FieldDescription
KEY ManufacturingOrder
OrderItemasManufacturingOrderItem
ManufacturingOrderCategory I_LogisticsOrder OrderCategory
ManufacturingOrderType I_LogisticsOrder OrderType
ManufacturingOrderText
LongTextLanguageCode I_LogisticsOrder LongTextLanguage
ManufacturingOrderImportance
IsMarkedForDeletion I_LogisticsOrder IsMarkedForDeletion
IsCompletelyDelivered I_OrderItem IsCompletelyDelivered
MfgOrderHasMultipleItems I_LogisticsOrder MfgOrderHasMultipleItems
MfgOrderIsPartOfCollvOrder I_LogisticsOrder MfgOrderIsPartOfCollvOrder
MfgOrderHierarchyLevel I_LogisticsOrder MfgOrderHierarchyLevel
OrderIsNotCostedAutomatically I_LogisticsOrder OrderIsNotCostedAutomatically
OrdIsNotSchedldAutomatically I_LogisticsOrder OrdIsNotSchedldAutomatically
ProdnProcgIsFlexible I_LogisticsOrder ProdnProcgIsFlexible
CreationDate
CreationTime
CreatedByUser I_LogisticsOrder CreatedByUser
LastChangeDate I_LogisticsOrder LastChangeDate
LastChangeTime I_LogisticsOrder LastChangeTime
LastChangedByUser I_LogisticsOrder LastChangedByUser
Material I_OrderItem Material
Product
StorageLocation I_OrderItem StorageLocation
Batch I_OrderItem Batch
GoodsRecipientName I_OrderItem GoodsRecipientName
UnloadingPointName I_OrderItem UnloadingPointName
InventoryUsabilityCode I_OrderItem InventoryUsabilityCode
MaterialGoodsReceiptDuration I_OrderItem MaterialGoodsReceiptDuration
QuantityDistributionKey I_OrderItem QuantityDistributionKey
StockSegment I_OrderItem StockSegment
ExtdQualityCheckIsRequired I_LogisticsOrder ExtdQualityCheckIsRequired
MfgOrderInternalID
ReferenceOrder I_LogisticsOrder ReferenceOrder
LeadingOrder I_LogisticsOrder LeadingOrder
SuperiorOrder I_LogisticsOrder MfgOrderSuperiorMfgOrder
Currency I_LogisticsOrder Currency
ProductionPlant
PlanningPlant I_OrderItem MRPPlant
MRPArea I_OrderItem MRPArea
MRPController
ProductionSupervisor
ProductionSchedulingProfile
ResponsiblePlannerGroup I_LogisticsOrder ResponsiblePlannerGroup
ProductionVersion I_OrderItem ProductionVersion
SalesOrder I_OrderItem SalesOrder
SalesOrderItem I_OrderItem SalesOrderItem
WBSElementInternalID I_OrderItem WBSElementInternalID
WBSElementInternalID_2 I_OrderItem WBSElementInternalID_2
Reservation I_LogisticsOrder Reservation
SettlementReservation
MfgOrderConfirmation I_LogisticsOrder MfgOrderConfirmation
NumberOfMfgOrderConfirmations
PlannedOrder I_OrderItem PlannedOrder
CapacityRequirement I_LogisticsOrder CapacityRequirement
InspectionLot I_LogisticsOrder InspectionLot
ChangeNumber I_LogisticsOrder ChangeNumber
MaterialRevisionLevel
MaterialRevisionLevel_2 I_LogisticsOrder MaterialRevisionLevel_2
BasicSchedulingType
ObjectInternalID
ProductConfiguration
EffectivityParameterVariant I_OrderItem EffectivityParameterVariant
ConditionApplication I_LogisticsOrder ConditionApplication
CapacityActiveVersion I_LogisticsOrder CapacityActiveVersion
CapacityRqmtHasNotToBeCreated I_LogisticsOrder CapacityRqmtHasNotToBeCreated
OrderSequenceNumber I_LogisticsOrder OrderSequenceNumber
MfgOrderSplitStatus I_LogisticsOrder MfgOrderSplitStatus
BillOfOperationsMaterial I_LogisticsOrder Material
BillOfOperationsType I_LogisticsOrder BillOfOperationsType
BillOfOperations I_LogisticsOrder BillOfOperations
BillOfOperationsGroup I_LogisticsOrder BillOfOperationsGroup
BillOfOperationsVariant I_LogisticsOrder BillOfOperationsVariant
BOOInternalVersionCounter I_LogisticsOrder BOOInternalVersionCounter
BillOfOperationsApplication I_LogisticsOrder BillOfOperationsApplication
BillOfOperationsUsage I_LogisticsOrder BillOfOperationsUsage
BillOfOperationsVersion I_LogisticsOrder BillOfOperationsVersion
BOOExplosionDate I_LogisticsOrder BOOExplosionDate
BOOValidityStartDate I_LogisticsOrder BOOValidityStartDate
BillOfMaterialCategory I_LogisticsOrder BillOfMaterialCategory
BillOfMaterial I_LogisticsOrder BillOfMaterial
BillOfMaterialInternalID I_LogisticsOrder BillOfMaterialInternalID
BillOfMaterialVariant I_LogisticsOrder BillOfMaterialVariant
BillOfMaterialVariantUsage I_LogisticsOrder BillOfMaterialVariantUsage
BillOfMaterialVersion I_LogisticsOrder BillOfMaterialVersion
BOMExplosionDate I_LogisticsOrder BOMExplosionDate
BOMValidityStartDate I_LogisticsOrder BOMValidityStartDate
BusinessArea I_LogisticsOrder BusinessArea
CompanyCode I_LogisticsOrder CompanyCode
ControllingArea I_LogisticsOrder ControllingArea
@AbapCatalog.sqlViewName: 'IMFGORDER'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AccessControl.privilegedAssociations: ['_MRPController', '_ProductionSupervisor', '_CreatedByUser', '_LastChangedByUser', '_LongText'] 
@Analytics.dataCategory: #DIMENSION
@Analytics.dataExtraction: { enabled: true,
                             delta.changeDataCapture:
                                    { mapping:
                                      [ { role: #MAIN,
                                          table: 'aufk',
                                          tableElement: ['aufnr'],
                                          viewElement:  ['ManufacturingOrder']
                                        },
                                        { role: #LEFT_OUTER_TO_ONE_JOIN,
                                         table: 'afko',
                                          tableElement: ['aufnr'],
                                          viewElement:  ['ManufacturingOrder']
                                        },
                                        { role: #LEFT_OUTER_TO_ONE_JOIN,
                                          table: 'afpo',
                                          tableElement: ['aufnr',              'posnr'],
                                          viewElement:  ['ManufacturingOrder', 'ManufacturingOrderItem']
                                        } ] } }
@Analytics.internalName: #LOCAL
@ClientHandling.algorithm: #SESSION_VARIABLE
@ClientHandling.type: #CLIENT_DEPENDENT
@Consumption.ranked: true
@Metadata.allowExtensions: true
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.compositionRoot: true
@ObjectModel.modelingPattern: #ANALYTICAL_DIMENSION
@ObjectModel.supportedCapabilities: [#ANALYTICAL_DIMENSION, #CDS_MODELING_ASSOCIATION_TARGET, #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE, #SEARCHABLE_ENTITY, #EXTRACTION_DATA_SOURCE]
@ObjectModel.representativeKey: 'ManufacturingOrder'
@ObjectModel.semanticKey: ['ManufacturingOrder']
@ObjectModel.usageType: {serviceQuality: #B, sizeCategory: #L, dataClass: #TRANSACTIONAL}
@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API
@VDM.viewType: #BASIC
@Search.searchable: true
@EndUserText.label: 'Manufacturing Order'

/*+[hideWarning] { "IDS" : [ "CALCULATED_FIELD_CHECK" ]  } */
define view I_ManufacturingOrder
  as select from I_LogisticsOrder as head
    inner join   I_OrderItem      as item on  item.OrderID   = head.OrderID
                                          and item.OrderItem = '0001'

  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 [0..1] to I_ManufacturingOrderImportance as _MfgOrderImportance          on  $projection.ManufacturingOrderCategory   = _MfgOrderImportance.ManufacturingOrderCategory
                                                                                       and $projection.ManufacturingOrderImportance = _MfgOrderImportance.ManufacturingOrderImportance 
  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
  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_Batch                        as _Batch_2                     on  $projection.ProductionPlant = _Batch_2.Plant
                                                                                       and $projection.Material        = _Batch_2.Material
                                                                                       and $projection.Batch           = _Batch_2.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_ProductPlantBasic            as _ProductPlant2               on  $projection.ProductionPlant = _ProductPlant2.Plant
                                                                                       and $projection.Product         = _ProductPlant2.Product
  association [0..1] to I_ProductStorageLocationBasic  as _ProductStorageLocation2     on  $projection.Product         = _ProductStorageLocation2.Product
                                                                                       and $projection.ProductionPlant = _ProductStorageLocation2.Plant
                                                                                       and $projection.StorageLocation = _ProductStorageLocation2.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_SalesDocument                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_WBSElementByInternalKey      as _WBSElement                  on  $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
  association [0..1] to I_WBSElementBasicData          as _WBSElementBasicData         on  $projection.WBSElementInternalID = _WBSElementBasicData.WBSElementInternalID
  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_ChangeMstrObjTypeRevisionLvl as _MaterialRevisionLevel2      on  $projection.MaterialRevisionLevel_2 = _MaterialRevisionLevel2.RevisionLevel
                                                                                       and _MaterialRevisionLevel2.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.BillOfOperations        = _BillOfOperations.BillOfOperationsGroup
                                                                                       and $projection.BillOfOperationsVariant = _BillOfOperations.BillOfOperationsVariant
  association [0..1] to I_MfgBillOfOperationsChgSt     as _BillOfOperationsChangeState on  $projection.BillOfOperationsType      = _BillOfOperationsChangeState.BillOfOperationsType
                                                                                       and $projection.BillOfOperations          = _BillOfOperationsChangeState.BillOfOperationsGroup
                                                                                       and $projection.BillOfOperationsVariant   = _BillOfOperationsChangeState.BillOfOperationsVariant
                                                                                       and $projection.BOOInternalVersionCounter = _BillOfOperationsChangeState.BOOInternalVersionCounter
  association [0..1] to I_MfgBillOfOperations          as _BillOfOperations2           on  $projection.BillOfOperationsType    = _BillOfOperations2.BillOfOperationsType
                                                                                       and $projection.BillOfOperationsGroup   = _BillOfOperations2.BillOfOperationsGroup
                                                                                       and $projection.BillOfOperationsVariant = _BillOfOperations2.BillOfOperationsVariant
  association [0..1] to I_MfgBillOfOperationsChgSt     as _BillOfOperationsChangeState2 on $projection.BillOfOperationsType      = _BillOfOperationsChangeState2.BillOfOperationsType
                                                                                       and $projection.BillOfOperationsGroup     = _BillOfOperationsChangeState2.BillOfOperationsGroup
                                                                                       and $projection.BillOfOperationsVariant   = _BillOfOperationsChangeState2.BillOfOperationsVariant
                                                                                       and $projection.BOOInternalVersionCounter = _BillOfOperationsChangeState2.BOOInternalVersionCounter
  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

  -- to child: Items
  association [1..*] to I_ManufacturingOrderItem       as _MfgOrderItem                on  $projection.ManufacturingOrder = _MfgOrderItem.ManufacturingOrder
  association [1..1] to I_ManufacturingOrderItem       as _MfgOrderMainItem            on  $projection.ManufacturingOrder = _MfgOrderMainItem.ManufacturingOrder
                                                                                       and _MfgOrderMainItem.ManufacturingOrderItem = '0001'
  -- 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: Documented goods movements
  association [0..*] to I_MfgOrderDocdGoodsMovement    as _MfgOrderDocdGoodsMovement   on  $projection.ManufacturingOrder = _MfgOrderDocdGoodsMovement.ManufacturingOrder  
  -- to child: Document links
  association [0..*] to I_MfgOrderDocumentLink         as _MfgOrderDocumentLink        on  $projection.ManufacturingOrder = _MfgOrderDocumentLink.ManufacturingOrder
  association [0..*] to I_MfgOrderDocInfoRecdObjLink   as _MfgOrderDocInfoRecord       on  $projection.ManufacturingOrder = _MfgOrderDocInfoRecord.ManufacturingOrder
  -- to child: Long text
  association [0..1] to I_ManufacturingOrderLongText   as _MfgOrderLongText            on  $projection.ManufacturingOrder   = _MfgOrderLongText.ManufacturingOrder
                                                                                       and $projection.LongTextLanguageCode = _MfgOrderLongText.LongTextLanguage
  -- to extensionLongtextlanguageCode = _LongTextLanguage.Language
  association [1..1] to E_LogisticsOrder               as _Extension                   on  $projection.ManufacturingOrder = _Extension.OrderID
                               
{
      // Key

      @ObjectModel.text.element: ['ManufacturingOrderText']
      @Search: {defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.9}
  key cast(head.OrderID as manufacturingorder preserving type)       as ManufacturingOrder,

      -- for CDC purposes only
      @Consumption.hidden: true
      item.OrderItem     as ManufacturingOrderItem,

      // Category and Type

      @ObjectModel.foreignKey.association: '_MfgOrderCategory'
      head.OrderCategory as ManufacturingOrderCategory,
      @ObjectModel.foreignKey.association: '_MfgOrderType'
      head.OrderType     as ManufacturingOrderType,

      // Text

      @Semantics.text: true
      cast(head.OrderDescription as manufacturingordertext preserving type) as ManufacturingOrderText,
      cast(case 
            when head.OrderHasLongText <> '' then 'X'
            else head.OrderHasLongText
      end as aufltext preserving type)                                as ManufacturingOrderHasLongText,
      @ObjectModel.foreignKey.association: '_LongTextLanguage'
      head.LongTextLanguage                                           as LongTextLanguageCode,

      // Attributes

      @ObjectModel.foreignKey.association: '_MfgOrderImportance'
      cast(head.PriorityCode as orderimportancecode preserving type)  as ManufacturingOrderImportance,
      head.IsMarkedForDeletion,
      item.IsCompletelyDelivered,
      head.MfgOrderHasMultipleItems,
      head.MfgOrderIsPartOfCollvOrder,
      head.MfgOrderHierarchyLevel,
      head.OrderIsNotCostedAutomatically,
      head.OrdIsNotSchedldAutomatically,
      head.ProdnProcgIsFlexible,

      // 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,

      // Header Material data

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_MaterialStdVH', element: 'Material' } } ]
      @ObjectModel.foreignKey.association: '_Material'
      item.Material                                                         as Material,
      @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,
      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_BatchStdVH', element: 'Batch' } } ]
      item.Batch,
      @Semantics.text: true
      item.GoodsRecipientName,
      @Semantics.text: true
      item.UnloadingPointName,
      @ObjectModel.foreignKey.association: '_InventoryUsabilityCode'
      item.InventoryUsabilityCode,
      item.MaterialGoodsReceiptDuration,
      item.QuantityDistributionKey,
      item.StockSegment,
      item.NumberOfSerialNumbers,

      //Extended Quality Check

      head.ExtdQualityCheckIsRequired                                       as ExtdQualityCheckIsRequired,

      // 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,
      @ObjectModel.foreignKey.association: '_PlanningPlant'
      item.MRPPlant                                                         as PlanningPlant,
      @ObjectModel.foreignKey.association: '_MRPArea'
      item.MRPArea,
      @ObjectModel.foreignKey.association: '_MRPController'
      cast(head.MRPController               as pph_dispo   preserving type) as MRPController,
      @ObjectModel.foreignKey.association: '_ProductionSupervisor'
      cast(head.ProductionSupervisor        as pph_fevor   preserving type) as ProductionSupervisor,
      @ObjectModel.foreignKey.association: '_ProductionSchedulingProfile'
      cast(head.ProductionSchedulingProfile as pph_prodprf preserving type) as ProductionSchedulingProfile,
      @ObjectModel.foreignKey.association: '_ResponsiblePlannerGroup'
      head.ResponsiblePlannerGroup,
      @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'
      item.SalesOrder,
      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_SalesOrderItemStdVH', element: 'SalesOrderItem' } } ]
      @ObjectModel.foreignKey.association: '_SalesOrderItem'
      item.SalesOrderItem,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: 'WBSElementInternalID_2'
      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_WBSElmntByIntKeyStdVH', element: 'WBSElementInternalID' } } ]
      @ObjectModel.foreignKey.association: '_WBSElement'
      item.WBSElementInternalID,
      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_WBSElementBasicDataStdVH', element: 'WBSElementInternalID' } } ]
      @ObjectModel.foreignKey.association: '_WBSElementBasicData2'
      item.WBSElementInternalID_2,
      @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,
      @ObjectModel.foreignKey.association: '_PlannedOrder'
      item.PlannedOrder,
      @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,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: 'MaterialRevisionLevel_2'
      cast(head.MaterialRevisionLevel  as qrevlv preserving type)                as MaterialRevisionLevel,   // with conv. exit

      head.MaterialRevisionLevel_2                                               as MaterialRevisionLevel_2, // w/o conv. exit

      @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,
      cast(item.ProductConfiguration   as product_configuration preserving type) as ProductConfiguration,
      item.EffectivityParameterVariant,
      head.ConditionApplication,
      head.CapacityActiveVersion,
      head.CapacityRqmtHasNotToBeCreated,
      head.OrderSequenceNumber,
      head.MfgOrderSplitStatus,

      // Assignments BOO

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_MaterialStdVH', element: 'Material' } } ]
      @ObjectModel.foreignKey.association: '_BillOfOperationsMaterial'
      head.Material as BillOfOperationsMaterial,
      @ObjectModel.foreignKey.association: '_BillOfOperationsType'
      head.BillOfOperationsType,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: 'BillOfOperationsGroup' // default data element change -> deprecated to avoid RTT2 error in ATC

      @ObjectModel.foreignKey.association: '_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_MfgBOOChgStateStdVH', element: 'BOOInternalVersionCounter' } } ]
      @ObjectModel.foreignKey.association: '_BillOfOperationsChangeState'
      head.BOOInternalVersionCounter,
      @ObjectModel.foreignKey.association: '_BillOfOperationsApplication'
      head.BillOfOperationsApplication,
      @ObjectModel.foreignKey.association: '_BillOfOperationsUsage'
      head.BillOfOperationsUsage,
      head.BillOfOperationsVersion,
      head.BOOExplosionDate,
      head.BOOValidityStartDate,

      // Assignments BOM

      head.BillOfMaterialCategory,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: 'BillOfMaterialInternalID'
      head.BillOfMaterial,            // with conv. exit NUMCV

      head.BillOfMaterialInternalID,  // with conv. exit ALPHA

      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,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: 'EventBasedPostingMethod'
      head.OrderIsEventBasedPosting,
      head.EventBasedPostingMethod,

      // Floats

      @ObjectModel.foreignKey.association: '_SchedulingFloatProfile'
      head.SchedulingFloatProfile,
      head.FloatBeforeProductionInWrkDays,
      head.FloatAfterProductionInWorkDays,
      head.ReleasePeriodInWorkDays,

      // Dates and Times

      head.ChangeToScheduledDatesIsMade,
      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,
      item.TotalCommitmentDate                                                         as MfgOrderTotalCommitmentDate,
      head.TechnicalCompletionDate                                                     as MfgOrderActualCompletionDate,
      item.ActualDeliveryDate                                                          as MfgOrderItemActualDeliveryDate,

      // Quantities and UoM

      @Semantics.unitOfMeasure: true
      cast(head.BaseUnit as productionunit preserving type)                      as ProductionUnit,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      cast(head.OrderPlannedTotalQty as mfgorderplannedtotalqty preserving type) as MfgOrderPlannedTotalQty,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      cast(head.OrderPlannedScrapQty as mfgorderplannedscrapqty preserving type) as MfgOrderPlannedScrapQty,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      cast(head.OrderConfirmedYieldQty as co_igmng preserving type)              as MfgOrderConfirmedYieldQty,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      cast(head.OrderConfirmedScrapQty as co_iasmg preserving type)              as MfgOrderConfirmedScrapQty,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      head.MfgOrderConfirmedReworkQty,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      cast(item.MfgOrderItemActualDeviationQty as co_mimez preserving type)      as ExpectedDeviationQuantity,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      item.MfgOrderItemGoodsReceiptQty                                           as ActualDeliveredQuantity,

      // Fashion Manufacturing Fields

      head.MasterProductionOrder                                                 as MasterProductionOrder,
      item.ProductSeasonYear                                                     as ProductSeasonYear,
      item.ProductSeason                                                         as ProductSeason,
      item.ProductCollection                                                     as ProductCollection,
      item.ProductTheme                                                          as ProductTheme,      
      
      // Associations

      _MfgOrderCategory,
      _MfgOrderType,
      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
      _MfgOrderItem,
      _MfgOrderMainItem,
      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
      _MfgOrderSequence,
      _MfgOrderOperation,
      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
      _MfgOrderMaterialDocItem,
      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
      _MfgOrderDocdGoodsMovement,
      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
      _MfgOrderDocumentLink,
      _MfgOrderDocInfoRecord,
      @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
      _MfgOrderLongText,
      _MfgOrderImportance,
      head._OrderTypeDetails,
      _CreatedByUser,
      _LastChangedByUser,
      _LongTextLanguage,
      _ProductionUnit,
      head._Currency,
      _SuperiorOrder,
      _ReferenceOrder,
      _LeadingOrder,
      _OrderInternalID,
      _BillOfOperationsMaterial,
      head._BillOfOperationsType,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_BillOfOperationsGroup2'
      head._BillOfOperationsGroup,
      head._BillOfOperationsGroup2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_BillOfOperations2'
      _BillOfOperations,
      _BillOfOperations2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_BillOfOperationsChangeState2'
      _BillOfOperationsChangeState,
      _BillOfOperationsChangeState2,
      head._BillOfOperationsApplication,
      head._BillOfOperationsUsage,
      head._ConfirmationGroup,
      head._Reservation,
      head._SettlementReservation,
      _ProductionPlant,
      _PlanningPlant,
      item._Material,
      _Product,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_ProductPlant2'
      _ProductPlant,
      _ProductPlant2,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_ProductStorageLocation2'
      _ProductStorageLocation,
      _ProductStorageLocation2,
      _ProductPlantMRPArea,
      _ProductUnitsOfMeasure,
      _StorageLocation,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_Batch_2'  // 0..1 cardinality

      _Batch,
      _Batch_2,
      _MRPArea,
      _MRPController,
      _ProductionSupervisor,
      _ProductionSchedulingProfile,
      _ResponsiblePlannerGroup,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor: '_ProductionVersion2'
      _ProductionVersion,
      _ProductionVersion2,
      head._CapacityRequirement,
      _ChangeNumber,
--    @API.element.releaseState: #DEPRECATED
--    @API.element.successor: '_MaterialRevisionLevel2'
      @VDM.lifecycle.status: #DEPRECATED
      @VDM.lifecycle.successor: '_MaterialRevisionLevel2'
      _MaterialRevisionLevel,
      _MaterialRevisionLevel2,
      head._InspectionLot,
      _SalesOrder,
      _SalesOrderItem,
      _SalesDocument,
      _SalesDocumentItem,
--    @API.element.releaseState: #DEPRECATED
--    @API.element.successor: '_WBSElementBasicData2'
      @VDM.lifecycle.status: #DEPRECATED
      @VDM.lifecycle.successor: '_WBSElementBasicData2'
      _WBSElement,
--    @API.element.releaseState: #DEPRECATED
--    @API.element.successor: '_WBSElementBasicData2'
      @VDM.lifecycle.status: #DEPRECATED
      @VDM.lifecycle.successor: '_WBSElementBasicData2'
      _WBSElementBasicData,
      item._WBSElementBasicData2,
      item._PlannedOrder,
      item._InventoryUsabilityCode,
      head._BasicSchedulingType,
      head._ForecastSchedulingType,
      head._SchedulingFloatProfile,
      head._BusinessArea,
      head._ProfitCenter,
      head._CostCenter,
      head._ResponsibleCostCenter,
      head._CompanyCode,
      head._ControllingArea,
      head._ControllingObjectClass,
      _CostElement,
      _ActualCostsCostingVariant,
      _PlannedCostsCostingVariant,
      head._FunctionalArea,
      _GLAccount,
      head._ProductCostCollector,
      @VDM.lifecycle.status: #DEPRECATED
      @VDM.lifecycle.successor: '_MfgOrderLongText'
      head._LongText,
      head._RFM_MasterProductOrder
}
where
  (    head.OrderCategory = '10'
    or head.OrderCategory = '40' ); //Manufacturing orders only