I_MaintOrderOpPhaseControl

DDL: I_MAINTORDEROPPHASECONTROL SQL: IMAINTOPPHSCTR Type: view COMPOSITE

Maintenance Order Op Phase Controls

I_MaintOrderOpPhaseControl is a Composite CDS View that provides data about "Maintenance Order Op Phase Controls" in SAP S/4HANA. It reads from 3 data sources (I_MaintenanceOrder, I_MaintOrderOperAndSubOper, I_MaintPhaseControlCode) and exposes 31 fields with key fields MaintenanceOrder, MaintenanceOrderOperation, MaintenanceOrderSubOperation, MaintenancePhaseControl. It has 5 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_MaintenanceOrder MaintenanceOrder inner
I_MaintOrderOperAndSubOper MaintenanceOrderOperAndSubOper from
I_MaintPhaseControlCode MaintObjectPhaseControl inner

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_MaintOrderOpPhseCtrlChgHist _MaintObjPhseCtrlCodeChgSet $projection.MaintenanceOrder = _MaintObjPhseCtrlCodeChgSet.MaintenanceOrder and $projection.MaintenanceOrderOperation = _MaintObjPhseCtrlCodeChgSet.MaintenanceOrderOperation and $projection.MaintenanceOrderSubOperation = _MaintObjPhseCtrlCodeChgSet.MaintenanceOrderSubOperation and $projection.MaintenanceUserStatusCode = _MaintObjPhseCtrlCodeChgSet.StatusCode and _MaintObjPhseCtrlCodeChgSet.StatusIsInactive = ''
[0..1] I_MaintOrderOpPhseCtrlChgHist _MaintObjPhseCtrlCodeChgReset $projection.MaintenanceOrder = _MaintObjPhseCtrlCodeChgReset.MaintenanceOrder and $projection.MaintenanceOrderOperation = _MaintObjPhseCtrlCodeChgReset.MaintenanceOrderOperation and $projection.MaintenanceOrderSubOperation = _MaintObjPhseCtrlCodeChgReset.MaintenanceOrderSubOperation and $projection.MaintenanceUserStatusCode = _MaintObjPhseCtrlCodeChgReset.StatusCode and _MaintObjPhseCtrlCodeChgReset.StatusIsInactive = 'X'
[1..1] I_MaintOrderOperAndSubOper _MaintenanceOrderOperation $projection.MaintenanceOrder = _MaintenanceOrderOperation.MaintenanceOrder and $projection.MaintenanceOrderOperation = _MaintenanceOrderOperation.MaintenanceOrderOperation and $projection.MaintenanceOrderSubOperation = _MaintenanceOrderOperation.MaintenanceOrderSubOperation
[1..1] I_MaintenanceOrder _MaintenanceOrder _MaintenanceOrder.MaintenanceOrder = $projection.MaintenanceOrder
[0..1] I_MaintPhseCtrlActivationCode _MaintPhseCtrlActivationCode _MaintPhseCtrlActivationCode.MaintProcgPhseCtrlActvtnCode = $projection.MaintProcgPhseCtrlActvtnCode

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName IMAINTOPPHSCTR view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Maintenance Order Op Phase Controls view
Metadata.ignorePropagatedAnnotations true view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view

Fields (31)

