R_MAINTENANCEITEMTP

CDS View

Maintenance Item

R_MAINTENANCEITEMTP is a CDS View in S/4HANA. Maintenance Item. 4 CDS views read from this table.

CDS Views using this table (4)

ViewTypeJoinVDMDescription
A_MaintenanceItem view_entity projection CONSUMPTION Maintenance Item
C_MaintenanceItemTP view_entity projection CONSUMPTION Maintenance Item
I_MaintenanceItemTP_2 view_entity projection TRANSACTIONAL Maintenance Item
R_MaintPlanToMaintItemTP view_entity from TRANSACTIONAL Maintenance Items in a Maintenance Plan
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Maintenance Item'
@VDM.viewType: #TRANSACTIONAL
@VDM.usage.type: [#TRANSACTIONAL_PROCESSING_SERVICE]
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@Metadata.ignorePropagatedAnnotations:true
@ObjectModel: {
    usageType.serviceQuality: #C,
    usageType.sizeCategory: #L,
    usageType.dataClass: #MASTER,
    representativeKey: 'MaintenanceItem',
    semanticKey:  [ 'MaintenanceItem' ],
    modelingPattern: #TRANSACTIONAL_ENTITY,
    supportedCapabilities: [ #TRANSACTIONAL_PROVIDER ],
    sapObjectNodeType.name: 'MaintenanceItem'
}


/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ]  } */
define root view entity R_MaintenanceItemTP
  as select from I_MaintenanceItem

  association [0..*] to I_EquipmentText                as _EquipmentText                 on  $projection.Equipment = _EquipmentText.Equipment
  association [0..1] to I_FunctionalLocation           as _FunctionalLocation            on  $projection.FunctionalLocation = _FunctionalLocation.FunctionalLocation

  association [0..*] to I_FunctionalLocationText       as _FunctionalLocationText        on  $projection.FunctionalLocation = _FunctionalLocationText.FunctionalLocation
  association [0..1] to I_FunctionalLocationLabel      as _FunctionalLocationLabel       on  $projection.FunctionalLocation = _FunctionalLocationLabel.FunctionalLocation
  association [0..1] to I_ServiceDocumentTypeText      as _ServiceDocumentTypeText       on  $projection.ServiceDocumentType = _ServiceDocumentTypeText.ServiceDocumentType
  association [0..1] to I_ServiceDocumentPriorityText  as _ServiceDocumentPriorityText   on  $projection.ServiceDocumentPriority = _ServiceDocumentPriorityText.ServiceDocumentPriority
  association [0..1] to I_ServiceDocument              as _ServiceTemplate               on  $projection.ServiceOrderTemplate   = _ServiceTemplate.ServiceDocument
                                                                                         and _ServiceTemplate.ServiceObjectType = 'BUS2000116'
  association [0..*] to I_TechObjIsEquipOrFuncnlLocT   as _TechObjIsEquipOrFuncnlLocDesc on  $projection.TechObjIsEquipOrFuncnlLoc = _TechObjIsEquipOrFuncnlLocDesc.TechObjIsEquipOrFuncnlLoc

  association [0..*] to I_MaintItemRefObjectTypeText   as _ReferenceObjectTypeText       on  $projection.MaintItemReferenceObjectType = _ReferenceObjectTypeText.MaintItemReferenceObjectType
  association [0..*] to I_MaintItmRefObjTypeForSrvcTxt as _RefObjectTypeForSrvcText      on  $projection.MaintItemRefObjTypeForService = _RefObjectTypeForSrvcText.MaintItemReferenceObjectType

  association [0..1] to I_MaintenancePlanStatus        as _MaintenancePlanStatus         on  $projection.MaintenancePlan = _MaintenancePlanStatus.MaintenancePlan
  association [0..1] to I_MaintenancePlanType          as _MaintenancePlanType           on  $projection.MaintenancePlanType = _MaintenancePlanType.MaintenancePlanType
  association [0..*] to I_MaintPlanCallObjectText      as _MaintPlanCallObjectText       on  _MaintPlanCallObjectText.MaintenancePlanCallObject = $projection.MaintenancePlanCallObject
  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 [0..1] to I_GenericPriority              as _GenericPriority               on  $projection.MaintPriorityType = _GenericPriority.GenericPriorityType
                                                                                         and $projection.MaintPriority     = _GenericPriority.PriorityCode

  association [0..1] to I_MaintTaskListForKeyDate      as _MaintTaskListForKeyDate       on  $projection.TaskListType         = _MaintTaskListForKeyDate.TaskListType
                                                                                         and $projection.TaskListGroup        = _MaintTaskListForKeyDate.TaskListGroup
                                                                                         and $projection.TaskListGroupCounter = _MaintTaskListForKeyDate.TaskListGroupCounter


  composition [0..*] of R_MaintItemObjectListItemTP    as _MaintItemObjectListItem
  composition [0..*] of R_MaintenanceItemReasonTP      as _MaintenanceItemReason
  composition [0..*] of R_MaintenanceItemCauseTP       as _MaintenanceItemCause
  composition [0..*] of R_MaintenanceItemTextTP        as _LongText
{

      @ObjectModel.text.element: ['MaintenanceItemDescription']
  key MaintenanceItem,

      @Semantics.text: true
      MaintenanceItemDescription,
      MaintenanceStrategy,
      MaintenancePlanCategory,
      MaintenancePlanCallObject,
      MaintItemCausesAreDisplayed,
      MaintItemReasonsAreDisplayed,

      -- Maintenance Plan
      MaintenancePlan,
      MaintenancePlanItemPosition,

      cast( case MaintenancePlan when '' then ''
            else case MaintenanceStrategy
                 when '' then case _MaintenancePlan.MaintPlanSchedgIndicator
                              when '3' then 'SINGLE PER'
                              when '4' then 'MULTI COUN'
                              else 'SINGLE TIM' end
                 else 'STRATEGY' end end as eams_mplan_type preserving type)                              as MaintenancePlanType,


      -- Reference Object
      cast (FunctionalLocation as tplnr_unconverted  preserving type)                                     as FunctionalLocation,
      _FunctionalLocationLabel.FunctionalLocationLabelName                                                as FunctionalLocationLabelName,
      Equipment,
      Assembly,

      -- Tech Object
      cast( case when Equipment <> ''          then 'EAMS_EQUI'
                 when FunctionalLocation <> '' then 'EAMS_FL'
                 else '' end as eams_tec_obj_type_value )                                                 as TechObjIsEquipOrFuncnlLoc,

      cast( case when Equipment <> '' then Equipment
                 else FunctionalLocation end as eams_tec_obj )                                            as TechnicalObject,

      cast( case when Equipment <> '' then Equipment
            else case when FunctionalLocation <> ''
                      then _FunctionalLocationLabel.FunctionalLocationLabelName
                      else ''  end end as eams_tech_obj_alpha_conv preserving type )                      as TechnicalObjectLabel,

      @Semantics.text: true
      cast( case when Equipment <> ''
                 then _EquipmentText[1:Language = $session.system_language].EquipmentName
                 else case when FunctionalLocation <> ''
                           then _FunctionalLocationText[1:Language = $session.system_language].FunctionalLocationName
                           else '' end end as eams_tec_obj_des preserving type )                          as TechnicalObjectDescription,


      -- Reference Object

      cast(
       case when MaintenancePlanCallObject <> '5' then ''
            else case when Equipment <> ''          then 'EAMS_EQUI'
                      when FunctionalLocation <> '' then 'EAMS_FLOC'
                      when Product <> ''            then 'EAMS_PROD'
                      else '' end end as eam_maintitmrefobjtypeforsrvc )                                  as MaintItemRefObjTypeForService,

      cast( case when Equipment <> ''          then 'EAMS_EQUI'
                 when FunctionalLocation <> '' then 'EAMS_FLOC'
                 when Assembly <> ''           then 'EAMS_ASSY'
                 else ' '   end as eam_maintitemrefobjecttype )                                           as MaintItemReferenceObjectType,

      cast( case when Equipment <> ''          then Equipment
                 when FunctionalLocation <> '' then _FunctionalLocationLabel.FunctionalLocationLabelName
                 when Assembly <> ''           then Assembly
                 when Product <> ''            then Product
                 else ' ' end as  eam_maintitemreferenceobject preserving type )                          as MaintenanceItemReferenceObject,

      @Semantics.text: true
      cast( case when Equipment <> ''          then _EquipmentText[1:Language = $session.system_language].EquipmentName
                 when FunctionalLocation <> '' then _FunctionalLocationText[1:Language = $session.system_language].FunctionalLocationName
                 when Assembly <> ''           then _Assembly._Text[1:Language = $session.system_language].MaterialName
                 when Product <> ''            then _Product._Text[1:Language = $session.system_language].ProductName
                 else '' end as eam_maintitemrefobjdescription preserving type )                          as MaintItemRefObjectDescription,

      -- Maintenance Item Object List
      @Semantics.booleanIndicator: true
      case MaintenanceItemObjectList  when 0 then '' else 'X' end                                         as MaintItemHasObjectList,

      MaintenanceItemObjectList,

      -- Task List
      TaskListType,
      TaskListGroup,
      TaskListGroupCounter,
      OperationSystemCondition,
      NumberOfTaskListExecutions,
      $session.system_date                                                                                as TaskListKeyDate,

      -- Task List Group
      case TaskListType
        when '' then ''
        else concat(
              concat(
                concat(
                  concat(TaskListType,'/'),
                  ltrim(TaskListGroup,'0')
                 ),'/'
                ), ltrim( TaskListGroupCounter,'0')
             ) end                                                                                        as TaskList,


      -- Planning Data
      MaintenancePlannerGroup,
      MaintenancePlanningPlant,
      MaintenanceOrderType,
      MaintenanceActivityType,
      WorkCenterTypeCode,
      MainWorkCenterInternalID,
      _MainWorkCenter.WorkCenter                                                                          as MainWorkCenter,
      _MainWorkCenter.Plant                                                                               as MainWorkCenterPlant,
      BusinessArea,
      ObjectInternalID,
      MaintPriority,

      AdditionalDeviceData,
      MaintPriorityType,
      NotificationType,
      ImmediateReleaseIsBlocked,

      @Semantics.booleanIndicator: true
      MaintenanceItemHasLongText,
      @Semantics.booleanIndicator: true
      SettlementRuleIsMaintained,
      @Semantics.booleanIndicator: true
      MaintNotifTskIsAutomlyDtmnd,

      Material,
      cast( SerialNumber as eam_serialnumber preserving type )                                            as SerialNumber,


      -- Service Document
      ServiceDocumentType,
      ServiceContract,
      ServiceContractItem,
      ServiceOrderTemplate,
      ServiceDocumentPriority,
      Product,
      MaintCmplncCalculationMethod,
      MaintCmplncStrtDteOffsetInDays,
      MaintCmplncEndDateOffsetInDays,

      -- Location
      MaintObjectLocAcctAssgmtNmbr,
      MaintObjLocAcctAssgmtIsIndiv,
      _LocationAccountAssignment.MaintenancePlant,
      _LocationAccountAssignment.AssetLocation,
      _LocationAccountAssignment.AssetRoom,
      _LocationAccountAssignment.PlantSection,
      @Semantics.text: true
      concat_with_space( _LocationAccountAssignment._PlantSection.PlantSectionPersonRespName,
                         _LocationAccountAssignment._PlantSection.PlantSectionPersonRespPhone, 1 )        as PlantSectionDesc,
      _LocationAccountAssignment._WorkCenter.WorkCenter,
      _LocationAccountAssignment.WorkCenterInternalID,
      _LocationAccountAssignment.WorkCenterTypeCode                                                       as LocAcctAssgmtWorkCtrTypeCode,
      _LocationAccountAssignment.ABCIndicator,
      _LocationAccountAssignment.MaintObjectFreeDefinedAttrib,

      -- Account Assignment
      _LocationAccountAssignment.CompanyCode,
      _LocationAccountAssignment.MasterFixedAsset,
      _LocationAccountAssignment.FixedAsset,
      _LocationAccountAssignment.BusinessArea                                                             as LocAcctAssgmtBusinessArea,
      _LocationAccountAssignment.CostCenter,
      _LocationAccountAssignment.ControllingArea,
      cast( _LocationAccountAssignment._WBSElementBasicData.WBSElement as ps_posid_edit preserving type ) as WBSElement,
      cast( _LocationAccountAssignment.WBSElementInternalID as ps_s4_pspnr preserving type )              as WBSElementInternalID,
      _LocationAccountAssignment.StandingOrderNumber,
      _LocationAccountAssignment.SettlementOrder,

      -- Others
      CycleSetSequence,
      _MaintenancePlanCatParam.OrderCategoryScreenTypeCode,

      -- Admin Data
      @Semantics.user.createdBy: true
      CreatedByUser,
      @Semantics.systemDate.createdAt: true
      CreationDate,
      @Semantics.systemDate.lastChangedAt: true
      LastChangeDate,
      @Semantics.user.lastChangedBy: true
      LastChangedByUser,
      @Semantics.systemDateTime.lastChangedAt: true
      cast( LastChangeDateTime as tzntstmps )                                                             as LastChangeDateTime,

      /* Local Association */
      _EquipmentText,
      _FunctionalLocationText,
      _FunctionalLocationLabel,
      _ServiceDocumentTypeText,
      _ServiceDocumentPriorityText,
      _ServiceTemplate,
      _TechObjIsEquipOrFuncnlLocDesc,
      _ReferenceObjectTypeText,
      _RefObjectTypeForSrvcText,
      _CreatedByUser,
      _LastChangedByUser,

      /* Association */
      _FunctionalLocation,
      _LocationAccountAssignment,
      _LocationAccountAssignment._BusinessArea                                                            as _LocAcctAssgmtBusinessArea,
      _MaintenancePlannerGroup,
      _MaintenancePlanningPlant,
      _MaintenancePlan,
      _MaintenancePlanType,
      _MaintenancePlanStatus,
      _MaintPlanCallObjectText,
      _MaintenancePlanCatParam,
      _MainWorkCenter,
      _MaintenanceStrategy,
      _PMNotificationPriority,
      _GenericPriority,
      _PMNotificationPriorityType,
      _Equipment,
      _MaintenanceTaskList,
      _MaintTaskListForKeyDate,
      _TaskListType,
      _TaskListGroup,
      _TaskListGroupCounter,
      _MaintOperationSystCondition,
      _MaintenanceActivityType,
      _MaintenanceOrderType,
      _Assembly,
      _PMNotificationType,
      _Material,
      _MaintenanceItemObject,
      _MaintOrderTypeControlParam,
      _BusinessArea,
      _ImmediateReleaseIsBlocked,
      _ServiceDocumentType,
      _Product,
      _ServiceContract,
      _ServiceContractItem,
      _LocationAccountAssignment._ABCIndicator,
      _LocationAccountAssignment._SettlementOrder,
      _LocationAccountAssignment._StandingOrderNumber,
      _LocationAccountAssignment._MasterFixedAsset,

      /* Composition */
      _MaintItemObjectListItem,
      _MaintenanceItemReason,
      _MaintenanceItemCause,
      _LongText

}
where
     MaintenancePlanCallObject = ' '
  or MaintenancePlanCallObject = '2'
  or MaintenancePlanCallObject = '5'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EQUIPMENTTEXT",
