I_MAINTENANCEPLAN

CDS View

Maintenance Plan

I_MAINTENANCEPLAN is a CDS View in S/4HANA. Maintenance Plan. It contains 2 fields. 6 CDS views read from this table.

CDS Views using this table (6)

ViewTypeJoinVDMDescription
C_MaintenancePlanQuickVw view from CONSUMPTION Quick View for Maintenance Plan
I_MaintenancePlanData view from COMPOSITE Maintenance Plan Data
I_MaintenancePlanStdVH view from COMPOSITE Maintenance Plan
I_MaintenancePlanTP view from TRANSACTIONAL Maintenance Plan (Transactional Processing)
I_MaintPlanChgHistory view inner COMPOSITE Maint. Plan Change History
I_MaintPlanChgHistory view union_all COMPOSITE Maint. Plan Change History

Fields (2)

KeyField CDS FieldsUsed in Views
KEY MaintenancePlan MaintenancePlan 1
MaintenanceStrategy MaintenanceStrategy 1
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.sqlViewName: 'IMAINTPLAN'
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Maintenance Plan'
@ObjectModel: {
    representativeKey: 'MaintenancePlan',
    semanticKey: [ 'MaintenancePlan' ],
    usageType: {
        dataClass: #MASTER,
        serviceQuality: #A,
        sizeCategory: #L
    }
}
@VDM.viewType: #BASIC
@Metadata.ignorePropagatedAnnotations: true

@AbapCatalog.preserveKey:true

@VDM.lifecycle.status   : #DEPERECATED
@VDM.lifecycle.successor: 'I_MaintenancePlanBasic'


