P_MaintNotifTechObjBreakdown

DDL: P_MAINTNOTIFTECHOBJBREAKDOWN SQL: PMNTOBD Type: view COMPOSITE

P_MaintNotifTechObjBreakdown is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_MaintenanceNotification) and exposes 43 fields with key field MaintenanceNotification. It has 2 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_MaintenanceNotification I_MaintenanceNotification from

Associations (2)

CardinalityTargetAliasCondition
[0..1] P_EquiFuncnlLocUnionBreakdown _TechnicalObject _TechnicalObject.TechnicalObject = $projection.TechnicalObject and _TechnicalObject.TechObjIsEquipOrFuncnlLoc = $projection.TechObjIsEquipOrFuncnlLoc
[0..1] I_TechObjIsEquipOrFuncnlLoc _TechObjIsEquipOrFuncnlLoc _TechObjIsEquipOrFuncnlLoc.TechObjIsEquipOrFuncnlLoc = $projection.TechObjIsEquipOrFuncnlLoc

Annotations (6)

NameValueLevelField
VDM.private true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.sqlViewName PMNTOBD view
AbapCatalog.compiler.compareFilter true view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (43)

KeyFieldSource TableSource FieldDescription
KEY MaintenanceNotification I_MaintenanceNotification MaintenanceNotification
NotificationText I_MaintenanceNotification NotificationText
FunctionalLocation
Equipment
MaintenanceOrder I_MaintenanceNotification MaintenanceOrder
MaintPriority I_MaintenanceNotification MaintPriority
MaintPriorityType I_MaintenanceNotification MaintPriorityType
NotifProcessingPhase I_MaintenanceNotification NotifProcessingPhase
NotificationType I_MaintenanceNotification NotificationType
MaintenanceWorkCenterPlant I_MaintenanceNotification MaintenanceWorkCenterPlant
WorkCenterInternalID I_MaintenanceNotification WorkCenterInternalID
WorkCenterTypeCode I_MaintenanceNotification WorkCenterTypeCode
MaintenancePlant
MalfunctionStartDate
MalfunctionStartTime
MalfunctionEndDate
MalfunctionEndTime
MaintenanceObjectIsDown
MaintObjectDowntimeDuration
MaintObjDowntimeDurationUnit
NotificationCreationDate I_MaintenanceNotification NotificationCreationDate
NotificationCreationTime I_MaintenanceNotification NotificationCreationTime
NotificationReferenceDate I_MaintenanceNotification NotificationReferenceDate
NotificationReferenceTime I_MaintenanceNotification NotificationReferenceTime
NotificationCompletionDate I_MaintenanceNotification NotificationCompletionDate
CompletionTime I_MaintenanceNotification NotificationCompletionTime
CreationDate I_MaintenanceNotification CreationDate
CreationTime I_MaintenanceNotification CreationTime
NotificationTimeZone I_MaintenanceNotification NotificationTimeZone
IsDeleted I_MaintenanceNotification IsDeleted
_FunctionalLocation
_Equipment
_TechnicalObject _TechnicalObject
_TechObjIsEquipOrFuncnlLoc _TechObjIsEquipOrFuncnlLoc
_IsDeleted I_MaintenanceNotification _IsDeleted
_MaintenanceOrder I_MaintenanceNotification _MaintenanceOrder
_PMNotifMaintenanceData I_MaintenanceNotification _PMNotifMaintenanceData
_PMNotificationPriority I_MaintenanceNotification _PMNotificationPriority
_PMNotificationPriorityType I_MaintenanceNotification _PMNotificationPriorityType
_MainWorkCenter I_MaintenanceNotification _MainWorkCenter
_WorkCenterType I_MaintenanceNotification _WorkCenterType
_PMNotificationPhase I_MaintenanceNotification _PMNotificationPhase
_MaintenanceWorkCenterPlant I_MaintenanceNotification _MaintenanceWorkCenterPlant
@VDM.private: true
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AbapCatalog.sqlViewName: 'PMNTOBD'
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
//@ObjectModel.representativeKey: [ 'TechnicalObject' ]

@ObjectModel.semanticKey:  [ 'TechnicalObject', 'TechObjIsEquipOrFuncnlLoc' ]

define view P_MaintNotifTechObjBreakdown
  as select from I_MaintenanceNotification
  association [0..1] to P_EquiFuncnlLocUnionBreakdown 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