"I_FUNCTIONALLOCATIONLABEL",
"I_FUNCTIONALLOCATIONTEXT",
"I_LOCATIONACCOUNTASSIGNMENT",
"I_MAINTENANCEITEM",
"I_MAINTENANCEPLANBASIC",
"I_MAINTENANCEPLANCATPARAM",
"I_MATERIAL",
"I_MATERIALTEXT",
"I_PLANTSECTION",
"I_PRODUCT",
"I_PRODUCTTEXT",
"I_WBSELEMENTBASICDATA",
"I_WORKCENTER"
],
"ASSOCIATED":
[
"I_ABCINDICATOR",
"I_BILLOFOPERATIONS",
"I_BILLOFOPERATIONSGROUP",
"I_BUSINESSAREA",
"I_EQUIPMENT",
"I_EQUIPMENTTEXT",
"I_FUNCTIONALLOCATION",
"I_FUNCTIONALLOCATIONLABEL",
"I_FUNCTIONALLOCATIONTEXT",
"I_GENERICPRIORITY",
"I_INDICATOR",
"I_LOCATIONACCOUNTASSIGNMENT",
"I_MAINTENANCEACTIVITYTYPE",
"I_MAINTENANCEITEMOBJECT",
"I_MAINTENANCEORDER",
"I_MAINTENANCEPLANBASIC",
"I_MAINTENANCEPLANCATPARAM",
"I_MAINTENANCEPLANNERGROUP",
"I_MAINTENANCEPLANSTATUS",
"I_MAINTENANCEPLANTYPE",
"I_MAINTENANCESTRATEGY",
"I_MAINTENANCETASKLIST",
"I_MAINTENANCETASKLISTTYPE",
"I_MAINTITEMREFOBJECTTYPETEXT",
"I_MAINTITMREFOBJTYPEFORSRVCTXT",
"I_MAINTOPERATIONSYSTCONDITION",
"I_MAINTORDERTYPECONTROLPARAM",
"I_MAINTPLANCALLOBJECTTEXT",
"I_MAINTTASKLISTFORKEYDATE",
"I_MASTERFIXEDASSET",
"I_MATERIAL",
"I_ORDER",
"I_ORDERTYPE",
"I_PLANT",
"I_PMNOTIFICATIONPRIORITY",
"I_PMNOTIFICATIONPRIORITYTYPE",
"I_PMNOTIFICATIONTYPE",
"I_PRODUCT",
"I_SERVICEDOCUMENT",
"I_SERVICEDOCUMENTITEM",
"I_SERVICEDOCUMENTPRIORITYTEXT",
"I_SERVICEDOCUMENTTYPE",
"I_SERVICEDOCUMENTTYPETEXT",
"I_TECHOBJISEQUIPORFUNCNLLOCT",
"I_USER",
"I_WORKCENTER",
"R_MAINTENANCEITEMCAUSETP",
"R_MAINTENANCEITEMREASONTP",
"R_MAINTENANCEITEMTEXTTP",
"R_MAINTITEMOBJECTLISTITEMTP"
],
"BASE":
[
"I_LOCATIONACCOUNTASSIGNMENT",
"I_MAINTENANCEITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/