define view I_MaintenancePlan
  as select from mpla
  association [0..*] to I_StatusObjectActiveStatus as _StatusObjectActiveStatus on  _StatusObjectActiveStatus.StatusObject = $projection.MaintenancePlanInternalID
  association [0..*] to I_MaintenanceItem          as _MaintenanceItem          on  _MaintenanceItem.MaintenancePlan = $projection.MaintenancePlan
  association [0..1] to I_MaintenancePlanCatParam  as _MaintenancePlanCatParam  on  _MaintenancePlanCatParam.MaintenancePlanCategory = $projection.MaintenancePlanCategory
  association [0..1] to I_Customer                 as _Customer                 on  _Customer.Customer = $projection.Customer
  association [0..1] to I_Equipment                as _Equipment                on  _Equipment.Equipment = $projection.Equipment
  association [0..1] to I_FunctionalLocationLabel  as _FunctionalLocationLabel  on  _FunctionalLocationLabel.FunctionalLocation = $projection.FunctionalLocation
  association [0..*] to I_MaintenanceCall          as _MaintenanceCall          on  _MaintenanceCall.MaintenancePlan = $projection.MaintenancePlan
                                                                                and _MaintenanceCall.MaintenanceCall = $projection.MaintenanceCall
  association [0..*] to I_MaintPlanCallHistory     as _MaintPlanCallHistory     on  _MaintPlanCallHistory.MaintenancePlan = $projection.MaintenancePlan
  association [0..1] to I_MaintenanceStrategy      as _MaintenanceStrategy      on  _MaintenanceStrategy.MaintenanceStrategy = $projection.MaintenanceStrategy

  association [0..1] to I_FactoryCalendar          as _FactoryCalendar          on  _FactoryCalendar.FactoryCalendar = $projection.FactoryCalendar
  association [0..*] to I_MaintenanceCycle         as _MaintenanceCycle         on  _MaintenanceCycle.MaintenancePlan = $projection.MaintenancePlan
  association [1..*] to I_MaintenancePlanCycle     as _MaintenancePlanCycle     on  _MaintenancePlanCycle.MaintenancePlan = $projection.MaintenancePlan
  association [0..1] to I_MaintPlanSchedgInd       as _SchedulingIndicator      on  _SchedulingIndicator.MaintPlanSchedgIndicator = $projection.MaintPlanSchedgIndicator
  association [0..1] to I_UnitOfMeasure            as _SchedulingDurationUnit   on  _SchedulingDurationUnit.UnitOfMeasure = $projection.SchedulingDurationUnit
  association [0..1] to I_MaintPlanLgclOptr        as _LogicalOperator          on  _LogicalOperator.LogicalOperator = $projection.LogicalOperator
  association [0..1] to I_TechObjAuthznGrp         as _AuthorizationGroup       on  _AuthorizationGroup.TechObjAuthorizationGroup = $projection.AuthorizationGroup
  association [0..1] to I_Indicator                as _MaintCallConfIsRequired  on  _MaintCallConfIsRequired.IndicatorValue = $projection.PrdcssrCallObjCompltnIsRqd
  association [0..1] to I_MaintenancePlanSortField as _MaintenancePlanSortField on  _MaintenancePlanSortField.MaintenancePlanSortField = $projection.MaintPlanFreeDefinedAttrib
  association [0..1] to I_UnitOfMeasure            as _MaintPlanStartBufferUnit on  _MaintPlanStartBufferUnit.UnitOfMeasure = $projection.MaintPlanStartBufferUnit
{
      // Key

      @ObjectModel.text.element: 'MaintenancePlanDesc'
  key mpla.warpl                                                                  as MaintenancePlan,

      // Text

      @Semantics.text: true
      mpla.wptxt                                                                  as MaintenancePlanDesc,

      @Semantics.businessDate.createdAt: true
      mpla.ersdt                                                                  as CreationDate,

      @Semantics.user.createdBy: true
      mpla.ernam                                                                  as CreatedByUser,

      @Semantics.businessDate.lastChangedAt: true
      mpla.aedat                                                                  as LastChangeDate,

      @Semantics.user.lastChangedBy: true
      mpla.aenam                                                                  as LastChangedByUser,

      @Consumption.valueHelpDefinition: [{
        entity: {
            name: 'I_MaintenanceStrategyStdVH',
            element: 'MaintenanceStrategy'
        }
      }]
      @ObjectModel.foreignKey.association: '_MaintenanceStrategy'
      mpla.strat                                                                  as MaintenanceStrategy,

      @Semantics.quantity.unitOfMeasure: 'SchedulingDurationUnit'
      mpla.abrho                                                                  as SchedulingDuration,

      @Consumption.valueHelpDefinition: [{
        entity: {
            name:    'I_EquipmentStdVH',
            element: 'Equipment'
        },
        additionalBinding: [{
            localElement: 'Customer',
            element: 'Customer'
        }]
      }]
      @ObjectModel.foreignKey.association: '_Equipment'
      mpla.equnr                                                                  as Equipment,

      @ObjectModel.foreignKey.association: '_FunctionalLocationLabel'
      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_FunctionalLocationStdVH',
                     element: 'Equipment' }
        }]
      mpla.tplnr                                                                  as FunctionalLocation,

      @Consumption.valueHelpDefinition: [{
        entity: {
            name: 'I_Customer_VH',
            element: 'Customer'
        }
      }]
      @ObjectModel.foreignKey.association: '_Customer'
      mpla.kunum                                                                  as Customer,

      mpla.anzps                                                                  as NumberOfMaintenanceItems,

      @Semantics.language: true
      mpla.langu                                                                  as Language,

      mpla.sfakt                                                                  as CycleModificationRatio,

      @ObjectModel.foreignKey.association: '_SchedulingIndicator'
      mpla.stich                                                                  as MaintPlanSchedgIndicator,

      mpla.horiz                                                                  as CallHorizonPercent,
      //The MaintenanceCallHorizonCalcType field has a CHAR1 type. However, the unitofmeasure annotation is expected UNIT specific type

      //@Semantics.quantity.unitOfMeasure: 'MaintenanceCallHorizonCalcType'  

      mpla.horiz_days                                                             as CallHorizonInDays,

      @ObjectModel.foreignKey.association: '_AuthorizationGroup'
      mpla.begru                                                                  as AuthorizationGroup,

      mpla.objnr                                                                  as MaintenancePlanInternalID,

      mpla.abnum                                                                  as MaintenanceCall,

      @ObjectModel.foreignKey.association: '_MaintenancePlanCatParam'
      mpla.mptyp                                                                  as MaintenancePlanCategory,

      @ObjectModel.foreignKey.association: '_SchedulingDurationUnit'
      @Semantics.unitOfMeasure: true
      mpla.hunit                                                                  as SchedulingDurationUnit,

      mpla.stadt                                                                  as BasicStartDate,

      @ObjectModel.foreignKey.association: '_MaintenancePlanSortField'
      mpla.plan_sort                                                              as MaintPlanFreeDefinedAttrib,

      @ObjectModel.foreignKey.association: '_FactoryCalendar'
      mpla.fabkl                                                                  as FactoryCalendar,

      mpla.lvorm                                                                  as MaintPlanIsLockedAgainstCalls,

      mpla.changeddatetime                                                        as LastChangeDateTime,

      mpla.vspos                                                                  as LateCompletionShiftFactor,

      mpla.vsneg                                                                  as EarlyCompletionShiftFactor,

      mpla.topos                                                                  as LateCompletionTolerancePercent,

      mpla.toneg                                                                  as EarlyCompletionTolerancePct,

      cast (mpla.horiz_qualifier as eam_cc_callhorizon_calc_type preserving type) as MaintenanceCallHorizonCalcType,

      @ObjectModel.foreignKey.association: '_LogicalOperator'
      mpla.andor                                                                  as LogicalOperator,

      mpla.mcp_sf                                                                 as MultipleCounterPlanShiftFactor,

