I_MfgOrderForExtraction

DDL: I_MFGORDERFOREXTRACTION SQL: IMFGORDEREXTRCN Type: view BASIC

Manufacturing Order

I_MfgOrderForExtraction is a Basic CDS View (Dimension) that provides data about "Manufacturing Order" in SAP S/4HANA. It reads from 1 data source (I_OrderBasic) and exposes 178 fields with key field ManufacturingOrder. It has 36 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_OrderBasic head from

Associations (36)

CardinalityTargetAliasCondition
[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
[1..1] I_OrderInternalID _OrderInternalID $projection.MfgOrderInternalID = _OrderInternalID.OrderInternalID
[0..1] I_Language _LongTextLanguage $projection.LongTextLanguage = _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..1] I_Batch _Batch $projection.ProductionPlant = _Batch.Plant and $projection.Material = _Batch.Material and $projection.Batch = _Batch.Batch
[0..1] I_Product _Product $projection.Product = _Product.Product
[0..1] I_ProductPlantBasic _ProductPlant $projection.ProductionPlant = _ProductPlant.Plant and $projection.Product = _ProductPlant.Product
[0..1] I_ProductStorageLocationBasic _ProductStorageLocation $projection.Product = _ProductStorageLocation.Product and $projection.ProductionPlant = _ProductStorageLocation.Plant and $projection.StorageLocation = _ProductStorageLocation.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_WBSElementBasicData _WBSElementBasicData $projection.WBSElementInternalID = _WBSElementBasicData.WBSElementInternalID
[0..1] I_ChangeMaster _ChangeNumber $projection.ChangeNumber = _ChangeNumber.ChangeNumber
[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_SchedulingFloatProfile _SchedulingFloatProfile $projection.ProductionPlant = _SchedulingFloatProfile.Plant and $projection.SchedulingFloatProfile = _SchedulingFloatProfile.SchedulingFloatProfile
[0..1] I_MfgBillOfOperations _BillOfOperations $projection.BillOfOperationsType = _BillOfOperations.BillOfOperationsType and $projection.BillOfOperationsGroup = _BillOfOperations.BillOfOperationsGroup and $projection.BillOfOperationsVariant = _BillOfOperations.BillOfOperationsVariant
[0..1] I_MfgBillOfOperationsChgSt _BillOfOperationsChangeState $projection.BillOfOperationsType = _BillOfOperationsChangeState.BillOfOperationsType and $projection.BillOfOperationsGroup = _BillOfOperationsChangeState.BillOfOperationsGroup and $projection.BillOfOperationsVariant = _BillOfOperationsChangeState.BillOfOperationsVariant and $projection.BOOInternalVersionCounter = _BillOfOperationsChangeState.BOOInternalVersionCounter
[0..1] I_ProductionVersion _ProductionVersion $projection.Material = _ProductionVersion.Material and $projection.ProductionPlant = _ProductionVersion.Plant and $projection.ProductionVersion = _ProductionVersion.ProductionVersion

Annotations (22)

NameValueLevelField
AbapCatalog.sqlViewName IMFGORDEREXTRCN 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.modelingPattern #ANALYTICAL_DIMENSION view
ObjectModel.representativeKey ManufacturingOrder view
ObjectModel.sapObjectNodeType.name ProductionOrder 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 (178)

KeyFieldSource TableSource FieldDescription
KEY ManufacturingOrder
OrderItemasManufacturingOrderItem
ManufacturingOrderCategory I_OrderBasic OrderCategory
ManufacturingOrderType I_OrderBasic OrderType
ManufacturingOrderText
ManufacturingOrderHasLongText I_OrderBasic OrderHasLongText
LongTextLanguage I_OrderBasic LongTextLanguage
ManufacturingOrderImportance
IsMarkedForDeletion I_OrderBasic IsMarkedForDeletion
IsCompletelyDelivered item IsCompletelyDelivered
MfgOrderIsPartOfCollvOrder hdr2 MfgOrderIsPartOfCollvOrder
MfgOrderHierarchyLevel hdr2 MfgOrderHierarchyLevel
OrderIsNotCostedAutomatically hdr2 OrderIsNotCostedAutomatically
OrdIsNotSchedldAutomatically hdr2 OrdIsNotSchedldAutomatically
ProdnProcgIsFlexible hdr2 ProdnProcgIsFlexible
CreationDate
CreationTime
CreatedByUser I_OrderBasic CreatedByUser
LastChangeDate I_OrderBasic LastChangeDate
LastChangeTime I_OrderBasic LastChangeTime
LastChangedByUser I_OrderBasic LastChangedByUser
Material item Material
Product
StorageLocation item StorageLocation
Batch item Batch
GoodsRecipientName item GoodsRecipientName
UnloadingPointName item UnloadingPointName
InventoryUsabilityCode item InventoryUsabilityCode
MaterialGoodsReceiptDuration item MaterialGoodsReceiptDuration
MfgOrderInternalID
ReferenceOrder I_OrderBasic ReferenceOrder
LeadingOrder hdr2 LeadingOrder
SuperiorOrder hdr2 MfgOrderSuperiorMfgOrder
Currency I_OrderBasic Currency
ProductionPlant
PlanningPlant item MRPPlant
MRPArea item MRPArea
MRPController
ProductionSupervisor
ProductionSchedulingProfile
ResponsiblePlannerGroup hdr2 ResponsiblePlannerGroup
ProductionVersion item ProductionVersion
SalesOrder item SalesOrder
SalesOrderItem item SalesOrderItem
WBSElementInternalID item WBSElementInternalID_2
Reservation hdr2 Reservation
SettlementReservation
MfgOrderConfirmation hdr2 MfgOrderConfirmation
NumberOfMfgOrderConfirmations
PlannedOrder item PlannedOrder
CapacityRequirement hdr2 CapacityRequirement
InspectionLot hdr2 InspectionLot
ChangeNumber hdr2 ChangeNumber
BasicSchedulingType
ObjectInternalID
ProductConfiguration
ConditionApplication I_OrderBasic ConditionApplication
CapacityActiveVersion hdr2 CapacityActiveVersion
CapacityRqmtHasNotToBeCreated hdr2 CapacityRqmtHasNotToBeCreated
OrderSequenceNumber hdr2 OrderSequenceNumber
BillOfOperationsMaterial hdr2 Material
BillOfOperationsType hdr2 BillOfOperationsType
BillOfOperationsGroup hdr2 BillOfOperationsGroup
BillOfOperationsVariant hdr2 BillOfOperationsVariant
BOOInternalVersionCounter hdr2 BOOInternalVersionCounter
BillOfOperationsUsage hdr2 BillOfOperationsUsage
BillOfOperationsVersion hdr2 BillOfOperationsVersion
BOOExplosionDate hdr2 BOOExplosionDate
BOOValidityStartDate hdr2 BOOValidityStartDate
BillOfMaterialCategory hdr2 BillOfMaterialCategory
BillOfMaterial hdr2 BillOfMaterial
BillOfMaterialVariant hdr2 BillOfMaterialVariant
BillOfMaterialVariantUsage hdr2 BillOfMaterialVariantUsage
BillOfMaterialVersion hdr2 BillOfMaterialVersion
BillOfMaterialStatus hdr2 BillOfMaterialStatus
BOMExplosionDate hdr2 BOMExplosionDate
BOMValidityStartDate hdr2 BOMValidityStartDate
BusinessArea I_OrderBasic BusinessArea
CompanyCode I_OrderBasic CompanyCode
ControllingArea I_OrderBasic ControllingArea
ProfitCenter I_OrderBasic ProfitCenter
CostCenter I_OrderBasic CostCenter
ResponsibleCostCenter I_OrderBasic ResponsibleCostCenter
CostElement I_OrderBasic CostElement
GLAccount I_OrderBasic GLAccount
ProductCostCollector I_OrderBasic ProductCostCollector
ActualCostsCostingVariant hdr2 ActualCostsCostingVariant
PlannedCostsCostingVariant hdr2 PlannedCostsCostingVariant
ControllingObjectClass
FunctionalArea I_OrderBasic FunctionalArea
EventBasedPostingMethod I_OrderBasic EventBasedPostingMethod
SchedulingFloatProfile hdr2 SchedulingFloatProfile
FloatBeforeProductionInWrkDays hdr2 FloatBeforeProductionInWrkDays
FloatAfterProductionInWorkDays hdr2 FloatAfterProductionInWorkDays
ReleasePeriodInWorkDays hdr2 ReleasePeriodInWorkDays
MfgOrderPlannedStartTime
MfgOrderPlannedEndDate
MfgOrderPlannedEndTime
MfgOrderPlannedReleaseDate
MfgOrderScheduledStartTime
MfgOrderScheduledEndDate
MfgOrderScheduledEndTime
MfgOrderScheduledReleaseDate
MfgOrderActualStartTime
MfgOrderConfirmedEndDate
MfgOrderConfirmedEndTime
MfgOrderActualReleaseDate
MfgOrderItemActualDeliveryDate item ActualDeliveryDate
MfgOrderActualCompletionDate I_OrderBasic TechnicalCompletionDate
ProductionUnit
MfgOrderPlannedTotalQty
MfgOrderPlannedScrapQty
MfgOrderConfirmedYieldQty
MfgOrderConfirmedScrapQty
MfgOrderConfirmedReworkQty hdr2 MfgOrderConfirmedReworkQty
ExpectedDeviationQuantity
ActualDeliveredQuantity item MfgOrderItemGoodsReceiptQty
_OrderCategory I_OrderBasic _OrderCategory
_OrderType I_OrderBasic _OrderType
_CreatedByUser _CreatedByUser
_LastChangedByUser _LastChangedByUser
_LongTextLanguage _LongTextLanguage
_ProductionUnit _ProductionUnit
_Currency I_OrderBasic _Currency
_SuperiorOrder _SuperiorOrder
_ReferenceOrder _ReferenceOrder
_LeadingOrder _LeadingOrder
_OrderInternalID _OrderInternalID
_BillOfOperationsMaterial _BillOfOperationsMaterial
_BillOfOperationsType hdr2 _BillOfOperationsType
_BillOfOperationsGroup hdr2 _BillOfOperationsGroup
_BillOfOperations _BillOfOperations
_BillOfOperationsChangeState _BillOfOperationsChangeState
_BillOfOperationsUsage hdr2 _BillOfOperationsUsage
_ConfirmationGroup hdr2 _ConfirmationGroup
_Reservation hdr2 _Reservation
_SettlementReservation hdr2 _SettlementReservation
_ProductionPlant _ProductionPlant
_PlanningPlant _PlanningPlant
_Material item _Material
_Product _Product
_ProductPlant _ProductPlant
_ProductStorageLocation _ProductStorageLocation
_ProductPlantMRPArea _ProductPlantMRPArea
_StorageLocation _StorageLocation
_Batch _Batch
_MRPArea _MRPArea
_MRPController _MRPController
_ProductionSupervisor _ProductionSupervisor
_ProductionSchedulingProfile _ProductionSchedulingProfile
_ResponsiblePlannerGroup _ResponsiblePlannerGroup
_ProductionVersion _ProductionVersion
_CapacityRequirement hdr2 _CapacityRequirement
_ChangeNumber _ChangeNumber
_InspectionLot hdr2 _InspectionLot
_SalesOrder _SalesOrder
_SalesOrderItem _SalesOrderItem
_SalesDocument _SalesDocument
_SalesDocumentItem _SalesDocumentItem
_WBSElementBasicData _WBSElementBasicData
_PlannedOrder item _PlannedOrder
_InventoryUsabilityCode item _InventoryUsabilityCode
_BasicSchedulingType hdr2 _BasicSchedulingType
_SchedulingFloatProfile _SchedulingFloatProfile
_BusinessArea I_OrderBasic _BusinessArea
_ProfitCenter I_OrderBasic _ProfitCenter
_CostCenter I_OrderBasic _CostCenter
_ResponsibleCostCenter I_OrderBasic _ResponsibleCostCenter
_CompanyCode I_OrderBasic _CompanyCode
_ControllingArea I_OrderBasic _ControllingArea
_ControllingObjectClass I_OrderBasic _ControllingObjectClass
_CostElement _CostElement
_ActualCostsCostingVariant _ActualCostsCostingVariant
_PlannedCostsCostingVariant _PlannedCostsCostingVariant
_FunctionalArea I_OrderBasic _FunctionalArea
_GLAccount _GLAccount
_ProductCostCtrlgOrder I_OrderBasic _ProductCostCtrlgOrder
_LongText I_OrderBasic _LongText
@AbapCatalog.sqlViewName: 'IMFGORDEREXTRCN'
@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.modelingPattern: #ANALYTICAL_DIMENSION
@ObjectModel.supportedCapabilities: [#ANALYTICAL_DIMENSION, #CDS_MODELING_ASSOCIATION_TARGET, #CDS_MODELING_DATA_SOURCE, #EXTRACTION_DATA_SOURCE, #SQL_DATA_SOURCE, #SEARCHABLE_ENTITY]
@ObjectModel.representativeKey: 'ManufacturingOrder'
@ObjectModel.sapObjectNodeType.name: 'ProductionOrder'
@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_MfgOrderForExtraction
  as select from I_OrderBasic                    as  head
    left outer to one join I_LogisticsOrderBasic as  hdr2 on hdr2.OrderID = head.OrderID
    left outer to one join I_OrderItem           as  item on item.OrderID   = head.OrderID
                                                 and item.OrderItem = '0001'

  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.LongTextLanguage = _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..1] to I_Batch                        as _Batch                       on  $projection.ProductionPlant = _Batch.Plant
                                                                                       and $projection.Material        = _Batch.Material
                                                                                       and $projection.Batch           = _Batch.Batch
  association [0..1] to I_Product                      as _Product                     on  $projection.Product = _Product.Product
  association [0..1] to I_ProductPlantBasic            as _ProductPlant                on  $projection.ProductionPlant = _ProductPlant.Plant
                                                                                       and $projection.Product         = _ProductPlant.Product
  association [0..1] to I_ProductStorageLocationBasic  as _ProductStorageLocation      on  $projection.Product         = _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_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_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_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_SchedulingFloatProfile       as _SchedulingFloatProfile      on  $projection.ProductionPlant        = _SchedulingFloatProfile.Plant
                                                                                       and $projection.SchedulingFloatProfile = _SchedulingFloatProfile.SchedulingFloatProfile
  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
  association [0..1] to I_ProductionVersion            as _ProductionVersion           on  $projection.Material          = _ProductionVersion.Material
                                                                                       and $projection.ProductionPlant   = _ProductionVersion.Plant
                                                                                       and $projection.ProductionVersion = _ProductionVersion.ProductionVersion

{
      // 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: '_OrderCategory'
      head.OrderCategory as ManufacturingOrderCategory,
      @ObjectModel.foreignKey.association: '_OrderType'
      head.OrderType     as ManufacturingOrderType,

      // Text

      @Semantics.text: true
      cast(head.OrderDescription as manufacturingordertext preserving type) as ManufacturingOrderText,
      head.OrderHasLongText                                                 as ManufacturingOrderHasLongText,
      @ObjectModel.foreignKey.association: '_LongTextLanguage'
      head.LongTextLanguage,

      // Attributes

      cast(hdr2.PriorityCode as orderimportancecode preserving type) as ManufacturingOrderImportance,
      head.IsMarkedForDeletion,
      item.IsCompletelyDelivered,
      @Semantics.booleanIndicator
      hdr2.MfgOrderIsPartOfCollvOrder,
      hdr2.MfgOrderHierarchyLevel,
      @Semantics.booleanIndicator
      hdr2.OrderIsNotCostedAutomatically,
      @Semantics.booleanIndicator
      hdr2.OrdIsNotSchedldAutomatically,
      hdr2.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

      @ObjectModel.foreignKey.association: '_Material'
      item.Material                                                  as Material,
      @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,
      @ObjectModel.foreignKey.association: '_InventoryUsabilityCode'
      item.InventoryUsabilityCode,
      item.MaterialGoodsReceiptDuration,

      // Assignments

      @ObjectModel.foreignKey.association: '_OrderInternalID'
      cast(hdr2.OrderInternalID as pph_aufpl preserving type)               as MfgOrderInternalID,
      @ObjectModel.foreignKey.association: '_ReferenceOrder'
      head.ReferenceOrder,
      @ObjectModel.foreignKey.association: '_LeadingOrder'
      hdr2.LeadingOrder,
      @ObjectModel.foreignKey.association: '_SuperiorOrder'
      hdr2.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(hdr2.MRPController               as pph_dispo   preserving type) as MRPController,
      @ObjectModel.foreignKey.association: '_ProductionSupervisor'
      cast(hdr2.ProductionSupervisor        as pph_fevor   preserving type) as ProductionSupervisor,
      @ObjectModel.foreignKey.association: '_ProductionSchedulingProfile'
      cast(hdr2.ProductionSchedulingProfile as pph_prodprf preserving type) as ProductionSchedulingProfile,
      @ObjectModel.foreignKey.association: '_ResponsiblePlannerGroup'
      hdr2.ResponsiblePlannerGroup,
      @ObjectModel.foreignKey.association: '_ProductionVersion'
      item.ProductionVersion,
      @ObjectModel.foreignKey.association: '_SalesOrder'
      item.SalesOrder,
      @ObjectModel.foreignKey.association: '_SalesOrderItem'
      item.SalesOrderItem,
      @ObjectModel.foreignKey.association: '_WBSElementBasicData'
      item.WBSElementInternalID_2                                           as WBSElementInternalID,
      @ObjectModel.foreignKey.association: '_Reservation'
      hdr2.Reservation,
      @ObjectModel.foreignKey.association: '_SettlementReservation'
      cast(hdr2.SettlementReservation  as settlmntres preserving type)      as SettlementReservation,
      @ObjectModel.foreignKey.association: '_ConfirmationGroup'
      hdr2.MfgOrderConfirmation,
      cast(hdr2.MfgOrderConfirmationCount as pph_noofconf preserving type)  as NumberOfMfgOrderConfirmations,
      @ObjectModel.foreignKey.association: '_PlannedOrder'
      item.PlannedOrder,
      @ObjectModel.foreignKey.association: '_CapacityRequirement'
      hdr2.CapacityRequirement,
      @ObjectModel.foreignKey.association: '_InspectionLot'
      hdr2.InspectionLot,
      @ObjectModel.foreignKey.association: '_ChangeNumber'
      hdr2.ChangeNumber,
      @ObjectModel.foreignKey.association: '_BasicSchedulingType'
      cast(hdr2.BasicSchedulingType    as basicschedtype preserving type)        as BasicSchedulingType,
      @ObjectModel.foreignKey.association: '_ForecastSchedulingType'
      cast(hdr2.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,
      head.ConditionApplication,
      hdr2.CapacityActiveVersion,
      hdr2.CapacityRqmtHasNotToBeCreated,
      hdr2.OrderSequenceNumber,

      // Assignments BOO

      @ObjectModel.foreignKey.association: '_BillOfOperationsMaterial'
      hdr2.Material as BillOfOperationsMaterial,
      @ObjectModel.foreignKey.association: '_BillOfOperationsType'
      hdr2.BillOfOperationsType,
      @ObjectModel.foreignKey.association: '_BillOfOperationsGroup'
      hdr2.BillOfOperationsGroup,
      @ObjectModel.foreignKey.association: '_BillOfOperations'
      hdr2.BillOfOperationsVariant,
      @ObjectModel.foreignKey.association: '_BillOfOperationsChangeState'
      hdr2.BOOInternalVersionCounter,
      @ObjectModel.foreignKey.association: '_BillOfOperationsUsage'
      hdr2.BillOfOperationsUsage,
      hdr2.BillOfOperationsVersion,
      hdr2.BOOExplosionDate,
      hdr2.BOOValidityStartDate,

      // Assignments BOM

      hdr2.BillOfMaterialCategory,
      hdr2.BillOfMaterial,
      hdr2.BillOfMaterialVariant,
      hdr2.BillOfMaterialVariantUsage,
      hdr2.BillOfMaterialVersion,
      hdr2.BillOfMaterialStatus,
      hdr2.BOMExplosionDate,
      hdr2.BOMValidityStartDate,

      // Assignments FI/CO

      @ObjectModel.foreignKey.association: '_BusinessArea'
      head.BusinessArea,
      @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,
      @ObjectModel.foreignKey.association: '_GLAccount'
      head.GLAccount,
      @ObjectModel.foreignKey.association: '_ProductCostCtrlgOrder'
      head.ProductCostCollector,
      @ObjectModel.foreignKey.association: '_ActualCostsCostingVariant'
      hdr2.ActualCostsCostingVariant,
      @ObjectModel.foreignKey.association: '_PlannedCostsCostingVariant'
      hdr2.PlannedCostsCostingVariant,
      @ObjectModel.foreignKey.association: '_ControllingObjectClass'
      cast(head.ControllingObjectClass as pph_scope preserving type)                   as ControllingObjectClass,
      @ObjectModel.foreignKey.association: '_FunctionalArea'
      head.FunctionalArea,
      head.EventBasedPostingMethod,

      // Floats

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

      // Dates and Times

      -- planned/basic dates
      cast(hdr2.PlannedStartDate as mfgorderplannedstartdate preserving type)          as MfgOrderPlannedStartDate,
      cast(hdr2.PlannedStartTime as mfgorderplannedstarttime preserving type)          as MfgOrderPlannedStartTime,
      cast(hdr2.PlannedEndDate as mfgorderplannedenddate preserving type)              as MfgOrderPlannedEndDate,
      cast(hdr2.PlannedEndTime as mfgorderplannedendtime preserving type)              as MfgOrderPlannedEndTime,
      cast(hdr2.PlannedReleaseDate as mfgorderplannedreleasedate preserving type)      as MfgOrderPlannedReleaseDate,
      -- scheduled dates
      cast(hdr2.ScheduledBasicStartDate as mfgorderscheduledstartdate preserving type) as MfgOrderScheduledStartDate,
      cast(hdr2.ScheduledBasicStartTime as mfgorderscheduledstarttime preserving type) as MfgOrderScheduledStartTime,
      cast(hdr2.ScheduledBasicEndDate as mfgorderscheduledenddate preserving type)     as MfgOrderScheduledEndDate,
      cast(hdr2.ScheduledBasicEndTime as mfgorderscheduledendtime preserving type)     as MfgOrderScheduledEndTime,
      cast(hdr2.ScheduledReleaseDate as mfgorderscheduledreleasedate preserving type)  as MfgOrderScheduledReleaseDate,
      -- confirmed/actual dates
      cast(hdr2.ActualStartDate as mfgorderactualstartdate preserving type)            as MfgOrderActualStartDate,
      cast(hdr2.ActualStartTime as mfgorderactualstarttime preserving type)            as MfgOrderActualStartTime,
      cast(hdr2.ConfirmedEndDate as mfgorderconfirmedenddate preserving type)          as MfgOrderConfirmedEndDate,
      cast(hdr2.ConfirmedEndTime as mfgorderconfirmedendtime preserving type)          as MfgOrderConfirmedEndTime,
      cast(hdr2.ActualReleasedDate as mfgorderactualreleasedate preserving type)       as MfgOrderActualReleaseDate,
      -- other dates
      item.TotalCommitmentDate                                                         as MfgOrderTotalCommitmentDate,
      item.ActualDeliveryDate                                                          as MfgOrderItemActualDeliveryDate,
      head.TechnicalCompletionDate                                                     as MfgOrderActualCompletionDate,

      // Quantities and UoM

      @Semantics.unitOfMeasure: true
      cast(hdr2.BaseUnit as productionunit preserving type)                      as ProductionUnit,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      cast(hdr2.OrderPlannedTotalQty as mfgorderplannedtotalqty preserving type) as MfgOrderPlannedTotalQty,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      cast(hdr2.OrderPlannedScrapQty as mfgorderplannedscrapqty preserving type) as MfgOrderPlannedScrapQty,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      cast(hdr2.OrderConfirmedYieldQty as co_igmng preserving type)              as MfgOrderConfirmedYieldQty,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      cast(hdr2.OrderConfirmedScrapQty as co_iasmg preserving type)              as MfgOrderConfirmedScrapQty,
      @Semantics.quantity.unitOfMeasure: 'ProductionUnit'
      @Aggregation.default: #SUM
      hdr2.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,

      // Associations

      head._OrderCategory,
      head._OrderType,
      _CreatedByUser,
      _LastChangedByUser,
      _LongTextLanguage,
      _ProductionUnit,
      head._Currency,
      _SuperiorOrder,
      _ReferenceOrder,
      _LeadingOrder,
      _OrderInternalID,
      _BillOfOperationsMaterial,
      hdr2._BillOfOperationsType,
      hdr2._BillOfOperationsGroup,
      _BillOfOperations,
      _BillOfOperationsChangeState,
      hdr2._BillOfOperationsUsage,
      hdr2._ConfirmationGroup,
      hdr2._Reservation,
      hdr2._SettlementReservation,
      _ProductionPlant,
      _PlanningPlant,
      item._Material,
      _Product,
      _ProductPlant,
      _ProductStorageLocation,
      _ProductPlantMRPArea,
      _StorageLocation,
      _Batch,
      _MRPArea,
      _MRPController,
      _ProductionSupervisor,
      _ProductionSchedulingProfile,
      _ResponsiblePlannerGroup,
      _ProductionVersion,
      hdr2._CapacityRequirement,
      _ChangeNumber,
      hdr2._InspectionLot,
      _SalesOrder,
      _SalesOrderItem,
      _SalesDocument,
      _SalesDocumentItem,
      _WBSElementBasicData,
      item._PlannedOrder,
      item._InventoryUsabilityCode,
      hdr2._BasicSchedulingType,
      hdr2._ForecastSchedulingType,
      _SchedulingFloatProfile,
      head._BusinessArea,
      head._ProfitCenter,
      head._CostCenter,
      head._ResponsibleCostCenter,
      head._CompanyCode,
      head._ControllingArea,
      head._ControllingObjectClass,
      _CostElement,
      _ActualCostsCostingVariant,
      _PlannedCostsCostingVariant,
      head._FunctionalArea,
      _GLAccount,
      head._ProductCostCtrlgOrder,
      head._LongText
}
where
  (    head.OrderCategory = '04'
    or head.OrderCategory = '05'
    or head.OrderCategory = '06'
    or head.OrderCategory = '10'
    or head.OrderCategory = '40' );
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_LOGISTICSORDERBASIC",
"I_ORDERBASIC",
"I_ORDERITEM"
],
"ASSOCIATED":
[
"I_BATCH",
"I_BILLOFOPERATIONSGROUP",
"I_BILLOFOPERATIONSTYPE",
"I_BILLOFOPERATIONSUSAGE",
"I_BUSINESSAREA",
"I_CAPACITYREQUIREMENT",
"I_CHANGEMASTER",
"I_COMPANYCODE",
"I_CONFIRMATIONGROUP",
"I_CONTROLLINGAREA",
"I_CONTROLLINGOBJECTCLASS",
"I_COSTCENTER",
"I_COSTELEMENT",
"I_COSTINGVARIANT",
"I_CURRENCY",
"I_FUNCTIONALAREA",
"I_GLACCOUNT",
"I_INSPECTIONLOT",
"I_LANGUAGE",
"I_MANUFACTURINGORDER",
"I_MATERIAL",
"I_MFGBILLOFOPERATIONS",
"I_MFGBILLOFOPERATIONSCHGST",
"I_MRPAREA",
"I_MRPCONTROLLER",
"I_ORDERCATEGORY",
"I_ORDERINTERNALID",
"I_ORDERLONGTEXT",
"I_ORDERTYPE",
"I_PLANNEDORDER",
"I_PLANT",
"I_PRODUCT",
"I_PRODUCTCOSTCTRLGORDER",
"I_PRODUCTIONSCHEDULINGPROFILE",
"I_PRODUCTIONSUPERVISOR",
"I_PRODUCTIONVERSION",
"I_PRODUCTPLANTBASIC",
"I_PRODUCTPLANTMRP",
"I_PRODUCTSTORAGELOCATIONBASIC",
"I_PROFITCENTER",
"I_RESERVATIONDOCUMENTHEADER",
"I_RESPONSIBLEPLANNERGROUP",
"I_SALESDOCUMENT",
"I_SALESDOCUMENTITEM",
"I_SALESORDER",
"I_SALESORDERITEM",
"I_SCHEDULINGFLOATPROFILE",
"I_SCHEDULINGTYPE",
"I_STOCKTYPE_2",
"I_STORAGELOCATION",
"I_UNITOFMEASURE",
"I_USER",
"I_WBSELEMENTBASICDATA"
],
"BASE":
[
"I_LOGISTICSORDERBASIC",
"I_ORDERBASIC",
"I_ORDERITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/