KeyFieldSource TableSource FieldDescription
KEY MaintenanceOrder I_MaintOrderOperAndSubOper MaintenanceOrder
KEY MaintenanceOrderOperation
KEY MaintenanceOrderSubOperation
KEY MaintenancePhaseControl I_MaintPhaseControlCode MaintenancePhaseControlName
MaintenancePhaseControlName I_MaintPhaseControlCode MaintenancePhaseControlName
StatusObject StatusObjectStatus StatusObject
MaintUserStatusProfileCode I_MaintPhaseControlCode MaintUserStatusProfileCode
MaintenanceUserStatusCode I_MaintPhaseControlCode MaintenanceUserStatusCode
MaintenancePhaseControlText I_MaintPhaseControlCode MaintenancePhaseControlText
MaintPhseCtrlIsSetAutomly I_MaintPhaseControlCode MaintPhseCtrlIsSetAutomly
EAMOverallStatusProfile I_MaintPhaseControlCode EAMOverallStatusProfile
MaintPhaseControlAuthorityCode I_MaintPhaseControlCode MaintPhaseControlAuthorityCode
MaintProcgPhseCtrlActvtnCode MaintPhseCtrlActvtnProcValue MaintProcgPhseCtrlActvtnCode
EAMProcessPhaseCode MaintPhseCtrlActvtnProcValue EAMProcessPhaseCode
EAMProcessSubPhaseCode MaintPhseCtrlActvtnProcValue EAMProcessSubPhaseCode
MaintObjPhseCtrlStatusIsActive
MaintenanceOrderType I_MaintenanceOrder MaintenanceOrderType
MaintenancePlanningPlant I_MaintenanceOrder MaintenancePlanningPlant
EAMBlockerCodeEntityType I_MaintPhaseControlCode EAMBlockerCodeEntityType
MaintOrdOpProcessPhaseCode _MaintenanceOrderOperation MaintOrdOpProcessPhaseCode
MaintOrdOpProcessSubPhaseCode _MaintenanceOrderOperation MaintOrdOpProcessSubPhaseCode
_MaintenanceOrderOperation _MaintenanceOrderOperation
_MaintenanceOrder _MaintenanceOrder
_MaintObjPhseCtrlCodeChgSet _MaintObjPhseCtrlCodeChgSet
_MaintObjPhseCtrlCodeChgReset _MaintObjPhseCtrlCodeChgReset
_ProcessingPhase MaintPhseCtrlActvtnProcValue _ProcessingPhase
_ProcessingSubPhase MaintPhseCtrlActvtnProcValue _ProcessingSubPhase
_StatusObject StatusObjectStatus _StatusObject
_StatusCode I_MaintPhaseControlCode _StatusCode
_StatusProfile I_MaintPhaseControlCode _StatusProfile
_MaintPhseCtrlActivationCode _MaintPhseCtrlActivationCode
@AbapCatalog.sqlViewName: 'IMAINTOPPHSCTR'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Maintenance Order Op Phase Controls'

@Metadata.ignorePropagatedAnnotations: true

@VDM.viewType: #COMPOSITE

@ObjectModel.semanticKey:  [ 'MaintenanceOrder', 'MaintenanceOrderOperation', 'MaintenanceOrderSubOperation', 'MaintenancePhaseControl' ]

