R_MAINTENANCEPLANTP

CDS View

Maintenance Plan Header

R_MAINTENANCEPLANTP is a CDS View in S/4HANA. Maintenance Plan Header. 3 CDS views read from this table.

CDS Views using this table (3)

ViewTypeJoinVDMDescription
A_MaintenancePlan view_entity projection CONSUMPTION Maintenance Plan
C_MaintenancePlanTP view_entity projection CONSUMPTION Maintenance Plan Header
I_MaintenancePlanTP_2 view_entity projection TRANSACTIONAL Interface for Maintenance Plan - TP
@AccessControl: {
                    authorizationCheck: #CHECK,
                    personalData.blocking: #('TRANSACTIONAL_DATA')
                }
@EndUserText.label: 'Maintenance Plan Header'

@VDM: {
        usage.type: [#TRANSACTIONAL_PROCESSING_SERVICE],
        viewType: #TRANSACTIONAL,
        lifecycle.contract.type: #SAP_INTERNAL_API
      }

@ObjectModel : {
                    usageType : {
                                    dataClass: #TRANSACTIONAL,
                                    serviceQuality: #C,
                                    sizeCategory: #XL
                                },
                    modelingPattern: #TRANSACTIONAL_ENTITY,
                    supportedCapabilities: [ #TRANSACTIONAL_PROVIDER ],
                    semanticKey: ['MaintenancePlan']
}
@ObjectModel.sapObjectNodeType.name: 'MaintenancePlan'

define root view entity R_MaintenancePlanTP
  as select from I_MaintenancePlanBasic
  composition [0..*] of R_MaintenancePlanCycleTP       as _MaintenanceCycle
  composition [0..*] of R_MaintPlanToMaintItemTP       as _MaintenanceItemLink
  association [1..1] to I_MaintenanceStrategyT         as _StrategyText                on  $projection.MaintenanceStrategy = _StrategyText.MaintenanceStrategy
                                                                                       and _StrategyText.Language          = $session.system_language
  composition [0..*] of R_MaintenancePlanTextTP        as _LongText
  association [0..*] to R_MaintenanceItemTP            as _Item                        on  $projection.MaintenancePlan = _Item.MaintenancePlan
  association [0..*] to I_MaintenancePlanSchedule      as _Schedules                   on  $projection.MaintenancePlan = _Schedules.MaintenancePlan
  association [1..1] to I_MaintPlanCallHorizonCalcType as _CallHrznCalcTypeTxt         on  $projection.CallHorizonUnit = _CallHrznCalcTypeTxt.MaintenanceCallHorizonCalcType
  association [0..1] to I_MaintenancePlanType          as _MaintenancePlanType         on  $projection.MaintenancePlanType = _MaintenancePlanType.MaintenancePlanType
  association [0..1] to R_MaintenancePlanCycleTP       as _SingleCycle                 on  $projection.MaintenancePlan       = _SingleCycle.MaintenancePlan
                                                                                       and _SingleCycle.MaintenancePlanCycle = '01'
  association [1..1] to I_MaintenancePlanStatus_2        as _MaintPlanActiveSystemStatus on  $projection.MaintenancePlan = _MaintPlanActiveSystemStatus.MaintenancePlan  
  association [0..1] to I_User                         as _CreatedByUser               on  $projection.CreatedByUser = _CreatedByUser.UserID
  association [0..1] to I_User                         as _LastChangedByUser           on  $projection.LastChangedByUser = _LastChangedByUser.UserID
  association [1..1] to I_MaintPlanSchedgInd           as _SchedIndicator              on  $projection.MaintPlanSchedgIndicator = _SchedIndicator.MaintPlanSchedgIndicator
  association [1..1] to I_UnitOfMeasure                as _UnitOfMeasure               on  $projection.SchedulingDurationUnit = _UnitOfMeasure.UnitOfMeasure
  association [1..1] to I_MaintPlanLgclOptrText        as _LogicalOperatorText         on  $projection.MaintPlanLogicalOperatorCode = _LogicalOperatorText.LogicalOperator
                                                                                       and _LogicalOperatorText.Language            = $session.system_language
  association [0..1] to I_MaintPlanLgclOptr            as _LogicalOperator             on  _LogicalOperator.LogicalOperator = $projection.MaintPlanLogicalOperatorCode
  association [0..1] to I_MaintenancePlanCallDate      as _MaintenancePlanCallDate     on  $projection.MaintenancePlan = _MaintenancePlanCallDate.MaintenancePlan

  association [0..1] to I_StatusObjectStatusBasic      as _ActivePlan                  on  $projection.MaintenancePlanInternalID = _ActivePlan.StatusObject
                                                                                       and _ActivePlan.StatusCode                = 'I0001'
                                                                                       and _ActivePlan.StatusIsInactive          is initial

  association [0..1] to I_StatusObjectStatusBasic      as _InactivePlan             on  $projection.MaintenancePlanInternalID = _InactivePlan.StatusObject
                                                                                       and _InactivePlan.StatusCode           = 'I0320'
                                                                                       and _InactivePlan.StatusIsInactive     is initial

  association [0..1] to I_StatusObjectStatusBasic      as _DeletedPlan                 on  $projection.MaintenancePlanInternalID = _DeletedPlan.StatusObject
                                                                                       and _DeletedPlan.StatusCode               = 'I0076'
                                                                                       and _DeletedPlan.StatusIsInactive         is initial



  association [0..1] to E_MaintenancePlan          as _MaintenancePlanExtension on $projection.MaintenancePlan = _MaintenancePlanExtension.MaintenancePlan

{
  key MaintenancePlan,
      MaintenancePlanDesc,
      CreationDate,
      CreatedByUser,
      LastChangeDate,
      LastChangedByUser,
      MaintenanceStrategy,
      cast(' ' as wset )                                                                              as MaintenancePlanCycleSet,
      SchedulingDuration,

      SchedulingDurationUnit,
      NumberOfMaintenanceItems,
      CycleModificationRatio,
      MaintPlanSchedgIndicator,
      cast(
       case MaintenanceStrategy
         when '' then
           case MaintPlanSchedgIndicator
             when '3' then 'SINGLE PER'
             when '4' then 'MULTI COUN'
             else 'SINGLE TIM'
           end
         else 'STRATEGY'
       end
      as eams_mplan_type preserving type)                                                             as MaintenancePlanType,
      CallHorizonPercent,
      CallHorizonInDays,
      MaintenanceCallHorizonCalcType,
      cast( case when MaintenanceCallHorizonCalcType = '' then '%'
            else MaintenanceCallHorizonCalcType end as eam_cc_callhorizon_calc_type preserving type ) as CallHorizonUnit,

      AuthorizationGroup,
      MaintenancePlanInternalID,
      MaintenanceCall,
      MaintenancePlanCategory,
      MaintPlanFreeDefinedAttrib,
      BasicStartDate,
      SchedulingStartDate,
      SchedulingStartTime,
      //Start of change - Merge StartDateTime

      @Semantics.dateTime: true
      dats_tims_to_tstmp( SchedulingStartDate,
                          SchedulingStartTime,
                          abap_system_timezone($session.client,'NULL'),
                          $session.client,
                         'NULL' )                                                                     as MaintPlanSchedgStartDateTime,
      //End of change - Merge StartDateTime

      ltrim(MaintPlanStartCntrReadingValue, ' ')                                                      as MaintPlanStartCntrReadingValue,
      MaintPlnStrtBufDurationInDays,
      MaintPlanStartBufferUnit,
      FactoryCalendar,
      LateCompletionShiftInPercent,
      LateCompletionTolerancePercent,
      EarlyCompletionShiftInPercent,
      EarlyCompletionTolerancePct,
      PrdcssrCallObjCompltnIsRqd,
      @ObjectModel.foreignKey.association: '_LogicalOperator'
      cast( MaintPlanLogicalOperatorCode as eams_mplan_logop preserving type )                        as MaintPlanLogicalOperatorCode,
      SchedulingEndDate,
      ltrim(MaintPlanEndCntrReadingValue, ' ')                                                        as MaintPlanEndCntrReadingValue,
      LastChangeDateTime,
      MultipleCounterPlanShiftFactor,
      MaintenanceLeadFloatInDays,
      MaintenancePlanCallObject,
      cast(' ' as cv_orig preserving type )                                                           as IsAttachmentsEnabled,
        
      case when (_MaintPlanActiveSystemStatus.MaintPlanIsMarkedForDeletion  = 'X' ) then 'I0076'
      else case when (_MaintPlanActiveSystemStatus.MaintenancePlanIsInactive  = 'X' ) then 'I0320'
      else  'I0001' end end                                                                           as SystemStatus,


      _MaintenancePlanCycle,
      _StatusObjectActiveStatus,
      _MaintenanceItem,
      _MaintenancePlanCatParam,
      _MaintenancePlanType,
      _MaintenanceStrategy,
      _MaintenanceCycle,
      _FactoryCalendar,
      _SchedulingIndicator,
      _MaintPlanCallHistory,
      _SchedulingDurationUnit,
      _AuthorizationGroup,
      _MaintCallConfIsRequired,
      _MaintenancePlanSortField,
      _MaintPlanStartBufferUnit,
      _StrategyText,
      _Item,
      _Schedules,
      _LongText,
      _MaintenanceItemLink,
      _SingleCycle,
      _CallHrznCalcTypeTxt,
      _CreatedByUser,
      _LastChangedByUser,
      _SchedIndicator,
      _UnitOfMeasure,
      _LogicalOperator,
      _LogicalOperatorText,
      _MaintenancePlanCallDate,
      _ActivePlan,
      _InactivePlan,
      _DeletedPlan



}
where
  (
       _MaintenancePlanCatParam.MaintenancePlanCallObject is initial
    or _MaintenancePlanCatParam.MaintenancePlanCallObject =  '2'
    or MaintenancePlanCallObject                          =  '5'
  )
  and  _MaintenancePlanCatParam.MaintPlanHasContract      <> 'X'