@EndUserText.label: 'Maintenance Notification Tech. Object'
--@Analytics: { dataCategory: #DIMENSION }
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@AbapCatalog.sqlViewName: 'IMAINTNTFTECOBJ'
@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true
@ObjectModel.representativeKey: 'MaintenanceNotification'
@ObjectModel.semanticKey: [ 'MaintenanceNotification' ]
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
// Basic view on top of Maintenance Notification which also links to the assigned Technical Object
// QMEL, QMIH, ILOA
@ObjectModel.entityChangeStateId: 'LastChangeDateTime'
define view I_MaintNotificationTechObj
as select from I_MaintenanceNotification
association [0..1] to I_TechnicalObject as _TechnicalObject on _TechnicalObject.TechnicalObject = $projection.TechnicalObject
and _TechnicalObject.TechObjIsEquipOrFuncnlLoc = $projection.TechObjIsEquipOrFuncnlLoc
association [0..1] to I_TechObjIsEquipOrFuncnlLoc as _TechObjIsEquipOrFuncnlLoc on _TechObjIsEquipOrFuncnlLoc.TechObjIsEquipOrFuncnlLoc = $projection.TechObjIsEquipOrFuncnlLoc
association [0..*] to I_MaintNotifItemTechObj as _MaintenanceNotificationItem on _MaintenanceNotificationItem.MaintenanceNotification = $projection.MaintenanceNotification
association [0..*] to I_MaintNotifActivityTechObj as _MaintNotificationActivity on _MaintNotificationActivity.MaintenanceNotification = $projection.MaintenanceNotification
association [0..*] to I_MaintNotifTaskTechObj as _MaintenanceNotificationTask on _MaintenanceNotificationTask.MaintenanceNotification = $projection.MaintenanceNotification
association [0..1] to I_MaintNotifLongText as _MaintNotifLongText on _MaintNotifLongText.MaintenanceNotification = $projection.MaintenanceNotification
association [0..1] to I_MaintenanceItemTechObj as _MaintenanceItemTechObj on _MaintenanceItemTechObj.MaintenanceItem = $projection.maintenanceitem
association [0..1] to I_PMContactCardUser as _PMContactCardUser on _PMContactCardUser.UserID = $projection.ReportedByUser
association [0..1] to I_WorkforcePerson as _MaintNotifPersonResponsible on _MaintNotifPersonResponsible.PersonExternalID = $projection.PersonResponsible
association [0..1] to I_FunctionalLocationLabel as _FunctionalLocationLabel on _FunctionalLocationLabel.FunctionalLocation = $projection.functionallocation
association [1..1] to I_NotificationType as _NotificationType on $projection.NotificationType = _NotificationType.NotificationType
association [0..1] to I_UserDescription as _UserDescription on _UserDescription.UserID = $projection.ReportedByUser
association [0..1] to I_OrdMstrData as _MaintOrdMstrData on _MaintOrdMstrData.OrderID = $projection.MaintenanceOrder
{
@ObjectModel.text.element: [ 'NotificationText' ]
key I_MaintenanceNotification.MaintenanceNotification,
@ObjectModel.foreignKey.association: '_TechnicalObject'
case when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment != '' then
cast( I_MaintenanceNotification._PMNotifMaintenanceData.Equipment as eams_tec_obj )
when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment = '' and
I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment.FunctionalLocation != '' then
cast( I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment.FunctionalLocation as eams_tec_obj)
end as TechnicalObject,
@ObjectModel.foreignKey.association: '_TechObjIsEquipOrFuncnlLoc'
@UI.textArrangement: #TEXT_ONLY
case when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment != '' then
cast ( 'EAMS_EQUI' as eams_tec_obj_type_value)
when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment = '' and
I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment.FunctionalLocation != '' then
cast ( 'EAMS_FL' as eams_tec_obj_type_value)
end as TechObjIsEquipOrFuncnlLoc,
@ObjectModel.foreignKey.association: '_PMNotificationPriority'
I_MaintenanceNotification.MaintPriority,
@ObjectModel.foreignKey.association: '_PMNotificationPriorityType'
I_MaintenanceNotification.MaintPriorityType,
@ObjectModel.foreignKey.association: '_PMNotificationType'
I_MaintenanceNotification.NotificationType,
@ObjectModel.foreignKey.association: '_PMNotificationPhase'
I_MaintenanceNotification.NotifProcessingPhase,
@Semantics.user.createdBy: true
I_MaintenanceNotification.CreatedByUser,
@Semantics.user.lastChangedBy: true
I_MaintenanceNotification.LastChangedByUser,
case _PMNotifMaintenanceData.MaintenanceTaskListType
when '' then ''
else concat(
concat(
concat(
concat(_PMNotifMaintenanceData.MaintenanceTaskListType,'/'),
ltrim(_PMNotifMaintenanceData.TaskListGroup,'0')
),'/'
), ltrim( _PMNotifMaintenanceData.TaskListGroupCounter,'0')
) end as TaskList,
case LastChangeTime when '240000'
then dats_add_days(I_MaintenanceNotification.LastChangeDate,1,'NULL')
else I_MaintenanceNotification.LastChangeDate
end as LastChangeDate, //Last Change Date
@Semantics.time: true
case LastChangeTime when '240000'
then '000000'
else I_MaintenanceNotification.LastChangeTime
end as LastChangeTime, //Last Change Time
case CreationTime when '240000'
then dats_add_days(I_MaintenanceNotification.CreationDate,1,'NULL')
else I_MaintenanceNotification.CreationDate
end as CreationDate, //Creation Date
@Semantics.time: true
case CreationTime when '240000'
then '000000'
else I_MaintenanceNotification.CreationTime
end as CreationTime, //Creation Time
@Semantics.systemDateTime.lastChangedAt: true
I_MaintenanceNotification.LastChangeDateTime,
I_MaintenanceNotification.CreationDateTime,
I_MaintenanceNotification.ReportedByUser,
_PMNotifMaintenanceData.NotificationPersonResponsible as PersonResponsible,
case when _UserDescription.UserDescription is not null and _UserDescription.UserDescription != '' then cast ( _UserDescription.UserDescription as ad_namtext )
when _UserDescription.UserID is not null and _UserDescription.UserID != '' then _UserDescription.UserID
when ReportedByUser is not null and ReportedByUser != '' then ReportedByUser end as ReporterFullName,
@Semantics.text: true
I_MaintenanceNotification.NotificationText,
@ObjectModel.foreignKey.association: '_MaintenanceOrder'
I_MaintenanceNotification.MaintenanceOrder,
case RequiredStartTime when '240000'
then dats_add_days(I_MaintenanceNotification.RequiredStartDate,1,'NULL')
else I_MaintenanceNotification.RequiredStartDate
end as RequiredStartDate, //Required Start Date
@Semantics.time: true
case RequiredStartTime when '240000'
then '000000'
else I_MaintenanceNotification.RequiredStartTime
end as RequiredStartTime, // Required Start Time
case RequiredEndTime when '240000'
then dats_add_days(I_MaintenanceNotification.RequiredEndDate,1,'NULL')
else I_MaintenanceNotification.RequiredEndDate
end as RequiredEndDate, //Required End Date
@Semantics.time: true
case RequiredEndTime when '240000'
then '000000'
else I_MaintenanceNotification.RequiredEndTime
end as RequiredEndTime, //Required End Time
case NotificationReferenceTime when '240000'
then dats_add_days(I_MaintenanceNotification.NotificationReferenceDate,1,'NULL')
else I_MaintenanceNotification.NotificationReferenceDate
end as NotificationReferenceDate, //Reference Date
@Semantics.time: true
case NotificationReferenceTime when '240000'
then '000000'
else I_MaintenanceNotification.NotificationReferenceTime
end as NotificationReferenceTime, //Reference Time
case NotificationCompletionTime when '240000'
then dats_add_days(I_MaintenanceNotification.NotificationCompletionDate,1,'NULL')
else I_MaintenanceNotification.NotificationCompletionDate
end as NotificationCompletionDate, //Completion Date
@Semantics.time: true
case NotificationCompletionTime when '240000'
then '000000'
else I_MaintenanceNotification.NotificationCompletionTime
end as CompletionTime, //Completion Time
case NotificationCreationTime when '240000'
then dats_add_days(I_MaintenanceNotification.NotificationCreationDate,1,'NULL')
else I_MaintenanceNotification.NotificationCreationDate
end as NotificationCreationDate, // Notification Creation Date
@Semantics.time: true
case NotificationCreationTime when '240000'
then '000000'
else I_MaintenanceNotification.NotificationCreationTime
end as NotificationCreationTime, //Notification Creation Time
I_MaintenanceNotification.MaintNotifInternalID,
I_MaintenanceNotification.NotificationTimeZone,
@ObjectModel.foreignKey.association: '_MainWorkCenter'
I_MaintenanceNotification.WorkCenterInternalID,
@ObjectModel.foreignKey.association: '_WorkCenterType'
I_MaintenanceNotification.WorkCenterTypeCode,
@ObjectModel.foreignKey.association: '_MaintenanceWorkCenterPlant'
I_MaintenanceNotification.MaintenanceWorkCenterPlant,
@ObjectModel.foreignKey.association: '_MaintNotificationCatalog'
I_MaintenanceNotification.MaintNotificationCatalog,
@ObjectModel.foreignKey.association: '_MaintNotificationCode'
I_MaintenanceNotification.MaintNotificationCode,
@ObjectModel.foreignKey.association: '_MaintNotificationCodeGroup'
I_MaintenanceNotification.MaintNotificationCodeGroup,
@ObjectModel.foreignKey.association: '_IsDeleted'
I_MaintenanceNotification.IsDeleted,
@ObjectModel.foreignKey.association: '_IsCompleted'
I_MaintenanceNotification.IsCompleted,
I_MaintenanceNotification.CatalogProfile,
I_MaintenanceNotification.NotificationOrigin,
_PMNotifMaintenanceData.MaintenanceTaskListType as MaintenanceTaskListType,
_PMNotifMaintenanceData.TaskListGroup as TaskListGroup,
_PMNotifMaintenanceData.TaskListGroupCounter as TaskListGroupCounter,
//payal
// QMIH fields
@ObjectModel.foreignKey.association: '_MalfunctionEffect'
I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEffect,
I_MaintenanceNotification._PMNotifMaintenanceData.LocationDescription,
case I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartTime when '240000'
then dats_add_days(I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartDate,1,'NULL')
else I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartDate
end as MalfunctionStartDate, //Malfunction Start Date
@Semantics.time: true
case I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartTime when '240000'
then '000000'
else I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartTime
end as MalfunctionStartTime, //Malfunction Start Time
case I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEndTime when '240000'
then dats_add_days(I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEndDate,1,'NULL')
else I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEndDate
end as MalfunctionEndDate, //Malfunction End Date
@Semantics.time: true
case I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEndTime when '240000'
then '000000'
else I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEndTime
end as MalfunctionEndTime, //Malfunction End Time
I_MaintenanceNotification._PMNotifMaintenanceData.MaintenanceObjectIsDown,
I_MaintenanceNotification._PMNotifMaintenanceData.MaintObjectDowntimeDuration,
I_MaintenanceNotification._PMNotifMaintenanceData.MaintObjDowntimeDurationUnit,
@ObjectModel.foreignKey.association: '_FunctionalLocation'
I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment.FunctionalLocation,
@ObjectModel.foreignKey.association: '_Equipment'
I_MaintenanceNotification._PMNotifMaintenanceData.Equipment,
@ObjectModel.foreignKey.association: '_MaintenanceItemTechObj'
I_MaintenanceNotification._PMNotifMaintenanceData.MaintenanceItem,
I_MaintenanceNotification._PMNotifMaintenanceData.MaintenancePlan,
I_MaintenanceNotification._PMNotifMaintenanceData.MaintenanceActivityType,
cast('' as pm_source_appl) as MaintNotifSourceApplication, // transient for now
NotificationHasLongText,
// IME: 2002 LACD
I_MaintenanceNotification._PMNotifMaintenanceData.LatestAcceptableCompletionDate,
I_MaintenanceNotification._PMNotifMaintenanceData.PreviousFinalDueDate,
// IME: 2002 LACD
I_MaintenanceNotification.MaintNotifExtReferenceNumber,
I_MaintenanceNotification._PMNotifMaintenanceData.MaintObjectLocAcctAssgmtNmbr,
cast( round( unit_conversion(
quantity => I_MaintenanceNotification._PMNotifMaintenanceData.MaintObjectDowntimeDuration,
source_unit => cast('S' as maueh),
target_unit => I_MaintenanceNotification._PMNotifMaintenanceData.MaintObjDowntimeDurationUnit,
error_handling=> 'SET_TO_NULL'
) , 2) as eauszt ) as MaintNotifDowntimeDuration,
/* Associations */
I_MaintenanceNotification._CreatedByUser,
I_MaintenanceNotification._IsCompleted,
I_MaintenanceNotification._IsDeleted,
I_MaintenanceNotification._StatusObject,
I_MaintenanceNotification._LastChangedByUser,
_MaintenanceNotificationItem, // #COMPOSITE
I_MaintenanceNotification._MaintenanceOrder,
I_MaintenanceNotification._MaintenanceWorkCenterPlant,
_MaintNotificationActivity, // #COMPOSITE
_MaintenanceNotificationTask, // #COMPOSITE
I_MaintenanceNotification._MaintNotificationCatalog,
I_MaintenanceNotification._MaintNotificationCode,
I_MaintenanceNotification._MaintNotificationCodeGroup,
I_MaintenanceNotification._MainWorkCenter,
I_MaintenanceNotification._PMNotificationPhase,
I_MaintenanceNotification._PMNotificationPriority,
I_MaintenanceNotification._PMNotificationPriorityType,
I_MaintenanceNotification._PMNotificationType,
I_MaintenanceNotification._PMNotifMaintenanceData,
I_MaintenanceNotification._ReportedByUser,
I_MaintenanceNotification._MaintenancePartner,
_MaintNotifLongText, // #COMPOSITE
_TechnicalObject,
_TechObjIsEquipOrFuncnlLoc,
_MaintenanceItemTechObj,
// _TaskListSimplDesc,
I_MaintenanceNotification._PMNotifMaintenanceData._MalfunctionEffect,
_FunctionalLocationLabel,
I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment._FunctionalLocation,
I_MaintenanceNotification._PMNotifMaintenanceData._Equipment,
_PMContactCardUser,
I_MaintenanceNotification._WorkCenterType,
I_MaintenanceNotification._StatusObjectActiveStatus,
_NotificationHasLongText,
_LinearAssetManagementData,
_MaintNotifPersonResponsible,
I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment,
_NotificationType,
_MaintOrdMstrData
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_LOCATIONACCOUNTASSIGNMENT",
"I_MAINTENANCENOTIFICATION",
"I_PMNOTIFMAINTENANCEDATA",
"I_USERDESCRIPTION"
],
"ASSOCIATED":
[
"I_EQUIPMENT",
"I_FUNCTIONALLOCATION",
"I_FUNCTIONALLOCATIONLABEL",
"I_INDICATOR",
"I_INSPECTIONCATALOG",
"I_INSPECTIONCODE",
"I_INSPECTIONCODEGROUP",
"I_LINEARASSETMANAGEMENTDATA",
"I_LOCATIONACCOUNTASSIGNMENT",
"I_MAINTENANCEITEMTECHOBJ",
"I_MAINTENANCEORDER",
"I_MAINTNOTIFACTIVITYTECHOBJ",
"I_MAINTNOTIFITEMTECHOBJ",
"I_MAINTNOTIFLONGTEXT",
"I_MAINTNOTIFTASKTECHOBJ",
"I_MALFUNCTIONEFFECT",
"I_NOTIFICATIONTYPE",
"I_ORDMSTRDATA",
"I_PLANT",
"I_PLANTMAINTENANCEPARTNER",
"I_PMCONTACTCARDUSER",
"I_PMNOTIFICATIONPHASE",
"I_PMNOTIFICATIONPRIORITY",
"I_PMNOTIFICATIONPRIORITYTYPE",
"I_PMNOTIFICATIONTYPE",
"I_PMNOTIFMAINTENANCEDATA",
"I_STATUSOBJECT",
"I_STATUSOBJECTACTIVESTATUS",
"I_TECHNICALOBJECT",
"I_TECHOBJISEQUIPORFUNCNLLOC",
"I_USER",
"I_USERDESCRIPTION",
"I_WORKCENTER",
"I_WORKCENTERTYPE",
"I_WORKFORCEPERSON"
],
"BASE":
[
"I_LOCATIONACCOUNTASSIGNMENT",
"I_MAINTENANCENOTIFICATION",
"I_PMNOTIFMAINTENANCEDATA"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/