@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
define view I_MaintOrderOpPhaseControl
  as select from           I_MaintOrderOperAndSubOper     as MaintenanceOrderOperAndSubOper
    inner join             I_MaintenanceOrder             as MaintenanceOrder             on MaintenanceOrderOperAndSubOper.MaintenanceOrder = MaintenanceOrder.MaintenanceOrder
  //    inner join             I_StatusObjectStatus           as StatusObjectStatus           on MaintenanceOrderOperAndSubOper.MaintOrderOperationInternalID = StatusObjectStatus.StatusObject

    inner join             I_MaintPhaseControlCode        as MaintObjectPhaseControl      on  MaintenanceOrder.MaintenanceOrderType            = MaintObjectPhaseControl.MaintenanceOrderType
                                                                                          and MaintObjectPhaseControl.EAMBlockerCodeEntityType = 'OVG'
  //                                                                                          and StatusObjectStatus.StatusCode                    = MaintObjectPhaseControl.MaintenanceUserStatusCode

    left outer to one join I_StatusObjectStatus           as StatusObjectStatus           on  MaintenanceOrderOperAndSubOper.MaintOrderOperationInternalID = StatusObjectStatus.StatusObject
                                                                                          and MaintObjectPhaseControl.MaintenanceUserStatusCode            = StatusObjectStatus.StatusCode
    left outer to one join I_MaintPhseCtrlActvtnProcValue as MaintPhseCtrlActvtnProcValue on  MaintPhseCtrlActvtnProcValue.MaintenanceOrderType         = MaintObjectPhaseControl.MaintenanceOrderType
                                                                                          and MaintPhseCtrlActvtnProcValue.EAMBlockerCodeEntityType     = MaintObjectPhaseControl.EAMBlockerCodeEntityType
                                                                                          and MaintPhseCtrlActvtnProcValue.EAMBlockerCode               = MaintObjectPhaseControl.MaintenancePhaseControlName
                                                                                          and MaintPhseCtrlActvtnProcValue.MaintProcgPhseCtrlActvtnCode = '02' //Filter Blocks (Endphase) only


  association [0..1] to I_MaintOrderOpPhseCtrlChgHist as _MaintObjPhseCtrlCodeChgSet   on  $projection.MaintenanceOrder                 = _MaintObjPhseCtrlCodeChgSet.MaintenanceOrder
                                                                                       and $projection.MaintenanceOrderOperation        = _MaintObjPhseCtrlCodeChgSet.MaintenanceOrderOperation
                                                                                       and $projection.MaintenanceOrderSubOperation     = _MaintObjPhseCtrlCodeChgSet.MaintenanceOrderSubOperation
                                                                                       and $projection.MaintenanceUserStatusCode        = _MaintObjPhseCtrlCodeChgSet.StatusCode
                                                                                       and _MaintObjPhseCtrlCodeChgSet.StatusIsInactive = ''

  association [0..1] to I_MaintOrderOpPhseCtrlChgHist as _MaintObjPhseCtrlCodeChgReset on  $projection.MaintenanceOrder                   = _MaintObjPhseCtrlCodeChgReset.MaintenanceOrder
                                                                                       and $projection.MaintenanceOrderOperation          = _MaintObjPhseCtrlCodeChgReset.MaintenanceOrderOperation
                                                                                       and $projection.MaintenanceOrderSubOperation       = _MaintObjPhseCtrlCodeChgReset.MaintenanceOrderSubOperation
                                                                                       and $projection.MaintenanceUserStatusCode          = _MaintObjPhseCtrlCodeChgReset.StatusCode
                                                                                       and _MaintObjPhseCtrlCodeChgReset.StatusIsInactive = 'X'

  association [1..1] to I_MaintOrderOperAndSubOper    as _MaintenanceOrderOperation    on  $projection.MaintenanceOrder             = _MaintenanceOrderOperation.MaintenanceOrder
                                                                                       and $projection.MaintenanceOrderOperation    = _MaintenanceOrderOperation.MaintenanceOrderOperation
                                                                                       and $projection.MaintenanceOrderSubOperation = _MaintenanceOrderOperation.MaintenanceOrderSubOperation
  association [1..1] to I_MaintenanceOrder            as _MaintenanceOrder             on  _MaintenanceOrder.MaintenanceOrder = $projection.MaintenanceOrder
  association [0..1] to I_MaintPhseCtrlActivationCode as _MaintPhseCtrlActivationCode  on  _MaintPhseCtrlActivationCode.MaintProcgPhseCtrlActvtnCode = $projection.MaintProcgPhseCtrlActvtnCode
{

  key MaintenanceOrderOperAndSubOper.MaintenanceOrder                                                                      as MaintenanceOrder,
  key cast( MaintenanceOrderOperAndSubOper.MaintenanceOrderOperation as maintenanceorderoperation preserving type )        as MaintenanceOrderOperation,
  key cast( MaintenanceOrderOperAndSubOper.MaintenanceOrderSubOperation as maintenanceordersuboperation preserving type )  as MaintenanceOrderSubOperation,
  key MaintObjectPhaseControl.MaintenancePhaseControlName                                                                  as MaintenancePhaseControl,

      MaintObjectPhaseControl.MaintenancePhaseControlName, //for the future, it will be language-dependent


      StatusObjectStatus.StatusObject,
      MaintObjectPhaseControl.MaintUserStatusProfileCode,
      MaintObjectPhaseControl.MaintenanceUserStatusCode,

      MaintObjectPhaseControl.MaintenancePhaseControlText, //for the future, it will be language-dependent

      MaintObjectPhaseControl.MaintPhseCtrlIsSetAutomly,

      MaintObjectPhaseControl.EAMOverallStatusProfile,
      MaintObjectPhaseControl.MaintPhaseControlAuthorityCode,

      MaintPhseCtrlActvtnProcValue.MaintProcgPhseCtrlActvtnCode,
      MaintPhseCtrlActvtnProcValue.EAMProcessPhaseCode,
      MaintPhseCtrlActvtnProcValue.EAMProcessSubPhaseCode,

      @Semantics.booleanIndicator:true
      cast( StatusObjectStatus.StatusIsActive as vdm_j_statusisactive preserving type )                                    as MaintObjPhseCtrlStatusIsActive,

      cast( case
        when StatusObjectStatus.StatusIsActive   = 'X' then 'X'
        when StatusObjectStatus.StatusIsInactive = 'X' then 'Y'
        else ''
      end as eam_bo_blkcd_status preserving type)                                                                          as MaintObjPhaseControlStateCode,

      MaintenanceOrder.MaintenanceOrderType,
      MaintenanceOrder.MaintenancePlanningPlant,
      MaintObjectPhaseControl.EAMBlockerCodeEntityType,

      _MaintenanceOrderOperation.MaintOrdOpProcessPhaseCode,
      _MaintenanceOrderOperation.MaintOrdOpProcessSubPhaseCode,

      /* Propagated associations */
      _MaintenanceOrderOperation,
      _MaintenanceOrder,
      _MaintObjPhseCtrlCodeChgSet,
      _MaintObjPhseCtrlCodeChgReset,
      MaintPhseCtrlActvtnProcValue._ProcessingPhase,
      MaintPhseCtrlActvtnProcValue._ProcessingSubPhase,
      StatusObjectStatus._StatusObject,
      MaintObjectPhaseControl._StatusCode,
      MaintObjectPhaseControl._StatusProfile,
      _MaintPhseCtrlActivationCode

}