{
      @ObjectModel.text.element:  [ 'NotificationText' ]
  key I_MaintenanceNotification.MaintenanceNotification,
      @Semantics.text: true
      I_MaintenanceNotification.NotificationText,

      @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'
      case when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment != '' then
                  cast ( 'EAMS_EQUI' as eams_tec_obj_type_value_ltext)
           when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment = '' and
                I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment.FunctionalLocation != '' then
                  cast ( 'EAMS_FL' as eams_tec_obj_type_value_ltext)
      end                                                  as TechObjIsEquipOrFuncnlLoc,

      @ObjectModel.foreignKey.association: '_FunctionalLocation'
      I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment.FunctionalLocation,
      @ObjectModel.foreignKey.association: '_Equipment'
      I_MaintenanceNotification._PMNotifMaintenanceData.Equipment,
      @ObjectModel.foreignKey.association: '_MaintenanceOrder'
      I_MaintenanceNotification.MaintenanceOrder,

      @ObjectModel.foreignKey.association: '_PMNotificationPriority'
      I_MaintenanceNotification.MaintPriority,
      @ObjectModel.foreignKey.association: '_PMNotificationPriorityType'
      I_MaintenanceNotification.MaintPriorityType,
      @ObjectModel.foreignKey.association: '_PMNotificationPhase'
      I_MaintenanceNotification.NotifProcessingPhase,

      I_MaintenanceNotification.NotificationType,

      @ObjectModel.foreignKey.association: '_MaintenanceWorkCenterPlant'
      I_MaintenanceNotification.MaintenanceWorkCenterPlant,
      @ObjectModel.foreignKey.association: '_MainWorkCenter'
      I_MaintenanceNotification.WorkCenterInternalID,
      @ObjectModel.foreignKey.association: '_WorkCenterType'
      I_MaintenanceNotification.WorkCenterTypeCode,
      I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment.MaintenancePlant,
      I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartDate,
      I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartTime,

      I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEndDate,
      I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEndTime,

      I_MaintenanceNotification._PMNotifMaintenanceData.MaintenanceObjectIsDown,

      I_MaintenanceNotification._PMNotifMaintenanceData.MaintObjectDowntimeDuration,
      I_MaintenanceNotification._PMNotifMaintenanceData.MaintObjDowntimeDurationUnit,

      I_MaintenanceNotification.NotificationCreationDate,
      @Semantics.time: true
      I_MaintenanceNotification.NotificationCreationTime,
      I_MaintenanceNotification.NotificationReferenceDate,
      @Semantics.time: true
      I_MaintenanceNotification.NotificationReferenceTime,
      I_MaintenanceNotification.NotificationCompletionDate,
      @Semantics.time: true
      I_MaintenanceNotification.NotificationCompletionTime as CompletionTime,

      I_MaintenanceNotification.CreationDate,
      @Semantics.time: true
      I_MaintenanceNotification.CreationTime,

      I_MaintenanceNotification.NotificationTimeZone,

      @ObjectModel.foreignKey.association: '_IsDeleted'
      I_MaintenanceNotification.IsDeleted,

      case when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment != ''
              then I_MaintenanceNotification._PMNotifMaintenanceData._Equipment.OperationStartDate
           when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment = '' and I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment.FunctionalLocation != ''
              then I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment._FunctionalLocation.OperationStartDate
           end                                             as OperationStartDate,

//      case when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment != ''

//                   then  cast(cast( concat (I_MaintenanceNotification._PMNotifMaintenanceData._Equipment.OperationStartDate,

//                                           '000000' ) as abap.numc(14)) as abap.dec(14, 0))

//

//                when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment = '' and I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment.FunctionalLocation != ''

//                   then  cast(cast( concat (I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment._FunctionalLocation.OperationStartDate,

//                                           '000000' ) as abap.numc(14)) as abap.dec(14, 0))

//                end                                        as OperationStartDateTime,


   case when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment != ''
                   then  dats_tims_to_tstmp(I_MaintenanceNotification._PMNotifMaintenanceData._Equipment.OperationStartDate,
                                           '000000',
                                           NotificationTimeZone,
                                           $session.client,
                                           'NULL' )
//

   else case  when I_MaintenanceNotification._PMNotifMaintenanceData.Equipment = '' and I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment.FunctionalLocation != ''
                  then  dats_tims_to_tstmp(I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment._FunctionalLocation.OperationStartDate,
                                           '000000',
                                           NotificationTimeZone,
                                           $session.client,
                                           'NULL' )
                                            else
                    cast( 0 as timestamp)
                                           end
                end                                        as OperationStartDateTime,

      case when I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartDate != '00000000'
              then dats_tims_to_tstmp(I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartDate,
                                      I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartTime,
                                      NotificationTimeZone,
                                      $session.client,
                                      'NULL' )
              else case when NotificationCreationDate != '00000000'
                        then dats_tims_to_tstmp(NotificationCreationDate,
                                                NotificationCreationTime,
                                                NotificationTimeZone,
                                                $session.client,
                                                'NULL')
                 end
      end                                                  as MalfunctionStartDateTime,

      case when I_MaintenanceNotification._PMNotifMaintenanceData.MaintObjectDowntimeDuration != 0
             then tstmp_add_seconds(
                    dats_tims_to_tstmp(I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartDate,
                                        I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionStartTime,
                                        NotificationTimeZone,
                                        $session.client,
                                        'NULL' ),
                    FLTP_TO_DEC(I_MaintenanceNotification._PMNotifMaintenanceData.MaintObjectDowntimeDuration as abap.dec( 31, 0 )),'NULL')
             else case when I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEndDate != '00000000'
                        then dats_tims_to_tstmp(I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEndDate,
                                                I_MaintenanceNotification._PMNotifMaintenanceData.MalfunctionEndTime,
                                                NotificationTimeZone,
                                                $session.client,
                                                'NULL')
                  else
                    cast( 0 as timestamp)
                  end
       end                                                 as MalfunctionEndDateTime,

      /* Associations */
      I_MaintenanceNotification._PMNotifMaintenanceData._LocationAccountAssignment._FunctionalLocation,
      I_MaintenanceNotification._PMNotifMaintenanceData._Equipment,
      _TechnicalObject,
      _TechObjIsEquipOrFuncnlLoc,
      I_MaintenanceNotification._IsDeleted,
      I_MaintenanceNotification._MaintenanceOrder,
      I_MaintenanceNotification._PMNotifMaintenanceData,
      I_MaintenanceNotification._PMNotificationPriority,
      I_MaintenanceNotification._PMNotificationPriorityType,
      I_MaintenanceNotification._MainWorkCenter,
      I_MaintenanceNotification._WorkCenterType,
      I_MaintenanceNotification._PMNotificationPhase,
      I_MaintenanceNotification._MaintenanceWorkCenterPlant

}