I_MaintenanceOrder

DDL: I_MAINTENANCEORDER Type: view BASIC

Maintenance Order

I_MaintenanceOrder is a Basic CDS View that provides data about "Maintenance Order" in SAP S/4HANA. It reads from 1 data source (afih) and exposes 149 fields with key field MaintenanceOrder. It has 63 associations to related views.

Data Sources (1)

SourceAliasJoin Type
afih afih from

Associations (63)

CardinalityTargetAliasCondition
[0..1] I_LogisticsOrder _Order _Order.OrderID = $projection.MaintenanceOrder
[1..1] I_OrderCategory _MaintenanceOrderCategory $projection.MaintenanceOrderCategory = _MaintenanceOrderCategory.OrderCategory
[1..1] I_OrderType _MaintenanceOrderType $projection.MaintenanceOrderType = _MaintenanceOrderType.OrderType
[0..1] I_ControllingArea _ControllingArea $projection.ControllingArea = _ControllingArea.ControllingArea
[0..1] I_ControllingObjectClass _ControllingObjectClass $projection.ControllingObjectClass = _ControllingObjectClass.ControllingObjectClass
[0..1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode
[0..*] I_CostCenter _ResponsibleCostCenter $projection.ControllingArea = _ResponsibleCostCenter.ControllingArea and $projection.ResponsibleCostCenter = _ResponsibleCostCenter.CostCenter
[0..*] I_ProfitCenter _ProfitCenter $projection.ControllingArea = _ProfitCenter.ControllingArea and $projection.ProfitCenter = _ProfitCenter.ProfitCenter
[0..1] I_Plant _LocationPlant $projection.MaintenancePlant = _LocationPlant.Plant
[0..1] I_SchedulingType _BasicSchedulingType $projection.BasicSchedulingType = _BasicSchedulingType.SchedulingType
[0..1] I_MaintenanceTaskList _MaintenanceTaskList $projection.TaskListType = _MaintenanceTaskList.TaskListType and $projection.TaskListGroup = _MaintenanceTaskList.TaskListGroup and $projection.TaskListGroupCounter = _MaintenanceTaskList.TaskListGroupCounter with default filter _MaintenanceTaskList.ValidityEndDate = '99991231'
[0..1] I_OrderItem _OrderItem $projection.MaintenanceOrder = _OrderItem.OrderID and _OrderItem.OrderItem = '0001'
[0..*] I_MaintenanceOrderOperation _MaintenanceOrderOperation $projection.MaintOrderRoutingNumber = _MaintenanceOrderOperation.MaintOrderRoutingNumber
[0..*] I_MaintenanceOrderCost _MaintenanceOrderCost $projection.MaintenanceOrderInternalID = _MaintenanceOrderCost.MaintenanceOrderInternalID
[0..*] I_MaintenanceOrderComponent_2 _MaintenanceOrderComponent $projection.MaintenanceOrder = _MaintenanceOrderComponent.MaintenanceOrder
[0..1] I_LocationAccountAssignment _LocationAccountAssignment $projection.MaintObjectLocAcctAssgmtNmbr = _LocationAccountAssignment.MaintObjectLocAcctAssgmtNmbr
[0..1] I_MaintenanceNotification _MaintenanceNotification $projection.MaintenanceNotification = _MaintenanceNotification.MaintenanceNotification
[0..1] I_Equipment _Equipment $projection.Equipment = _Equipment.Equipment
[0..1] I_Material _Assembly $projection.Assembly = _Assembly.Material
[0..1] I_MaintenancePlanBasic _MaintenancePlan $projection.MaintenancePlan = _MaintenancePlan.MaintenancePlan
[0..1] I_MaintenanceItem _MaintenanceItem $projection.MaintenanceItem = _MaintenanceItem.MaintenanceItem
[0..1] I_MaintenanceCall _MaintenanceCall $projection.MaintenancePlan = _MaintenanceCall.MaintenancePlan and $projection.MaintenanceItem = _MaintenanceCall.MaintenanceItem and $projection.MaintenanceCall = _MaintenanceCall.MaintenanceCall
[0..1] I_MaintenanceOrder _LeadingOrder $projection.LeadingOrder = _LeadingOrder.MaintenanceOrder
[0..1] I_Plant _MaintenancePlanningPlant $projection.MaintenancePlanningPlant = _MaintenancePlanningPlant.Plant
[0..1] I_PMNotificationPriorityType _MaintenancePriorityType $projection.MaintPriorityType = _MaintenancePriorityType.MaintPriorityType
[0..1] I_PMNotificationPriority _MaintenancePriority $projection.MaintPriority = _MaintenancePriority.MaintPriority and $projection.MaintPriorityType = _MaintenancePriority.MaintPriorityType
[0..1] I_WorkCenter _MainWorkCenter $projection.WorkCenterInternalID = _MainWorkCenter.WorkCenterInternalID and $projection.WorkCenterTypeCode = _MainWorkCenter.WorkCenterTypeCode
[1..1] I_WorkCenterType _WorkCenterType $projection.WorkCenterTypeCode = _WorkCenterType.WorkCenterTypeCode
[0..1] I_MaintenanceActivityType _MaintenanceActivityType $projection.MaintenanceActivityType = _MaintenanceActivityType.MaintenanceActivityType
[0..*] I_PlantMaintenancePartner _MaintenancePartner $projection.MaintenanceOrderInternalID = _MaintenancePartner.MaintObjectInternalID
[0..1] I_BusinessArea _BusinessArea $projection.BusinessArea = _BusinessArea.BusinessArea
[0..1] I_FunctionalArea _FunctionalArea $projection.FunctionalArea = _FunctionalArea.FunctionalArea
[0..1] I_MaintenancePlannerGroup _MaintenancePlannerGroup $projection.MaintenancePlannerGroup = _MaintenancePlannerGroup.MaintenancePlannerGroup and $projection.MaintenancePlanningPlant = _MaintenancePlannerGroup.MaintenancePlanningPlant
[0..1] I_MaintenanceOrderPhase _MaintenanceOrderPhase $projection.MaintenanceProcessingPhase = _MaintenanceOrderPhase.MaintenanceProcessingPhase
[0..1] I_StatusObject _StatusObject $projection.MaintenanceOrderInternalID = _StatusObject.StatusObject
[1..*] I_StatusObjectStatus _StatusObjectStatus $projection.MaintenanceOrderInternalID = _StatusObjectStatus.StatusObject
[0..1] I_MaintOperationSystCondition _OperationSystemCondition $projection.OperationSystemCondition = _OperationSystemCondition.OperationSystemCondition
[0..1] I_Indicator _OrderHasLongText $projection.OrderHasLongText = _OrderHasLongText.IndicatorValue
[0..1] I_MaintOrdPlngDegreeCode _MaintOrdPlngDegreeCode $projection.MaintenanceOrderPlanningCode = _MaintOrdPlngDegreeCode.MaintenanceOrderPlanningCode
[0..1] I_MaintenanceRevision _MaintenanceRevision $projection.MaintenancePlanningPlant = _MaintenanceRevision.MaintenancePlanningPlant and $projection.MaintenanceRevision = _MaintenanceRevision.MaintenanceRevision
[0..1] I_MaintOrderTypeControlParam _MaintOrderTypeControlParam $projection.MaintenanceOrderType = _MaintOrderTypeControlParam.OrderType
[0..*] I_StatusObjectActiveStatus _StatusObjectActiveStatus $projection.MaintenanceOrderInternalID = _StatusObjectActiveStatus.StatusObject
[0..1] I_User _CreatedByUser $projection.CreatedByUser = _CreatedByUser.UserID
[0..*] I_MaintenanceItemObject _MaintenanceItemObject $projection.MaintenanceItemObjectList = _MaintenanceItemObject.MaintenanceItemObjectList
[0..*] I_MaintenanceOrderObjectList _MaintenanceOrderObjectList $projection.MaintenanceOrderObjectList = _MaintenanceOrderObjectList.MaintenanceOrderObjectList
[0..1] I_OrderProcessingGroup _OrderProcessingGroup $projection.ControllingArea = _OrderProcessingGroup.ControllingArea and $projection.OrderProcessingGroup = _OrderProcessingGroup.OrderProcessingGroup
[0..1] I_WBSElementByInternalKey _WBSElement $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
[0..1] I_ProjectByInternalKey _Project $projection.ProjectInternalID = _Project.ProjectInternalID
[0..*] I_CostCenterText _ResponsibleCostCenterText $projection.ControllingArea = _ResponsibleCostCenterText.ControllingArea and $projection.ResponsibleCostCenter = _ResponsibleCostCenterText.CostCenter and _ResponsibleCostCenterText.ValidityStartDate <= $session.system_date and _ResponsibleCostCenterText.ValidityEndDate >= $session.system_date
[0..1] I_PMContactCardEmployee _PMContactEmployee $projection.PersonnelNumber = _PMContactEmployee.PersonnelNumber
[0..1] I_PersonWorkAgreement_1 _PersonWorkAgreement $projection.PersonnelNumber = _PersonWorkAgreement.PersonWorkAgreement
[0..1] I_MaintOrderHasOpenMainWork _MaintOrderHasOpenMainWork $projection.MaintenanceOrder = _MaintOrderHasOpenMainWork.MaintenanceOrder
[0..1] E_MaintenanceOrder _MaintenanceOrderExtension $projection.MaintenanceOrder = _MaintenanceOrderExtension.MaintenanceOrder
[0..1] I_MaintenancePlanPlant _MaintenancePlanPlant $projection.MaintenancePlanningPlant = _MaintenancePlanPlant.MaintenancePlanningPlant
[0..1] I_EAMProcessPhase _EAMProcessPhase $projection.MaintOrdProcessPhaseCode = _EAMProcessPhase.EAMProcessPhaseCode
[0..1] I_EAMProcessSubPhase _EAMProcessSubPhase $projection.MaintOrdProcessSubPhaseCode = _EAMProcessSubPhase.EAMProcessSubPhaseCode
[0..1] I_CtrlgObjectSettlementRule _CtrlgObjectSettlementRule $projection.MaintenanceOrderInternalID = _CtrlgObjectSettlementRule.ControllingObject
[0..1] I_CostingSheetProcedure _CostingSheetProcedure $projection.ConditionUsage = _CostingSheetProcedure.ConditionUsage and $projection.ConditionApplication = _CostingSheetProcedure.ConditionApplication and $projection.CostingSheet = _CostingSheetProcedure.CostingSheetProcedure
[0..1] I_InternalOrderOverheadCodeVH _OverheadCode $projection.MaintenanceOrderOverheadCode = _OverheadCode.OverheadCode
[1..1] I_CostingVariant _PlannedCostingVariant $projection.PlannedCostsCostingVariant = _PlannedCostingVariant.CostingVariant
[1..1] I_CostingVariant _ActualCostingVariant $projection.ActualCostsCostingVariant = _ActualCostingVariant.CostingVariant
[1..1] I_BillableControl _BillableControl $projection.AccountingIndicatorCode = _BillableControl.BillableControl
[0..1] I_WrkPmtMaintOrderRelevance _WrkPmtMaintOrderRelevance $projection.MaintenanceOrderInternalID = _WrkPmtMaintOrderRelevance.MaintenanceOrderInternalID

Annotations (11)

NameValueLevelField
EndUserText.label Maintenance Order view
VDM.viewType #BASIC view
AccessControl.authorizationCheck #CHECK view
AbapCatalog.sqlViewName IMAINTORDER view
AccessControl.personalData.blocking #NOT_REQUIRED view
ObjectModel.representativeKey MaintenanceOrder view
Metadata.ignorePropagatedAnnotations true view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #XL view

Fields (149)

KeyFieldSource TableSource FieldDescription
KEY MaintenanceOrder afih aufnr
MaintPriorityType afih artpr
MaintPriority afih priok
MaintenanceProcessingPhase afih iphas
MaintObjectLocAcctAssgmtNmbr afih iloan
MaintenanceNotification afih qmnum
Equipment afih equnr
Assembly afih bautl
SerialNumber afih serialnr
MaintenancePlanningPlant afih iwerk
MaintenancePlannerGroup afih ingpr
MaintenanceRevision afih revnr
MaintenancePlan afih warpl
MaintenanceItem afih wapos
MaintenanceActivityType
WorkCenterInternalID afih gewrk
WorkCenterTypeCode afih pm_objty
MaintOrderReferenceDate afih addat
MaintOrderReferenceTime afih aduhr
MainWorkCompletedDateTime afih mainworkcompleteddatetime
MaintenanceOrderPlanningCode afih plknz
OperationSystemCondition afih anlzu
ReferenceElement afih adpsp
MaintenanceItemObjectList afih obknr
MaintenanceOrderObjectList
PersonnelNumber afih aning
MaintOrdProcmtIntegScenario afih maintordprocmtintegscenario
Material afih sermat
MaintOrderRoutingNumber afko aufpl
BusinessArea aufk gsber
FunctionalArea aufk func_area
MaintenanceOrderType aufk auart
MaintenanceOrderCategory aufk autyp
MaintenanceOrderDesc aufk ktext
ControllingArea aufk kokrs
CompanyCode aufk bukrs
ResponsibleCostCenter
ProfitCenter aufk prctr
ControllingObjectClass
TechnicalCompletionDate aufk idat2
BasicSchedulingType afko terkz
OrdIsNotSchedldAutomatically afko nauterm
MaintOrdBasicStartDate afko gstrp
MaintOrdBasicStartTime afko gsuzp
MaintOrdBasicEndDate afko gltrp
MaintOrdBasicEndTime afko gluzp
ScheduledBasicStartDate afko gstrs
ScheduledBasicStartTime afko gsuzs
ScheduledBasicEndDate afko gltrs
ScheduledBasicEndTime afko gluzs
MaintOrdPersonResponsible afih maintordpersonresponsible
MaintenanceOrderInternalID aufk objnr
TaskListGroup
TaskListType
TaskListGroupCounter
MaintenancePlant aufk sowrk
CreationDate aufk erdat
CreationTime aufk erfzeit
CreatedByUser aufk ernam
LastChangeByUser aufk aenam
LastChangeDateTime afih changeddatetime
AdditionalDeviceData afih deviceid
WBSElementInternalID
ProjectInternalID afko pronr
OrderProcessingGroup aufk abkrs
SuperiorProjectNetwork afko aufnt
MainWorkCenter aufk vaplz
MainWorkCenterPlant aufk wawrk
CostingSheet aufk kalsm
Currency aufk waers
LatestAcceptableCompletionDate
MaintOrdProcessPhaseCode afih maintordovrlprocphase
MaintOrdProcessSubPhaseCode afih maintordovrlprocsubphase
MaintOrderProcessingContext afih maintorderprocessingcontext
ServiceDocumentType afih service_doc_type
ServiceDocument afih service_doc_id
ServiceDocumentItem afih service_doc_item_id
ConditionUsage aufk kvewe
ConditionApplication aufk kappl
MaintenanceOrderOverheadCode aufk zschl
PlannedCostsCostingVariant afko klvarp
ActualCostsCostingVariant afko klvari
MaintenanceCall afih abnum
LeadingOrder afih laufn
PrevLtstAccptblCompletionDate afih old_lacd_date
OrderIsRefurbishmentOrder aufk rsord
AccountingIndicatorCode aufk bemot
_Order _Order
_MaintenanceOrderCategory _MaintenanceOrderCategory
_MaintenanceOrderType _MaintenanceOrderType
_ControllingArea _ControllingArea
_ResponsibleCostCenter _ResponsibleCostCenter
_LocationPlant _LocationPlant
_BasicSchedulingType _BasicSchedulingType
_LocationAccountAssignment _LocationAccountAssignment
_MaintenanceNotification _MaintenanceNotification
_Equipment _Equipment
_CompanyCode _CompanyCode
_MaintenancePlan _MaintenancePlan
_MaintenanceItem _MaintenanceItem
_MaintenanceCall _MaintenanceCall
_LeadingOrder _LeadingOrder
_OrderItem _OrderItem
_MaintenanceTaskList _MaintenanceTaskList
_MaintenancePriorityType _MaintenancePriorityType
_MaintenancePriority _MaintenancePriority
_MaintenanceOrderPhase _MaintenanceOrderPhase
_StatusObject _StatusObject
_MaintenanceOrderOperation _MaintenanceOrderOperation
_MaintenanceOrderComponent _MaintenanceOrderComponent
_MainWorkCenter _MainWorkCenter
_BusinessArea _BusinessArea
_FunctionalArea _FunctionalArea
_MaintenancePartner _MaintenancePartner
_MaintenanceActivityType _MaintenanceActivityType
_MaintenancePlannerGroup _MaintenancePlannerGroup
_StatusObjectStatus _StatusObjectStatus
_MaintenancePlanningPlant _MaintenancePlanningPlant
_Assembly _Assembly
_OperationSystemCondition _OperationSystemCondition
_MaintenanceOrderCost _MaintenanceOrderCost
_WorkCenterType _WorkCenterType
_OrderHasLongText _OrderHasLongText
_MaintOrdPlngDegreeCode _MaintOrdPlngDegreeCode
_MaintenanceRevision _MaintenanceRevision
_MaintOrderTypeControlParam _MaintOrderTypeControlParam
_StatusObjectActiveStatus _StatusObjectActiveStatus
_CreatedByUser _CreatedByUser
_MaintenanceItemObject _MaintenanceItemObject
_ResponsibleCostCenterText _ResponsibleCostCenterText
_ProfitCenter _ProfitCenter
_ControllingObjectClass _ControllingObjectClass
_OrderProcessingGroup _OrderProcessingGroup
_WBSElement _WBSElement
_Project _Project
_PMContactEmployee _PMContactEmployee
_PersonWorkAgreement _PersonWorkAgreement
_MaintOrderHasOpenMainWork _MaintOrderHasOpenMainWork
_MaintenancePlanPlant _MaintenancePlanPlant
_MaintenanceOrderObjectList _MaintenanceOrderObjectList
_EAMProcessPhase _EAMProcessPhase
_EAMProcessSubPhase _EAMProcessSubPhase
_CtrlgObjectSettlementRule _CtrlgObjectSettlementRule
_CostingSheetProcedure _CostingSheetProcedure
_OverheadCode _OverheadCode
_PlannedCostingVariant _PlannedCostingVariant
_ActualCostingVariant _ActualCostingVariant
_BillableControl _BillableControl
_WrkPmtMaintOrderRelevance _WrkPmtMaintOrderRelevance
@EndUserText.label: 'Maintenance Order'
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #CHECK
@AccessControl.privilegedAssociations:['_LocationAccountAssignment']
@AbapCatalog: { sqlViewName: 'IMAINTORDER', compiler.compareFilter, preserveKey }
@AccessControl.personalData.blocking: #NOT_REQUIRED
@ObjectModel.representativeKey: 'MaintenanceOrder'
@ObjectModel.semanticKey:  [ 'MaintenanceOrder' ]
@Metadata.ignorePropagatedAnnotations: true

// BOPF objects are generated from --> I_MaintOrderTechObj !


@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #A
@ObjectModel.usageType.sizeCategory: #XL

define view I_MaintenanceOrder
  as select from           afih
    left outer to one join aufk on aufk.aufnr = afih.aufnr
    left outer to one join afko on afko.aufnr = afih.aufnr
  association [0..1] to I_LogisticsOrder              as _Order                      on  _Order.OrderID = $projection.MaintenanceOrder // AUFK (Order master data) and AFKO (Order Header data )

  association [1..1] to I_OrderCategory               as _MaintenanceOrderCategory   on  $projection.MaintenanceOrderCategory = _MaintenanceOrderCategory.OrderCategory
  association [1..1] to I_OrderType                   as _MaintenanceOrderType       on  $projection.MaintenanceOrderType = _MaintenanceOrderType.OrderType
  association [0..1] to I_ControllingArea             as _ControllingArea            on  $projection.ControllingArea = _ControllingArea.ControllingArea
  association [0..1] to I_ControllingObjectClass      as _ControllingObjectClass     on  $projection.ControllingObjectClass = _ControllingObjectClass.ControllingObjectClass
  association [0..1] to I_CompanyCode                 as _CompanyCode                on  $projection.CompanyCode = _CompanyCode.CompanyCode
  association [0..*] to I_CostCenter                  as _ResponsibleCostCenter      on  $projection.ControllingArea       = _ResponsibleCostCenter.ControllingArea
                                                                                     and $projection.ResponsibleCostCenter = _ResponsibleCostCenter.CostCenter
  association [0..*] to I_ProfitCenter                as _ProfitCenter               on  $projection.ControllingArea = _ProfitCenter.ControllingArea
                                                                                     and $projection.ProfitCenter    = _ProfitCenter.ProfitCenter
  association [0..1] to I_Plant                       as _LocationPlant              on  $projection.MaintenancePlant = _LocationPlant.Plant
  association [0..1] to I_SchedulingType              as _BasicSchedulingType        on  $projection.BasicSchedulingType = _BasicSchedulingType.SchedulingType
  association [0..1] to I_MaintenanceTaskList         as _MaintenanceTaskList        on  $projection.TaskListType         = _MaintenanceTaskList.TaskListType
                                                                                     and $projection.TaskListGroup        = _MaintenanceTaskList.TaskListGroup
                                                                                     and $projection.TaskListGroupCounter = _MaintenanceTaskList.TaskListGroupCounter
  with default filter _MaintenanceTaskList.ValidityEndDate = '99991231'

  /* Order Refurbishment Item */
  association [0..1] to I_OrderItem                   as _OrderItem                  on  $projection.MaintenanceOrder = _OrderItem.OrderID
                                                                                     and _OrderItem.OrderItem         = '0001'
  association [0..*] to I_MaintenanceOrderOperation   as _MaintenanceOrderOperation  on  $projection.MaintOrderRoutingNumber = _MaintenanceOrderOperation.MaintOrderRoutingNumber
  association [0..*] to I_MaintenanceOrderCost        as _MaintenanceOrderCost       on  $projection.MaintenanceOrderInternalID = _MaintenanceOrderCost.MaintenanceOrderInternalID
  association [0..*] to I_MaintenanceOrderComponent_2 as _MaintenanceOrderComponent  on  $projection.MaintenanceOrder = _MaintenanceOrderComponent.MaintenanceOrder
  association [0..1] to I_LocationAccountAssignment   as _LocationAccountAssignment  on  $projection.MaintObjectLocAcctAssgmtNmbr = _LocationAccountAssignment.MaintObjectLocAcctAssgmtNmbr
  association [0..1] to I_MaintenanceNotification     as _MaintenanceNotification    on  $projection.MaintenanceNotification = _MaintenanceNotification.MaintenanceNotification
  association [0..1] to I_Equipment                   as _Equipment                  on  $projection.Equipment = _Equipment.Equipment
  association [0..1] to I_Material                    as _Assembly                   on  $projection.Assembly = _Assembly.Material
  association [0..1] to I_MaintenancePlanBasic        as _MaintenancePlan            on  $projection.MaintenancePlan = _MaintenancePlan.MaintenancePlan
  association [0..1] to I_MaintenanceItem             as _MaintenanceItem            on  $projection.MaintenanceItem = _MaintenanceItem.MaintenanceItem
  association [0..1] to I_MaintenanceCall             as _MaintenanceCall            on  $projection.MaintenancePlan = _MaintenanceCall.MaintenancePlan
                                                                                     and $projection.MaintenanceItem = _MaintenanceCall.MaintenanceItem
                                                                                     and $projection.MaintenanceCall = _MaintenanceCall.MaintenanceCall
  association [0..1] to I_MaintenanceOrder            as _LeadingOrder               on  $projection.LeadingOrder = _LeadingOrder.MaintenanceOrder
  association [0..1] to I_Plant                       as _MaintenancePlanningPlant   on  $projection.MaintenancePlanningPlant = _MaintenancePlanningPlant.Plant
  association [0..1] to I_PMNotificationPriorityType  as _MaintenancePriorityType    on  $projection.MaintPriorityType = _MaintenancePriorityType.MaintPriorityType
  association [0..1] to I_PMNotificationPriority      as _MaintenancePriority        on  $projection.MaintPriority     = _MaintenancePriority.MaintPriority
                                                                                     and $projection.MaintPriorityType = _MaintenancePriority.MaintPriorityType
  association [0..1] to I_WorkCenter                  as _MainWorkCenter             on  $projection.WorkCenterInternalID = _MainWorkCenter.WorkCenterInternalID
                                                                                     and $projection.WorkCenterTypeCode   = _MainWorkCenter.WorkCenterTypeCode
  association [1..1] to I_WorkCenterType              as _WorkCenterType             on  $projection.WorkCenterTypeCode = _WorkCenterType.WorkCenterTypeCode
  association [0..1] to I_MaintenanceActivityType     as _MaintenanceActivityType    on  $projection.MaintenanceActivityType = _MaintenanceActivityType.MaintenanceActivityType
  association [0..*] to I_PlantMaintenancePartner     as _MaintenancePartner         on  $projection.MaintenanceOrderInternalID = _MaintenancePartner.MaintObjectInternalID
  association [0..1] to I_BusinessArea                as _BusinessArea               on  $projection.BusinessArea = _BusinessArea.BusinessArea
  association [0..1] to I_FunctionalArea              as _FunctionalArea             on  $projection.FunctionalArea = _FunctionalArea.FunctionalArea
  association [0..1] to I_MaintenancePlannerGroup     as _MaintenancePlannerGroup    on  $projection.MaintenancePlannerGroup  = _MaintenancePlannerGroup.MaintenancePlannerGroup
                                                                                     and $projection.MaintenancePlanningPlant = _MaintenancePlannerGroup.MaintenancePlanningPlant
  association [0..1] to I_MaintenanceOrderPhase       as _MaintenanceOrderPhase      on  $projection.MaintenanceProcessingPhase = _MaintenanceOrderPhase.MaintenanceProcessingPhase
  association [0..1] to I_StatusObject                as _StatusObject               on  $projection.MaintenanceOrderInternalID = _StatusObject.StatusObject
  association [1..*] to I_StatusObjectStatus          as _StatusObjectStatus         on  $projection.MaintenanceOrderInternalID = _StatusObjectStatus.StatusObject
  association [0..1] to I_MaintOperationSystCondition as _OperationSystemCondition   on  $projection.OperationSystemCondition = _OperationSystemCondition.OperationSystemCondition
  association [0..1] to I_Indicator                   as _OrderHasLongText           on  $projection.OrderHasLongText = _OrderHasLongText.IndicatorValue
  association [0..1] to I_MaintOrdPlngDegreeCode      as _MaintOrdPlngDegreeCode     on  $projection.MaintenanceOrderPlanningCode = _MaintOrdPlngDegreeCode.MaintenanceOrderPlanningCode
  association [0..1] to I_MaintenanceRevision         as _MaintenanceRevision        on  $projection.MaintenancePlanningPlant = _MaintenanceRevision.MaintenancePlanningPlant
                                                                                     and $projection.MaintenanceRevision      = _MaintenanceRevision.MaintenanceRevision
  association [0..1] to I_MaintOrderTypeControlParam  as _MaintOrderTypeControlParam on  $projection.MaintenanceOrderType = _MaintOrderTypeControlParam.OrderType
  association [0..*] to I_StatusObjectActiveStatus    as _StatusObjectActiveStatus   on  $projection.MaintenanceOrderInternalID = _StatusObjectActiveStatus.StatusObject
  association [0..1] to I_User                        as _CreatedByUser              on  $projection.CreatedByUser = _CreatedByUser.UserID
  association [0..*] to I_MaintenanceItemObject       as _MaintenanceItemObject      on  $projection.MaintenanceItemObjectList = _MaintenanceItemObject.MaintenanceItemObjectList
  association [0..*] to I_MaintenanceOrderObjectList  as _MaintenanceOrderObjectList on  $projection.MaintenanceOrderObjectList = _MaintenanceOrderObjectList.MaintenanceOrderObjectList
  association [0..1] to I_OrderProcessingGroup        as _OrderProcessingGroup       on  $projection.ControllingArea      = _OrderProcessingGroup.ControllingArea
                                                                                     and $projection.OrderProcessingGroup = _OrderProcessingGroup.OrderProcessingGroup
  association [0..1] to I_WBSElementByInternalKey     as _WBSElement                 on  $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
  association [0..1] to I_ProjectByInternalKey        as _Project                    on  $projection.ProjectInternalID = _Project.ProjectInternalID
  association [0..*] to I_CostCenterText              as _ResponsibleCostCenterText  on  $projection.ControllingArea                  = _ResponsibleCostCenterText.ControllingArea
                                                                                     and $projection.ResponsibleCostCenter            = _ResponsibleCostCenterText.CostCenter
                                                                                     and _ResponsibleCostCenterText.ValidityStartDate <= $session.system_date
                                                                                     and _ResponsibleCostCenterText.ValidityEndDate   >= $session.system_date
  association [0..1] to I_PMContactCardEmployee       as _PMContactEmployee          on  $projection.PersonnelNumber = _PMContactEmployee.PersonnelNumber
  association [0..1] to I_PersonWorkAgreement_1       as _PersonWorkAgreement        on  $projection.PersonnelNumber = _PersonWorkAgreement.PersonWorkAgreement
  association [0..1] to I_MaintOrderHasOpenMainWork   as _MaintOrderHasOpenMainWork  on  $projection.MaintenanceOrder = _MaintOrderHasOpenMainWork.MaintenanceOrder
  association [0..1] to E_MaintenanceOrder            as _MaintenanceOrderExtension  on  $projection.MaintenanceOrder = _MaintenanceOrderExtension.MaintenanceOrder
  association [0..1] to I_MaintenancePlanPlant        as _MaintenancePlanPlant       on  $projection.MaintenancePlanningPlant = _MaintenancePlanPlant.MaintenancePlanningPlant
  association [0..1] to I_EAMProcessPhase             as _EAMProcessPhase            on  $projection.MaintOrdProcessPhaseCode = _EAMProcessPhase.EAMProcessPhaseCode
  association [0..1] to I_EAMProcessSubPhase          as _EAMProcessSubPhase         on  $projection.MaintOrdProcessSubPhaseCode = _EAMProcessSubPhase.EAMProcessSubPhaseCode
  association [0..1] to I_CtrlgObjectSettlementRule   as _CtrlgObjectSettlementRule  on  $projection.MaintenanceOrderInternalID = _CtrlgObjectSettlementRule.ControllingObject
  association [0..1] to I_CostingSheetProcedure       as _CostingSheetProcedure      on  $projection.ConditionUsage       = _CostingSheetProcedure.ConditionUsage
                                                                                     and $projection.ConditionApplication = _CostingSheetProcedure.ConditionApplication
                                                                                     and $projection.CostingSheet         = _CostingSheetProcedure.CostingSheetProcedure
  association [0..1] to I_InternalOrderOverheadCodeVH as _OverheadCode               on  $projection.MaintenanceOrderOverheadCode = _OverheadCode.OverheadCode
  association [1..1] to I_CostingVariant              as _PlannedCostingVariant      on  $projection.PlannedCostsCostingVariant = _PlannedCostingVariant.CostingVariant
  association [1..1] to I_CostingVariant              as _ActualCostingVariant       on  $projection.ActualCostsCostingVariant = _ActualCostingVariant.CostingVariant
  association [1..1] to I_BillableControl              as _BillableControl           on  $projection.AccountingIndicatorCode = _BillableControl.BillableControl
  association [0..1] to I_WrkPmtMaintOrderRelevance   as _WrkPmtMaintOrderRelevance  on  $projection.MaintenanceOrderInternalID = _WrkPmtMaintOrderRelevance.MaintenanceOrderInternalID 
{
      @ObjectModel.text.element:  [ 'MaintenanceOrderDesc' ]
  key afih.aufnr                                                         as MaintenanceOrder,

      @ObjectModel.foreignKey.association: '_MaintenancePriorityType'
      afih.artpr                                                         as MaintPriorityType,

      @ObjectModel.foreignKey.association: '_MaintenancePriority'
      afih.priok                                                         as MaintPriority,

      @ObjectModel.foreignKey.association: '_MaintenanceOrderPhase'
      afih.iphas                                                         as MaintenanceProcessingPhase,

      @ObjectModel.foreignKey.association: '_LocationAccountAssignment'
      afih.iloan                                                         as MaintObjectLocAcctAssgmtNmbr,

      //--[ GENERATED:012:GFBfhxvv7kY4nH9{xKJeWG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_MaintNotifStdVH',
                     element: 'MaintenanceNotification' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_MaintenanceNotification'
      afih.qmnum                                                         as MaintenanceNotification,

      //--[ GENERATED:012:GFBfhxvv7kY4nH9{xKJeWG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_EquipmentStdVH',
                     element: 'Equipment' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_Equipment'
      afih.equnr                                                         as Equipment,

      //--[ GENERATED:012:GFBfhxvv7kY4nH9{xKJeWG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_MaterialStdVH',
                     element: 'Material' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_Assembly'
      afih.bautl                                                         as Assembly,

      afih.serialnr                                                      as SerialNumber,

      @ObjectModel.foreignKey.association: '_MaintenancePlanPlant'
      afih.iwerk                                                         as MaintenancePlanningPlant,

      //--[ GENERATED:012:GFBfhxvv7kY4nH9{xKJeWG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_MaintPlnrGrpStdVH',
                     element: 'MaintenancePlannerGroup' },
          additionalBinding: [{ localElement: 'MaintenancePlanningPlant',
                                element: 'MaintenancePlanningPlant' }]
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_MaintenancePlannerGroup'
      afih.ingpr                                                         as MaintenancePlannerGroup,

      //--[ GENERATED:012:GFBfhxvv7kY4nH9{xKJeWG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_MaintenanceRevisionStdVH',
                     element: 'MaintenanceRevision' },
          additionalBinding: [{ localElement: 'MaintenancePlanningPlant',
                                element: 'MaintenancePlanningPlant' }]
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_MaintenanceRevision'
      afih.revnr                                                         as MaintenanceRevision,
      //--[ GENERATED:012:GFBfhxvv7kY4nH9{xKJeWG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_MaintenancePlanStdVH',
                     element: 'MaintenancePlan' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_MaintenancePlan'
      afih.warpl                                                         as MaintenancePlan,

      //--[ GENERATED:012:GFBfhxvv7kY4nH9{xKJeWG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_MaintenanceItemStdVH',
                     element: 'MaintenanceItem' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_MaintenanceItem'
      afih.wapos                                                         as MaintenanceItem,

      //--[ GENERATED:012:GFBfhxvv7kY4nH9{xKJeWG

      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_MaintActyTypeStdVH',
                     element: 'MaintenanceActivityType' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_MaintenanceActivityType'
      cast( afih.ilart as eam_maint_activity_type preserving type )      as MaintenanceActivityType,

      @ObjectModel.foreignKey.association: '_MainWorkCenter'
      afih.gewrk                                                         as WorkCenterInternalID,

      @ObjectModel.foreignKey.association: '_WorkCenterType'
      afih.pm_objty                                                      as WorkCenterTypeCode,

      afih.addat                                                         as MaintOrderReferenceDate,
      afih.aduhr                                                         as MaintOrderReferenceTime,

      afih.mainworkcompleteddatetime                                     as MainWorkCompletedDateTime,

      @ObjectModel.foreignKey.association: '_MaintOrdPlngDegreeCode'
      afih.plknz                                                         as MaintenanceOrderPlanningCode,

      @ObjectModel.foreignKey.association: '_OperationSystemCondition'
      afih.anlzu                                                         as OperationSystemCondition,

      afih.adpsp                                                         as ReferenceElement,

      afih.obknr                                                         as MaintenanceItemObjectList,

      cast(afih.obknr  as objknr)                                        as MaintenanceOrderObjectList,

      afih.aning                                                         as PersonnelNumber,
      /* Fields to be renamed from I_LogisticsOrder (AUFK, AFKO) */

      afih.maintordprocmtintegscenario                                   as MaintOrdProcmtIntegScenario,

      afih.sermat                                                        as Material,

      afko.aufpl                                                         as MaintOrderRoutingNumber,

      @ObjectModel.foreignKey.association: '_BusinessArea'
      aufk.gsber                                                         as BusinessArea,
      @ObjectModel.foreignKey.association: '_FunctionalArea'
      aufk.func_area                                                     as FunctionalArea,

      @ObjectModel.foreignKey.association: '_MaintenanceOrderType'
      aufk.auart                                                         as MaintenanceOrderType,

      @ObjectModel.foreignKey.association: '_MaintenanceOrderCategory'
      aufk.autyp                                                         as MaintenanceOrderCategory,

      @Semantics.text: true
      aufk.ktext                                                         as MaintenanceOrderDesc,

      @ObjectModel.foreignKey.association: '_ControllingArea'
      aufk.kokrs                                                         as ControllingArea,
      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_CompanyCodeStdVH', element: 'CompanyCode' } } ]
      @ObjectModel.foreignKey.association: '_CompanyCode'
      aufk.bukrs                                                         as CompanyCode,

      @ObjectModel.foreignKey.association: '_ResponsibleCostCenter'
      @ObjectModel.text.association: '_ResponsibleCostCenterText'
      cast(aufk.kostv as pph_kostl preserving type)                      as ResponsibleCostCenter,

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_ProfitCenterStdVH', element: 'ProfitCenter' } } ]
      @ObjectModel.foreignKey.association: '_ProfitCenter'
      aufk.prctr                                                         as ProfitCenter,

      @ObjectModel.foreignKey.association: '_ControllingObjectClass'
      cast(aufk.scope as pph_scope preserving type)                      as ControllingObjectClass,

      aufk.idat2                                                         as TechnicalCompletionDate,

      @ObjectModel.foreignKey.association: '_BasicSchedulingType'
      afko.terkz                                                         as BasicSchedulingType,

      afko.nauterm                                                       as OrdIsNotSchedldAutomatically,

      afko.gstrp                                                         as MaintOrdBasicStartDate,
      afko.gsuzp                                                         as MaintOrdBasicStartTime,

      afko.gltrp                                                         as MaintOrdBasicEndDate,
      afko.gluzp                                                         as MaintOrdBasicEndTime,

      afko.gstrs                                                         as ScheduledBasicStartDate,
      afko.gsuzs                                                         as ScheduledBasicStartTime,
      afko.gltrs                                                         as ScheduledBasicEndDate,
      afko.gluzs                                                         as ScheduledBasicEndTime,

      afih.maintordpersonresponsible                                     as MaintOrdPersonResponsible,

      aufk.objnr                                                         as MaintenanceOrderInternalID,

      cast(afko.plnnr as billofoperations           preserving type)     as TaskListGroup,
      cast(afko.plnty as billofoperationstype           preserving type) as TaskListType,
      cast(afko.plnal as billofoperationsvariant    preserving type)     as TaskListGroupCounter,

      @ObjectModel.foreignKey.association: '_LocationPlant'
      aufk.sowrk                                                         as MaintenancePlant,

      @Semantics.systemDate.createdAt: true
      aufk.erdat                                                         as CreationDate,
      @Semantics.systemTime.createdAt: true
      aufk.erfzeit                                                       as CreationTime,
      @Semantics.user.createdBy: true
      aufk.ernam                                                         as CreatedByUser,

      @ObjectModel.foreignKey.association: '_OrderHasLongText'
      cast( case when aufk.ltext = '' then ''
                 else 'X' end as pph_aufltxt preserving type)            as OrderHasLongText,

      @Semantics.user.lastChangedBy: true
      aufk.aenam                                                         as LastChangeByUser,
      @ObjectModel.readOnly: true
      afih.changeddatetime                                               as LastChangeDateTime,

      afih.deviceid                                                      as AdditionalDeviceData,

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_WBSElmntByIntKeyStdVH', element: 'WBSElementInternalID' } } ]
      @ObjectModel.foreignKey.association: '_WBSElement'
      cast( aufk.pspel as vdm_wbs_element_internal preserving type )     as WBSElementInternalID,
      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_ProjectByInternalKeyStdVH', element: 'ProjectInternalID' } } ]
      @ObjectModel.foreignKey.association: '_Project'
      afko.pronr                                                         as ProjectInternalID,
      @ObjectModel.foreignKey.association: '_OrderProcessingGroup'
      aufk.abkrs                                                         as OrderProcessingGroup,
      afko.aufnt                                                         as SuperiorProjectNetwork,
      aufk.vaplz                                                         as MainWorkCenter,
      aufk.wawrk                                                         as MainWorkCenterPlant,
      aufk.kalsm                                                         as CostingSheet,
      aufk.waers                                                         as Currency,

      cast(afih.lacd_date as vdm_lacd_date preserving type )             as LatestAcceptableCompletionDate,

      @ObjectModel.foreignKey.association: '_EAMProcessPhase'
      afih.maintordovrlprocphase                                         as MaintOrdProcessPhaseCode,
      @ObjectModel.foreignKey.association: '_EAMProcessSubPhase'
      afih.maintordovrlprocsubphase                                      as MaintOrdProcessSubPhaseCode,

      afih.maintorderprocessingcontext                                   as MaintOrderProcessingContext,
      afih.service_doc_type                                              as ServiceDocumentType,
      afih.service_doc_id                                                as ServiceDocument,
      afih.service_doc_item_id                                           as ServiceDocumentItem,
      /* Control Parameters*/
      aufk.kvewe                                                         as ConditionUsage,
      aufk.kappl                                                         as ConditionApplication,
      aufk.zschl                                                         as MaintenanceOrderOverheadCode,
      afko.klvarp                                                        as PlannedCostsCostingVariant,
      afko.klvari                                                        as ActualCostsCostingVariant,
      /* maintenance plan */
      afih.abnum                                                         as MaintenanceCall,
      afih.laufn                                                         as LeadingOrder,
      afih.old_lacd_date                                                 as PrevLtstAccptblCompletionDate,
      aufk.rsord                                                         as OrderIsRefurbishmentOrder,
      aufk.bemot                                                         as AccountingIndicatorCode,
      
      _Order,
      _MaintenanceOrderCategory,
      _MaintenanceOrderType,
      _ControllingArea,
      _ResponsibleCostCenter,
      _LocationPlant,
      _BasicSchedulingType,
      _LocationAccountAssignment,
      _MaintenanceNotification,
      _Equipment,
      _CompanyCode,
      _MaintenancePlan,
      _MaintenanceItem,
      _MaintenanceCall,
      _LeadingOrder,
      _OrderItem,
      _MaintenanceTaskList,
      _MaintenancePriorityType,
      _MaintenancePriority,
      _MaintenanceOrderPhase,
      _StatusObject,
      _MaintenanceOrderOperation,
      _MaintenanceOrderComponent,
      _MainWorkCenter,
      _BusinessArea,
      _FunctionalArea,
      _MaintenancePartner,
      _MaintenanceActivityType,
      _MaintenancePlannerGroup,
      _StatusObjectStatus,
      _MaintenancePlanningPlant,
      _Assembly,
      _OperationSystemCondition,
      _MaintenanceOrderCost,
      _WorkCenterType,
      _OrderHasLongText,
      _MaintOrdPlngDegreeCode,
      _MaintenanceRevision,
      _MaintOrderTypeControlParam,
      _StatusObjectActiveStatus,
      _CreatedByUser,
      _MaintenanceItemObject,
      _ResponsibleCostCenterText,
      _ProfitCenter,
      _ControllingObjectClass,
      _OrderProcessingGroup,
      _WBSElement,
      _Project,
      _PMContactEmployee,
      _PersonWorkAgreement,
      _MaintOrderHasOpenMainWork,
      _MaintenancePlanPlant,
      _MaintenanceOrderObjectList,
      _EAMProcessPhase,
      _EAMProcessSubPhase,
      _CtrlgObjectSettlementRule,
      _CostingSheetProcedure,
      _OverheadCode,
      _PlannedCostingVariant,
      _ActualCostingVariant,
      _BillableControl,
      _WrkPmtMaintOrderRelevance
}