//      @Semantics.quantity.unitOfMeasure: 'MaintPlanCycRcrrcIntervalUnit'

      mpla.szaeh                                                                  as MaintSchedulingStartCounter,

      mpla.start_date                                                             as SchedulingStartDate,

      mpla.start_time                                                             as SchedulingStartTime,

      mpla.end_counter                                                            as MaintSchedulingEndCounter,

      mpla.enddt_for_sched                                                        as SchedulingEndDate,

      mpla.puffp                                                                  as MaintenanceLeadFloatInDays,

      mpla.tgoon                                                                  as MaintPlanStartBufferQuantity,

      @ObjectModel.foreignKey.association: '_MaintPlanStartBufferUnit'
      cast('TAG' as hunit)                                                        as MaintPlanStartBufferUnit,

      @ObjectModel.foreignKey.association: '_MaintCallConfIsRequired'
      @Semantics.booleanIndicator: true
      mpla.call_confirm                                                           as PrdcssrCallObjCompltnIsRqd,
      mpla.ltknz                                                                  as MaintenancePlanHasLongText,
      
      //@ObjectModel.foreignKey.association: '_MaintenancePlanCycle'

      //@Semantics.unitOfMeasure: true

      //_MaintenancePlanCycle.MaintPlanCycRcrrcIntervalUnit as MaintPlanCycRcrrcIntervalUnit, 

     
      /* Associations */
      _StatusObjectActiveStatus,
      _Customer,
      _Equipment,
      _FunctionalLocationLabel,
      _MaintenanceItem,
      _MaintenancePlanCatParam,
      _MaintenanceCall,
      _MaintPlanCallHistory,
      _MaintenanceStrategy,
      _FactoryCalendar,
      _MaintenanceCycle,
      _MaintenancePlanCycle,
      _SchedulingIndicator,
      _SchedulingDurationUnit,
      _LogicalOperator,
      _AuthorizationGroup,
      _MaintCallConfIsRequired,
      _MaintenancePlanSortField,
      _MaintPlanStartBufferUnit
}
where
  _MaintenancePlanCatParam.OrderCategoryScreenTypeCode <> 'O190' // stability study is not PM but QM relevant

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MAINTENANCEPLANCATPARAM",
"MPLA"
],
"ASSOCIATED":
[
"I_CUSTOMER",
"I_EQUIPMENT",
"I_FACTORYCALENDAR",
"I_FUNCTIONALLOCATIONLABEL",
"I_INDICATOR",
"I_MAINTENANCECALL",
"I_MAINTENANCECYCLE",
"I_MAINTENANCEITEM",
"I_MAINTENANCEPLANCATPARAM",
"I_MAINTENANCEPLANCYCLE",
"I_MAINTENANCEPLANSORTFIELD",
"I_MAINTENANCESTRATEGY",
"I_MAINTPLANCALLHISTORY",
"I_MAINTPLANLGCLOPTR",
"I_MAINTPLANSCHEDGIND",
"I_STATUSOBJECTACTIVESTATUS",
"I_TECHOBJAUTHZNGRP",
"I_UNITOFMEASURE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/