R_MaintenanceOrderOperationTP

DDL: R_MAINTENANCEORDEROPERATIONTP Type: view_entity COMPOSITE

Maintenance Order Operation TP

R_MaintenanceOrderOperationTP is a Composite CDS View that provides data about "Maintenance Order Operation TP" in SAP S/4HANA. It reads from 1 data source (I_MaintOrderOperAndSubOper) and exposes 152 fields with key fields MaintenanceOrder, MaintenanceOrderOperation, MaintenanceOrderSubOperation. It has 29 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_MaintOrderOperAndSubOper I_MaintOrderOperAndSubOper from

Associations (29)

CardinalityTargetAliasCondition
[0..1] I_WorkCenter _OperationWorkCenter _OperationWorkCenter.WorkCenterInternalID = $projection.OperationWorkCenterInternalID and _OperationWorkCenter.WorkCenterTypeCode = $projection.OperationWorkCenterTypeCode
[0..1] I_WBSElementBasicData _WBSElement _WBSElement.WBSElementInternalID = $projection.MaintOrdOpAssgdWBSElmntInt
[0..*] I_CostCenterActivityTypeText _CostCenterActivityTypeText $projection.ControllingArea = _CostCenterActivityTypeText.ControllingArea and $projection.ActivityType = _CostCenterActivityTypeText.CostCtrActivityType and _CostCenterActivityTypeText.ValidityStartDate <= $session.system_date and _CostCenterActivityTypeText.ValidityEndDate = '99991231'
[0..*] I_MaintenanceActivityTypeText _MaintenanceActivityTypeText $projection.maintenanceactivitytype = _MaintenanceActivityTypeText.MaintenanceActivityType
[0..1] I_MaintOrderOperObjectListLink _MaintOrderOpObjectListLink $projection.MaintenanceOrderRoutingNode = _MaintOrderOpObjectListLink.MaintOrderOperationCounter and $projection.MaintOrderRoutingNumber = _MaintOrderOpObjectListLink.MaintOrderRoutingNumber -- Extensions, do not expose as association:
[0..1] E_MaintenanceOrderOperation _MaintOrderOperExtension _MaintOrderOperExtension.MaintOrderRoutingNumber = $projection.MaintOrderRoutingNumber and _MaintOrderOperExtension.MaintOrderOperationCounter = $projection.MaintenanceOrderRoutingNode
[0..*] I_MaterialGroupText _MaterialGroupText $projection.MaterialGroup = _MaterialGroupText.MaterialGroup
[0..1] I_CostElement _CostElement $projection.ControllingArea = _CostElement.ControllingArea and $projection.CostElement = _CostElement.CostElement
[0..1] I_MaintenanceNotification _MaintenanceNotification _MaintenanceNotification.MaintenanceNotification = $projection.maintenancenotification
[0..*] I_OperationControlProfileText _OperationControlProfileText _OperationControlProfileText.OperationControlProfile = $projection.OperationControlKey
[0..*] I_MaintOpExecStageCodeText _MaintOpExecStageCodeText _MaintOpExecStageCodeText.MaintOperationExecStageCode = $projection.MaintOperationExecStageCode
[0..*] I_MaterialText _AssemblyText _AssemblyText.Material = $projection.Assembly
[0..*] I_EquipmentText _EquipmentText _EquipmentText.Equipment = $projection.Equipment
[0..1] I_FunctionalLocationLabel _FunctionalLocationLabel _FunctionalLocationLabel.FunctionalLocation = $projection.FunctionalLocation
[0..*] I_FunctionalLocationText _FunctionalLocationText _FunctionalLocationText.FunctionalLocation = $projection.FunctionalLocation
[0..*] I_MaintOperationSystConditionT _MaintOpSystemConditionText _MaintOpSystemConditionText.OperationSystemCondition = $projection.OperationSystemCondition
[0..*] I_WorkCenterText _WorkCenterText _WorkCenterText.WorkCenterTypeCode = $projection.OperationWorkCenterTypeCode and _WorkCenterText.WorkCenterInternalID = $projection.OperationWorkCenterInternalID
[0..*] I_OperationCalcControlText _OperationCalcControlText _OperationCalcControlText.OperationCalculationControl = $projection.OperationCalculationControl
[0..*] I_EAMProcessPhaseText _EAMProcessPhaseText _EAMProcessPhaseText.EAMProcessPhaseCode = $projection.MaintOrdOpProcessPhaseCode
[0..*] I_EAMProcessSubPhaseText _EAMProcessSubPhaseText _EAMProcessSubPhaseText.EAMProcessSubPhaseCode = $projection.MaintOrdOpProcessSubPhaseCode
[0..*] I_PurReqnOrResvnGenerationText _PurReqnOrResvnGenerationText _PurReqnOrResvnGenerationText.PurReqnOrResvnGeneration = $projection.MaintOrdOperationIsMRPRelevant
[0..*] I_MaintOrdOpDeliveryDateAdjmtT _MaintOrdOpDeliveryDateAdjmtT _MaintOrdOpDeliveryDateAdjmtT.MaintOrdOpDelivDateAdjustment = $projection.MaintOrdOpDelivDateAdjustment
[0..*] R_MaintOrderOpRelationshipTP _MaintOrderOpRelationship
[0..*] R_MaintOrderOpComponentTP _MaintOrderOpComponent
[0..*] R_MaintOrderOpComponentTP_2 _MaintOrderOpComponent_2
[0..*] R_MaintOrderOpLongTextTP _MaintOrderOpLongText
[0..*] R_MaintOrderOpPhaseControlTP _MaintOrderOpPhaseControl
[0..*] R_MaintOrderOpProdnRsceToolTP _MaintOrderOpProdnRsceTool
[0..*] R_MaintOrderOpRqmtAssgmtTP _MaintOrderOpRqmtAssgmt

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
EndUserText.label Maintenance Order Operation TP view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (152)

KeyFieldSource TableSource FieldDescription
KEY MaintenanceOrder MaintenanceOrder
KEY MaintenanceOrderOperation
KEY MaintenanceOrderSubOperation
MaintOrderOperationForEdit
MaintOrderSubOperationForEdit
MaintOrderRoutingNumber MaintOrderRoutingNumber
MaintenanceOrderRoutingNode MaintOrderOperationCounter
SuperiorOperationInternalID SuperiorOperationInternalID
OperationControlKey OperationControlKey
OperationDescription OperationDescription
OperationWorkCenterInternalID OperationWorkCenterInternalID
WorkCenter _OperationWorkCenter WorkCenter
OperationWorkCenterTypeCode OperationWorkCenterTypeCode
Plant Plant
OperationStandardTextCode OperationStandardTextCode
Language Language
NumberOfTimeTickets NumberOfTimeTickets
OperationPurgInfoRecdSearchTxt OperationPurgInfoRecdSearchTxt
OperationSupplier OperationSupplier
OpExternalProcessingPrice OpExternalProcessingPrice
OpExternalProcessingPriceUnit OpExternalProcessingPriceUnit
CostElement CostElement
OpExternalProcessingCurrency OpExternalProcessingCurrency
OperationPurchasingInfoRecord OperationPurchasingInfoRecord
PurchasingOrganization PurchasingOrganization
PurchasingGroup PurchasingGroup
MaterialGroup MaterialGroup
OpPurchaseOutlineAgreement OpPurchaseOutlineAgreement
OpPurchaseOutlineAgreementItem OpPurchaseOutlineAgreementItem
OperationRequisitionerName OperationRequisitionerName
OperationTrackingNumber OperationTrackingNumber
NumberOfCapacities NumberOfCapacities
OperationWorkPercent OperationWorkPercent
OperationCalculationControl OperationCalculationControl
ActivityType CostCtrActivityType
OperationSystemCondition OperationSystemCondition
OperationGoodsRecipientName OperationGoodsRecipientName
OperationUnloadingPointName OperationUnloadingPointName
OperationPersonResponsible OperationPersonResponsible
EAMPlannedDeliveryDurnInDays EAMPlannedDeliveryDurnInDays
MaintOrderOperationDuration MaintOrderOperationDuration
MaintOrdOperationDurationUnit MaintOrdOperationDurationUnit
OpBscStartDateConstraintType OpBscStartDateConstraintType
OpBscEndDateConstraintType OpBscEndDateConstraintType
MaintOrdOperationWorkDuration MaintOrdOperationWorkDuration
MaintOrdOpWorkDurationUnit MaintOrdOpWorkDurationUnit
MaintOrdOperationExecutionRate MaintOrdOperationExecutionRate
Equipment Equipment
FunctionalLocation FunctionalLocation
clientNULLendasOpErlstSchedldExecStrtDte
clientNULLendasOpErlstSchedldExecStrtTme
clientNULLendasOpErlstSchedldExecEndDte
clientNULLendasOpErlstSchedldExecEndTme
clientNULLendasOpLtstSchedldExecStrtDte
clientNULLendasOpLtstSchedldExecStrtTme
clientNULLendasOpLtstSchedldExecEndDte
clientNULLendasOpLtstSchedldExecEndTme
clientNULLendasOpActualExecutionEndDate
clientNULLendasOpActualExecutionEndTime
clientNULLendasActyConfFcstdEndDate
clientNULLendasActyConfFcstdEndTime
ActualWorkQuantity ActualWorkQuantity
MaintenanceActivityType _MaintOrdOpAdditionalData MaintenanceActivityType
BusinessArea BusinessArea
ProfitCenter ProfitCenter
CostingSheet CostingSheet
TaxJurisdiction TaxJurisdiction
FunctionalArea FunctionalArea
MaintOrdOperationIsMRPRelevant MaintOrdOperationIsMRPRelevant
MaintControllingObjectClass MaintControllingObjectClass
WrkCtrIntCapRqmtsDistr WrkCtrIntCapRqmtsDistr
MaintOrdOperationOverheadCode MaintOrdOperationOverheadCode
MaintOrderOperationQuantity MaintOrderOperationQuantity
MaintOrdOperationQuantityUnit MaintOrdOperationQuantityUnit
Assembly Assembly
MaintOperationExecStageCode MaintOperationExecStageCode
MaintOrdOpAssgdWBSElmntInt MaintOrdOpAssgdWBSElmntInt
WBSElement
IsMarkedForDeletion IsMarkedForDeletion
MaintOrderOperationInternalID MaintOrderOperationInternalID
MaintenanceObjectListItem _MaintOrderOperObjectListLink MaintenanceObjectListItem
PurchaseRequisition PurchaseRequisition
PurchaseRequisitionItem PurchaseRequisitionItem
MaintOrdOpProcessPhaseCode MaintOrdOpProcessPhaseCode
MaintOrdOpProcessSubPhaseCode MaintOrdOpProcessSubPhaseCode
AllMaintOrdCompCmtdQtsAreKept AllMaintOrdCompCmtdQtsAreKept
ControllingArea _MaintenanceOrder ControllingArea
MaintOrderConfirmation MaintOrderConfirmation
MaintOrderConfCntrValue MaintOrderConfCntrValue
MaintOrdOpHasNoRemainingWork MaintOrdOpHasNoRemainingWork
MaintOrdOpHasLeanServices MaintOrdOpHasLeanServices
MaintenanceNotification
ExtProcgOperationHasSubcontrg ExtProcgOperationHasSubcontrg
MaintOrdOpDelivDateAdjustment MaintOrdOpDelivDateAdjustment
TaskListType TaskListType
TaskListGroup TaskListGroup
TaskListGroupCounter TaskListGroupCounter
TaskListSequence TaskListSequence
TaskListOperationInternalId TaskListOperationInternalId
MaintOperationalChecklistType MaintOperationalChecklistType
_MaintOrderOpRelationship _MaintOrderOpRelationship
_MaintOrderOpComponent _MaintOrderOpComponent
_MaintOrderOpComponent_2 _MaintOrderOpComponent_2
_MaintOrderOpRqmtAssgmt _MaintOrderOpRqmtAssgmt
_MaintenanceOrder _MaintenanceOrder
_OpExternalProcessingCurrency _OpExternalProcessingCurrency
_OperationPlanningValues _OperationPlanningValues
_OperationControlKey _OperationControlKey
_OperationSystemCondition _OperationSystemCondition
_Plant _Plant
_OperationCalculationControl _OperationCalculationControl
_Assembly _Assembly
_Language _Language
_Supplier _Supplier
_PersonResponsible _PersonResponsible
_FunctionalLocation _FunctionalLocation
_Equipment _Equipment
_MaintOrderProdnRsceTool _MaintOrderProdnRsceTool
_PMContactEmployee _PMContactEmployee
_MaintOperationExecStageCode _MaintOperationExecStageCode
_OperationWorkCenter _OperationWorkCenter
_StatusObjectActiveStatus _StatusObjectActiveStatus
_MaintOrderOpLongText _MaintOrderOpLongText
_MaintOrderOpPhaseControl _MaintOrderOpPhaseControl
_MaintOrderOpProdnRsceTool _MaintOrderOpProdnRsceTool
_MaintenanceActivityTypeText _MaintenanceActivityTypeText
_CostCenterActivityTypeText _CostCenterActivityTypeText
_PersonWorkAgreement _PersonWorkAgreement
_WorkAssignment _WorkAssignment
_MaintOrderOpObjectListLink _MaintOrderOpObjectListLink
_EAMProcessPhase _EAMProcessPhase
_EAMProcessSubPhase _EAMProcessSubPhase
_MaintenanceNotification _MaintenanceNotification
_MaterialGroupText _MaterialGroupText
_PurchasingOrganization _PurchasingOrganization
_PurchasingGroup _PurchasingGroup
_PurReqnOrResvnGeneration _PurReqnOrResvnGeneration
_CostElement _CostElement
_MaintOrdOpDeliveryDateAdjmt _MaintOrdOpDeliveryDateAdjmt
_OperationControlProfileText _OperationControlProfileText
_MaintOpExecStageCodeText _MaintOpExecStageCodeText
_AssemblyText _AssemblyText
_EquipmentText _EquipmentText
_FunctionalLocationLabel _FunctionalLocationLabel
_FunctionalLocationText _FunctionalLocationText
_MaintOpSystemConditionText _MaintOpSystemConditionText
_WorkCenterText _WorkCenterText
_OperationCalcControlText _OperationCalcControlText
_EAMProcessPhaseText _EAMProcessPhaseText
_EAMProcessSubPhaseText _EAMProcessSubPhaseText
_PurReqnOrResvnGenerationText _PurReqnOrResvnGenerationText
_MaintOrdOpDeliveryDateAdjmtT _MaintOrdOpDeliveryDateAdjmtT
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Maintenance Order Operation TP'
@VDM.viewType: #COMPOSITE
@VDM.usage.type: [#TRANSACTIONAL_PROCESSING_SERVICE]
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #L, dataClass: #TRANSACTIONAL}

define view entity R_MaintenanceOrderOperationTP
  as select from I_MaintOrderOperAndSubOper
  association        to parent R_MaintenanceOrderTP    as _MaintenanceOrder            on  $projection.MaintenanceOrder = _MaintenanceOrder.MaintenanceOrder

  composition [0..*] of R_MaintOrderOpRelationshipTP   as _MaintOrderOpRelationship
  composition [0..*] of R_MaintOrderOpComponentTP      as _MaintOrderOpComponent
  composition [0..*] of R_MaintOrderOpComponentTP_2    as _MaintOrderOpComponent_2
  composition [0..*] of R_MaintOrderOpLongTextTP       as _MaintOrderOpLongText
  composition [0..*] of R_MaintOrderOpPhaseControlTP   as _MaintOrderOpPhaseControl
  composition [0..*] of R_MaintOrderOpProdnRsceToolTP  as _MaintOrderOpProdnRsceTool
  composition [0..*] of R_MaintOrderOpRqmtAssgmtTP     as _MaintOrderOpRqmtAssgmt

  association [0..1] to I_WorkCenter                   as _OperationWorkCenter         on  _OperationWorkCenter.WorkCenterInternalID = $projection.OperationWorkCenterInternalID
                                                                                       and _OperationWorkCenter.WorkCenterTypeCode   = $projection.OperationWorkCenterTypeCode

  association [0..1] to I_WBSElementBasicData          as _WBSElement                  on  _WBSElement.WBSElementInternalID = $projection.MaintOrdOpAssgdWBSElmntInt

  association [0..*] to I_CostCenterActivityTypeText   as _CostCenterActivityTypeText  on  $projection.ControllingArea                   = _CostCenterActivityTypeText.ControllingArea
                                                                                       and $projection.ActivityType                      = _CostCenterActivityTypeText.CostCtrActivityType
                                                                                       and _CostCenterActivityTypeText.ValidityStartDate <= $session.system_date
                                                                                       and _CostCenterActivityTypeText.ValidityEndDate   = '99991231'

  association [0..*] to I_MaintenanceActivityTypeText  as _MaintenanceActivityTypeText on  $projection.maintenanceactivitytype = _MaintenanceActivityTypeText.MaintenanceActivityType

  association [0..1] to I_MaintOrderOperObjectListLink as _MaintOrderOpObjectListLink  on  $projection.MaintenanceOrderRoutingNode = _MaintOrderOpObjectListLink.MaintOrderOperationCounter
                                                                                       and $projection.MaintOrderRoutingNumber     = _MaintOrderOpObjectListLink.MaintOrderRoutingNumber

  -- Extensions, do not expose as association:
  association [0..1] to E_MaintenanceOrderOperation    as _MaintOrderOperExtension     on  _MaintOrderOperExtension.MaintOrderRoutingNumber    = $projection.MaintOrderRoutingNumber
                                                                                       and _MaintOrderOperExtension.MaintOrderOperationCounter = $projection.MaintenanceOrderRoutingNode

  association [0..*] to I_MaterialGroupText            as _MaterialGroupText           on  $projection.MaterialGroup = _MaterialGroupText.MaterialGroup
  
  association [0..1] to I_CostElement                  as _CostElement                 on  $projection.ControllingArea = _CostElement.ControllingArea
                                                                                       and $projection.CostElement     = _CostElement.CostElement
  
  association [0..1] to I_MaintenanceNotification      as _MaintenanceNotification     on _MaintenanceNotification.MaintenanceNotification = $projection.maintenancenotification
  
  association [0..*] to I_OperationControlProfileText  as _OperationControlProfileText on _OperationControlProfileText.OperationControlProfile = $projection.OperationControlKey
  
  association [0..*] to I_MaintOpExecStageCodeText     as _MaintOpExecStageCodeText    on _MaintOpExecStageCodeText.MaintOperationExecStageCode = $projection.MaintOperationExecStageCode
  
  association [0..*] to I_MaterialText                 as _AssemblyText                on _AssemblyText.Material = $projection.Assembly
  
  association [0..*] to I_EquipmentText                as _EquipmentText               on _EquipmentText.Equipment = $projection.Equipment
  
  association [0..1] to I_FunctionalLocationLabel      as _FunctionalLocationLabel     on _FunctionalLocationLabel.FunctionalLocation = $projection.FunctionalLocation
  
  association [0..*] to I_FunctionalLocationText       as _FunctionalLocationText      on _FunctionalLocationText.FunctionalLocation = $projection.FunctionalLocation
  
  association [0..*] to I_MaintOperationSystConditionT as _MaintOpSystemConditionText  on _MaintOpSystemConditionText.OperationSystemCondition = $projection.OperationSystemCondition
  
  association [0..*] to I_WorkCenterText               as _WorkCenterText              on  _WorkCenterText.WorkCenterTypeCode   = $projection.OperationWorkCenterTypeCode
                                                                                       and _WorkCenterText.WorkCenterInternalID = $projection.OperationWorkCenterInternalID

  association [0..*] to I_OperationCalcControlText     as _OperationCalcControlText    on _OperationCalcControlText.OperationCalculationControl = $projection.OperationCalculationControl
  
  association [0..*] to I_EAMProcessPhaseText          as _EAMProcessPhaseText         on _EAMProcessPhaseText.EAMProcessPhaseCode = $projection.MaintOrdOpProcessPhaseCode 

  association [0..*] to I_EAMProcessSubPhaseText       as _EAMProcessSubPhaseText      on _EAMProcessSubPhaseText.EAMProcessSubPhaseCode = $projection.MaintOrdOpProcessSubPhaseCode
  
  association [0..*] to I_PurReqnOrResvnGenerationText as _PurReqnOrResvnGenerationText on _PurReqnOrResvnGenerationText.PurReqnOrResvnGeneration  = $projection.MaintOrdOperationIsMRPRelevant 
 
  association [0..*] to I_MaintOrdOpDeliveryDateAdjmtT as _MaintOrdOpDeliveryDateAdjmtT on _MaintOrdOpDeliveryDateAdjmtT.MaintOrdOpDelivDateAdjustment    = $projection.MaintOrdOpDelivDateAdjustment

{
  key MaintenanceOrder,
  key cast( MaintenanceOrderOperation    as maintenanceorderoperation preserving type )    as MaintenanceOrderOperation,
  key cast( MaintenanceOrderSubOperation as maintenanceordersuboperation preserving type ) as MaintenanceOrderSubOperation,

      @ObjectModel.editableFieldFor: 'MaintenanceOrderOperation'
      cast( MaintenanceOrderOperation as maintenanceorderoperation preserving type )       as MaintOrderOperationForEdit,
      @ObjectModel.editableFieldFor: 'MaintenanceOrderSubOperation'
      cast( MaintenanceOrderSubOperation as maintenanceordersuboperation preserving type ) as MaintOrderSubOperationForEdit,

      MaintOrderRoutingNumber,
      MaintOrderOperationCounter                                                           as MaintenanceOrderRoutingNode,
      SuperiorOperationInternalID,

      OperationControlKey,
      OperationDescription,
      OperationWorkCenterInternalID,
      _OperationWorkCenter.WorkCenter,
      OperationWorkCenterTypeCode,

      Plant,
      OperationStandardTextCode,
      Language,
      NumberOfTimeTickets,
      OperationPurgInfoRecdSearchTxt,
      OperationSupplier,
      OpExternalProcessingPrice,
      OpExternalProcessingPriceUnit,
      CostElement,
      OpExternalProcessingCurrency,
      OperationPurchasingInfoRecord,
      PurchasingOrganization,
      PurchasingGroup,
      MaterialGroup,
      OpPurchaseOutlineAgreement,
      OpPurchaseOutlineAgreementItem,
      OperationRequisitionerName,
      OperationTrackingNumber,
      NumberOfCapacities,
      OperationWorkPercent,
      OperationCalculationControl,
      CostCtrActivityType                                                                  as ActivityType,
      OperationSystemCondition,
      OperationGoodsRecipientName,
      OperationUnloadingPointName,
      OperationPersonResponsible,
      EAMPlannedDeliveryDurnInDays,
      MaintOrderOperationDuration,
      MaintOrdOperationDurationUnit,
      OpBscStartDateConstraintType,
      OpBscEndDateConstraintType,
      MaintOrdOperationWorkDuration,
      MaintOrdOpWorkDurationUnit,
      //      Constraint Basic Start Time Date


      case when ConstraintTimeForBscStartTime = '240000' and ConstraintDateForBscStartDate is not initial
      then cast(dats_tims_to_tstmp( dats_add_days( ConstraintDateForBscStartDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client, 'NULL') as timestamp preserving type)
      else cast(dats_tims_to_tstmp( ConstraintDateForBscStartDate, ConstraintTimeForBscStartTime,
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client,'NULL') as timestamp preserving type)
      end                                                                                  as MaintOrdOpConstraintStrtDteTme,
      case when ConstraintTimeForBscStartTime = '240000' and ConstraintDateForBscStartDate is not initial
      then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( ConstraintDateForBscStartDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_dats( dats_tims_to_tstmp(ConstraintDateForBscStartDate, ConstraintTimeForBscStartTime,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as ConstraintDateForBscStartDate,

      case when ConstraintTimeForBscStartTime = '240000' and ConstraintDateForBscStartDate is not initial
      then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( ConstraintDateForBscStartDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_tims( dats_tims_to_tstmp(ConstraintDateForBscStartDate, ConstraintTimeForBscStartTime,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as ConstraintTimeForBscStartTime,

      //      Constraint Basic Finisch Time Date

      case when ConstraintTimeForBscFinishTime = '240000' and ConstraintDateForBscFinishDate is not initial
          then cast(dats_tims_to_tstmp( dats_add_days( ConstraintDateForBscFinishDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                                        abap_system_timezone( $session.client,'NULL' ),
                                        $session.client, 'NULL') as timestamp preserving type)
          else cast(dats_tims_to_tstmp( ConstraintDateForBscFinishDate,   ConstraintTimeForBscFinishTime,
                                        abap_system_timezone( $session.client,'NULL' ),
                                        $session.client, 'NULL') as timestamp preserving type)
          end                                                                              as MaintOrdOpCstrtFinishDteTme,
      case when ConstraintTimeForBscFinishTime = '240000' and ConstraintDateForBscFinishDate is not initial
      then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( ConstraintDateForBscFinishDate, 1, 'NULL'), cast( '000000' as abap.tims ),
              abap_system_timezone( $session.client,'NULL' ),
              $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_dats( dats_tims_to_tstmp(ConstraintDateForBscFinishDate, ConstraintTimeForBscFinishTime,
              abap_system_timezone( $session.client,'NULL' ),
              $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as ConstraintDateForBscFinishDate,
      case when ConstraintTimeForBscFinishTime = '240000' and  ConstraintDateForBscFinishDate is not initial
      then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( ConstraintDateForBscFinishDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_tims( dats_tims_to_tstmp(ConstraintDateForBscFinishDate, ConstraintTimeForBscFinishTime,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as ConstraintTimeForBscFinishTime,

      MaintOrdOperationExecutionRate,
      Equipment,
      FunctionalLocation,

      //      Earliest Start Date Time

      case when OpErlstSchedldExecStrtTme = '240000' and OpErlstSchedldExecStrtDte is not initial
      then cast(dats_tims_to_tstmp( dats_add_days( OpErlstSchedldExecStrtDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client, 'NULL') as timestamp preserving type)
      else cast(dats_tims_to_tstmp( OpErlstSchedldExecStrtDte, OpErlstSchedldExecStrtTme,
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client,'NULL') as timestamp preserving type)
      end                                                                                  as OpErlstSchedldExecStrtDteTme,

      case when OpErlstSchedldExecStrtTme  = '240000' and OpErlstSchedldExecStrtDte is not initial
      then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpErlstSchedldExecStrtDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_dats( dats_tims_to_tstmp(OpErlstSchedldExecStrtDte, OpErlstSchedldExecStrtTme,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpErlstSchedldExecStrtDte,

      case when OpErlstSchedldExecStrtTme = '240000' and OpErlstSchedldExecStrtDte is not initial
      then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpErlstSchedldExecStrtDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_tims( dats_tims_to_tstmp(OpErlstSchedldExecStrtDte, OpErlstSchedldExecStrtTme,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpErlstSchedldExecStrtTme,

      //      Earliest Finish Date Time

      case when OpErlstSchedldExecEndTme  = '240000' and OpErlstSchedldExecEndDte is not initial
      then cast(dats_tims_to_tstmp( dats_add_days( OpErlstSchedldExecEndDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client, 'NULL') as timestamp preserving type)
      else cast(dats_tims_to_tstmp( OpErlstSchedldExecEndDte, OpErlstSchedldExecEndTme,
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client,'NULL') as timestamp preserving type)
      end                                                                                  as OpErlstSchedldExecEndDteTme,

      case  when OpErlstSchedldExecEndTme = '240000' and OpErlstSchedldExecEndDte is not initial
      then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpErlstSchedldExecEndDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_dats( dats_tims_to_tstmp(OpErlstSchedldExecEndDte, OpErlstSchedldExecEndTme,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpErlstSchedldExecEndDte,

      case when OpErlstSchedldExecEndTme  = '240000' and OpErlstSchedldExecEndDte is not initial
      then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpErlstSchedldExecEndDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_tims( dats_tims_to_tstmp(OpErlstSchedldExecEndDte, OpErlstSchedldExecEndTme,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpErlstSchedldExecEndTme,

      //      Latest Start Date Time

      case when OpLtstSchedldExecStrtTme  = '240000' and OpLtstSchedldExecStrtDte is not initial
      then cast(dats_tims_to_tstmp( dats_add_days( OpLtstSchedldExecStrtDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client, 'NULL') as timestamp preserving type)
      else cast(dats_tims_to_tstmp( OpLtstSchedldExecStrtDte, OpLtstSchedldExecStrtTme,
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client,'NULL') as timestamp preserving type)
      end                                                                                  as OpLtstSchedldExecStrtDteTme,

      case when OpLtstSchedldExecStrtTme = '240000' and OpLtstSchedldExecStrtDte is not initial
      then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpLtstSchedldExecStrtDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_dats( dats_tims_to_tstmp(OpLtstSchedldExecStrtDte, OpLtstSchedldExecStrtTme,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpLtstSchedldExecStrtDte,

      case when OpLtstSchedldExecStrtTme  = '240000' and OpLtstSchedldExecStrtDte is not initial
      then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpLtstSchedldExecStrtDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_tims( dats_tims_to_tstmp(OpLtstSchedldExecStrtDte, OpLtstSchedldExecStrtTme,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpLtstSchedldExecStrtTme,

      //      Latest Finish Date Time

      case when OpLtstSchedldExecEndTme = '240000' and OpLtstSchedldExecEndDte is not initial
      then cast(dats_tims_to_tstmp( dats_add_days( OpLtstSchedldExecEndDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client, 'NULL') as timestamp preserving type)
      else cast(dats_tims_to_tstmp( OpLtstSchedldExecEndDte, OpLtstSchedldExecEndTme,
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client,'NULL') as timestamp preserving type)
      end                                                                                  as OpLtstSchedldExecEndDteTme,

      case when OpLtstSchedldExecEndTme = '240000' and OpLtstSchedldExecEndDte is not initial
      then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpLtstSchedldExecEndDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_dats( dats_tims_to_tstmp(OpLtstSchedldExecEndDte, OpLtstSchedldExecEndTme,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpLtstSchedldExecEndDte,

      case when OpLtstSchedldExecEndTme  = '240000' and OpLtstSchedldExecEndDte is not initial
      then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpLtstSchedldExecEndDte, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_tims( dats_tims_to_tstmp(OpLtstSchedldExecEndDte, OpLtstSchedldExecEndTme,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpLtstSchedldExecEndTme,

      //      Actual Start Date Time

      case when OpActualExecutionStartTime  = '240000' and OpActualExecutionStartDate is not initial
      then cast(dats_tims_to_tstmp( dats_add_days( OpActualExecutionStartDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client, 'NULL') as timestamp preserving type)
      else cast(dats_tims_to_tstmp( OpActualExecutionStartDate, OpActualExecutionStartTime,
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client,'NULL') as timestamp preserving type)
      end                                                                                  as OpActualExecutionStartDateTime,

      case when OpActualExecutionStartTime = '240000' and OpActualExecutionStartDate is not initial
      then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpActualExecutionStartDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_dats( dats_tims_to_tstmp(OpActualExecutionStartDate, OpActualExecutionStartTime,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpActualExecutionStartDate,

      case when OpActualExecutionStartTime = '240000' and OpActualExecutionStartDate is not initial
      then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpActualExecutionStartDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_tims( dats_tims_to_tstmp(OpActualExecutionStartDate, OpActualExecutionStartTime,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpActualExecutionStartTime,

      //      Actual Finish Date Time

      case when OpActualExecutionEndTime = '240000' and OpActualExecutionEndDate is not initial
      then cast(dats_tims_to_tstmp( dats_add_days( OpActualExecutionEndDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client, 'NULL') as timestamp preserving type)
      else cast(dats_tims_to_tstmp( OpActualExecutionEndDate, OpActualExecutionEndTime,
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client,'NULL') as timestamp preserving type)
      end                                                                                  as OpActualExecutionEndDateTime,

      case when OpActualExecutionEndTime = '240000' and OpActualExecutionEndDate is not initial
      then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpActualExecutionEndDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_dats( dats_tims_to_tstmp(OpActualExecutionEndDate, OpActualExecutionEndTime,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpActualExecutionEndDate,

      case when OpActualExecutionEndTime = '240000' and OpActualExecutionEndDate is not initial
      then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpActualExecutionEndDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_tims( dats_tims_to_tstmp(OpActualExecutionEndDate, OpActualExecutionEndTime,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as OpActualExecutionEndTime,

      case when ActyConfFcstdEndTime  = '240000' and ActyConfFcstdEndDate is not initial
      then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( ActyConfFcstdEndDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_dats( dats_tims_to_tstmp(ActyConfFcstdEndDate, ActyConfFcstdEndTime,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as ActyConfFcstdEndDate,

      case when ActyConfFcstdEndTime  = '240000' and ActyConfFcstdEndDate is not initial
      then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( ActyConfFcstdEndDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      else tstmp_to_tims( dats_tims_to_tstmp(ActyConfFcstdEndDate, ActyConfFcstdEndTime,
                    abap_system_timezone( $session.client,'NULL' ),
                    $session.client, 'NULL'), 'UTC', $session.client, 'NULL' )
      end                                                                                  as ActyConfFcstdEndTime,

      case when ActyConfFcstdEndTime = '240000' and ActyConfFcstdEndDate is not initial
      then cast(dats_tims_to_tstmp( dats_add_days( ActyConfFcstdEndDate, 1, 'NULL'), cast( '000000' as abap.tims ),
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client, 'NULL') as timestamp preserving type)
      else cast(dats_tims_to_tstmp( ActyConfFcstdEndDate, ActyConfFcstdEndTime,
                              abap_system_timezone( $session.client,'NULL' ),
                              $session.client,'NULL') as timestamp preserving type)
      end                                                                                  as ActyConfForecastedEndDateTime,

      ForecastWorkQuantity,

      ActualWorkQuantity,

      _MaintOrdOpAdditionalData.MaintenanceActivityType,
      BusinessArea,
      ProfitCenter,
      CostingSheet,
      TaxJurisdiction,
      FunctionalArea,
      MaintOrdOperationIsMRPRelevant,
      MaintControllingObjectClass,
      WrkCtrIntCapRqmtsDistr,
      MaintOrdOperationOverheadCode,
      MaintOrderOperationQuantity,
      MaintOrdOperationQuantityUnit,

      Assembly,
      MaintOperationExecStageCode,
      MaintOrdOpAssgdWBSElmntInt,
      cast ( _WBSElement.WBSElement as vdm_ps_posid )                                      as WBSElement,
      IsMarkedForDeletion,
      MaintOrderOperationInternalID,
      _MaintOrderOperObjectListLink.MaintenanceObjectListItem,
      PurchaseRequisition,
      PurchaseRequisitionItem,
      MaintOrdOpProcessPhaseCode,
      MaintOrdOpProcessSubPhaseCode,
      AllMaintOrdCompCmtdQtsAreKept,
      _MaintenanceOrder.ControllingArea                                                    as ControllingArea,
      MaintOrderConfirmation,
      MaintOrderConfCntrValue,
      MaintOrdOpHasNoRemainingWork,
      MaintOrdOpHasLeanServices,
      _MaintOrderOpObjectListLink._MaintenanceItemObject.MaintenanceNotification,
      @Feature: 'EAM_F5241_EXTERNAL_OPERATION'
      ExtProcgOperationHasSubcontrg,
      @Feature: 'EAM_F5241_EXTERNAL_OPERATION'
      MaintOrdOpDelivDateAdjustment,
      TaskListType,
      TaskListGroup,
      TaskListGroupCounter,
      TaskListSequence,
      TaskListOperationInternalId,
      MaintOperationalChecklistType,

      // associations :

      _MaintOrderOpRelationship,
      _MaintOrderOpComponent,
      _MaintOrderOpComponent_2,
      _MaintOrderOpRqmtAssgmt,
      _MaintenanceOrder,
      _OpExternalProcessingCurrency,
      _OperationPlanningValues,
      _OperationControlKey,
      _OperationSystemCondition,
      _Plant,
      _OperationCalculationControl,
      _Assembly,
      _Language,
      _Supplier,
      _PersonResponsible,
      _FunctionalLocation,
      _Equipment,
      _MaintOrderProdnRsceTool,
      _PMContactEmployee,
      _MaintOperationExecStageCode,
      _OperationWorkCenter,
      _StatusObjectActiveStatus,
      _MaintOrderOpLongText,
      _MaintOrderOpPhaseControl,
      _MaintOrderOpProdnRsceTool,
      _MaintenanceActivityTypeText,
      _CostCenterActivityTypeText,
      _PersonWorkAgreement,
      _WorkAssignment,
      _MaintOrderOpObjectListLink,
      _EAMProcessPhase,
      _EAMProcessSubPhase,
      _MaintenanceNotification,
      @Feature: 'EAM_F5241_EXTERNAL_OPERATION'
      _MaterialGroupText,
      @Feature: 'EAM_F5241_EXTERNAL_OPERATION'
      _PurchasingOrganization,
      @Feature: 'EAM_F5241_EXTERNAL_OPERATION'
      _PurchasingGroup,
      @Feature: 'EAM_F5241_EXTERNAL_OPERATION'
      _PurReqnOrResvnGeneration,
      @Feature: 'EAM_F5241_EXTERNAL_OPERATION'
      _CostElement,
      @Feature: 'EAM_F5241_EXTERNAL_OPERATION'
      _MaintOrdOpDeliveryDateAdjmt,
      _OperationControlProfileText,
      _MaintOpExecStageCodeText,
      _AssemblyText,
      _EquipmentText,
      _FunctionalLocationLabel,
      _FunctionalLocationText,
      _MaintOpSystemConditionText,
      _WorkCenterText,
      _OperationCalcControlText,
      _EAMProcessPhaseText,
      _EAMProcessSubPhaseText,
      _PurReqnOrResvnGenerationText,
      _MaintOrdOpDeliveryDateAdjmtT
}

where
  _StatusObjectActiveStatus [1: StatusCode = 'I0013'].StatusCode is null // mark for deletion based on system status