@AbapCatalog.sqlViewName: 'CORDWFLINBOX'
@AccessControl.authorizationCheck: #CHECK
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Maintenance Order Workflow for My Inbox'
@VDM.viewType: #CONSUMPTION
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@AbapCatalog.preserveKey: true
@ObjectModel.representativeKey: 'MaintenanceOrder'
@ObjectModel.semanticKey: [ 'MaintenanceOrder' ]
@AccessControl.privilegedAssociations: [ '_MainWorkCenterText' , '_OrderTypeText', '_MaintenancePlannerGroup', '_MaterialText',
'_CostCenterText' ]
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
@Metadata.ignorePropagatedAnnotations:true
@UI: {
headerInfo: {
description: {
value: 'MaintenanceOrderDesc',
type: #STANDARD
},
title: {
value: 'MaintenanceOrder',
type: #STANDARD
},
typeName: 'Maintenance Order',
typeNamePlural: 'Maintenance Orders'
}}
define view C_MaintenanceOrderWrkflwInbox as select from I_MaintOrderTechObj
association [0..*] to I_OrderTypeText as _OrderTypeText on _OrderTypeText.OrderType = $projection.MaintenanceOrderType
association [0..1] to I_MaintenanceItemBasic as _MaintenanceItem on _MaintenanceItem.MaintenanceItem = $projection.MaintenanceItem
association [0..*] to I_ProductionResourceText as _MainWorkCenterText on _MainWorkCenterText.ProductionResourceType = 'A'
and _MainWorkCenterText.ProductionResourceInternalID = $projection.WorkCenterInternalID
association [0..1] to I_FunctionalLocationLabel as _FunctionalLocationLabel on _FunctionalLocationLabel.FunctionalLocation = $projection.FunctionalLocation
association [0..1] to I_FunctionalLocationText as _FunctionalLocationText on _FunctionalLocationText.FunctionalLocation = $projection.FunctionalLocation
and _FunctionalLocationText.Language = $session.system_language
association [0..1] to I_EquipmentText as _EquipmentText on _EquipmentText.Equipment = $projection.Equipment
and _EquipmentText.Language = $session.system_language
association [0..*] to I_ProductText as _MaterialText on _MaterialText.Product = $projection.material
association [0..*] to I_CostCenterText as _CostCenterText on _CostCenterText.ControllingArea = $projection.controllingarea
and _CostCenterText.CostCenter = $projection.LocAcctAssgmtCostCenter
and _CostCenterText.ValidityEndDate = '99991231'
association [0..*] to C_ObjPgMaintOrderCost as _MaintOrderCost on _MaintOrderCost.MaintenanceOrderInternalID = $projection.MaintenanceOrderInternalID
association [1..1] to C_ObjPgMaintOrderCostAggrgData as _MaintOrderCostAggrg on _MaintOrderCostAggrg.MaintenanceOrderInternalID = $projection.MaintenanceOrderInternalID
{
// Following UI.Facet annotation is needed to visualize the data in My Inbox app
@UI.facet: [
{ label:'General Information',
id:'GeneralInformation',
type: #COLLECTION,
isSummary,
position: 10
},{
label: 'Basic Data',
id: 'BasicData',
parentId: 'GeneralInformation',
type: #IDENTIFICATION_REFERENCE,
position: 10
},
{
label: 'General Data',
id: 'General',
parentId: 'GeneralInformation',
type: #FIELDGROUP_REFERENCE,
position: 20,
targetQualifier: 'General'
},{
label: 'Responsibilities',
id: 'Responsibilities',
parentId: 'GeneralInformation',
type: #FIELDGROUP_REFERENCE,
position: 30,
targetQualifier: 'Responsibilities'
},{
label: 'Technical Object',
id: 'TechnicalObject',
type: #FIELDGROUP_REFERENCE,
parentId: 'GeneralInformation',
position: 40,
targetQualifier: 'TechnicalObject'
},{
label: 'Dates',
id: 'Dates',
type: #FIELDGROUP_REFERENCE,
parentId: 'GeneralInformation',
position: 50,
targetQualifier: 'Dates'
},{
label: 'Costs',
id: 'Costs',
type: #FIELDGROUP_REFERENCE,
parentId: 'GeneralInformation',
position: 60,
targetQualifier: 'Costs'
},{
label: 'Account Assignment',
id: 'AccAssignment',
type: #FIELDGROUP_REFERENCE,
parentId: 'GeneralInformation',
position: 70,
targetQualifier: 'AccAssignment'
},
{
label: 'Items and Costs',
id: 'Items',
type: #LINEITEM_REFERENCE,
position: 30,
targetElement: '_MaintOrderCost',
targetQualifier: 'MyInbox_Items'
}]
/************ Basic data ******************/
@UI: { identification: {position: 10, importance: #HIGH} }
@Consumption.semanticObject: 'MaintenanceOrder'
key MaintenanceOrder,
@UI.hidden: true
cast( MaintenanceOrder as abap.char( 12 ) ) as MaintOrderWithLeadingZeros,
@UI: { identification: {position: 20, importance: #HIGH} }
MaintenanceOrderDesc,
@UI.hidden: true
MaintenanceOrderInternalID,
@UI: { identification: {position: 30, importance: #HIGH} }
@ObjectModel.text.association: '_OrderTypeText'
MaintenanceOrderType,
// Long description to be checked
/************ General data ******************/
@Consumption.semanticObject: 'MaintenanceNotification'
@UI: {fieldGroup: {qualifier: 'General', position: 10, importance: #HIGH, groupLabel: 'General'}}
@ObjectModel.text.element: [ 'NotificationText' ]
MaintenanceNotification,
@Semantics.text: true
_MaintenanceNotification.NotificationText ,
@ObjectModel.text.element: [ 'MaintenancePlanDesc' ]
@Consumption.semanticObject: 'MaintenancePlan'
@UI: {fieldGroup: {qualifier: 'General', position: 20, importance: #HIGH, groupLabel: 'General'}}
MaintenancePlan,
@Semantics.text: true
_MaintenancePlan.MaintenancePlanDesc,
@ObjectModel.text.element: [ 'MaintenanceItemDescription' ]
@UI: {fieldGroup: {qualifier: 'General', position: 30, importance: #HIGH, groupLabel: 'General'}}
MaintenanceItem,
@Semantics.text: true
_MaintenanceItem.MaintenanceItemDescription,
@ObjectModel.text.element: [ 'TaskListDesc' ]
@UI: {fieldGroup: {qualifier: 'General', position: 40, importance: #HIGH, groupLabel: 'General'}}
@EndUserText.label: 'Task List'
case TaskListType
when '' then ''
else case TaskListGroup
when '' then ''
else concat( concat( concat( concat( TaskListType, '/' ),
ltrim( TaskListGroup, '0') ),
'/' ),
ltrim( TaskListGroupCounter, '0') )
end
end as TaskList,
@Semantics.text: true
_MaintenanceTaskList.TaskListDesc,
/************ Responsibilities ******************/
@ObjectModel.text.association: '_MainWorkCenterText'
@EndUserText.label: 'Main Work Center'
@UI: {fieldGroup: {qualifier: 'Responsibilities', position: 10, importance: #HIGH, groupLabel: 'Responsibilities'}}
MaintOrdMainWorkCenter,
@UI.hidden: true
WorkCenterInternalID,
@ObjectModel.text.element: [ 'MainWorkCenterPlantName' ]
@EndUserText.label: 'Work Center Plant'
@UI: {fieldGroup: {qualifier: 'Responsibilities', position: 20, importance: #HIGH, groupLabel: 'Responsibilities'}}
MaintOrdMainWorkCenterPlant,
@Semantics.text: true
_MainWorkCenter._Plant.PlantName as MainWorkCenterPlantName,
@ObjectModel.text.element: [ 'MaintenancePlanningPlantName' ]
@UI: {fieldGroup: {qualifier: 'Responsibilities', position: 30, importance: #HIGH, groupLabel: 'Responsibilities'}}
MaintenancePlanningPlant,
@Semantics.text: true
_MaintenancePlanningPlant.PlantName as MaintenancePlanningPlantName,
@ObjectModel.text.association: '_MaintenancePlannerGroup'
@EndUserText.label: 'Planner Group'
@UI: {fieldGroup: {qualifier: 'Responsibilities', position: 40, importance: #HIGH, groupLabel: 'Responsibilities'}}
MaintenancePlannerGroup,
@ObjectModel.text.element: [ 'PersonResponsibleName' ]
@EndUserText.label: 'Person Responsible'
@UI: {fieldGroup: {qualifier: 'Responsibilities', position: 50, importance: #HIGH, groupLabel: 'Responsibilities'}}
MaintOrdPersonResponsible,
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EAM_WFL_MNTORD_PART_EXIT'
@EndUserText.label: 'Person Responsible Name'
cast('' as eams_person_responsible_name) as PersonResponsibleName,
/************ Technical Object ******************/
@UI: {fieldGroup: {qualifier: 'TechnicalObject', position: 10, importance: #HIGH, groupLabel: 'TechnicalObject'}}
@Consumption.semanticObject: 'MaintenanceObject'
@ObjectModel.text.element: [ 'TechnicalObjectDescription' ]
case when Equipment = '' then
cast( _FunctionalLocationLabel.FunctionalLocationLabelName as eams_tech_obj_conv )
else cast( Equipment as eams_tech_obj_conv ) end as TechnicalObjectLabel,
@EndUserText.label: 'Technical Object Description'
@Semantics.text: true
case when Equipment = '' then
cast( _FunctionalLocationText.FunctionalLocationName as eams_tec_obj_des )
else cast( _EquipmentText.EquipmentName as eams_tec_obj_des ) end as TechnicalObjectDescription,
@ObjectModel.readOnly: true //added for navigation, note 3352136
TechObjIsEquipOrFuncnlLoc,
@ObjectModel.text.association: '_MaterialText'
@Consumption.semanticObject: 'Material'
@UI: {fieldGroup: {qualifier: 'TechnicalObject', position: 20, importance: #HIGH, groupLabel: 'TechnicalObject'}}
_OrderItem.Material,
@UI: {fieldGroup: {qualifier: 'TechnicalObject', position: 30, importance: #HIGH, groupLabel: 'TechnicalObject'}}
SerialNumber,
@UI: {fieldGroup: {qualifier: 'TechnicalObject', position: 40, importance: #HIGH, groupLabel: 'TechnicalObject'}}
@Consumption.semanticObject: 'Material'
@EndUserText.label: 'Assembly'
Assembly,
/************ Dates ******************/
@EndUserText.label: 'Start Date'
@Semantics.businessDate.from: true
@UI: {fieldGroup: {qualifier: 'Dates', position: 10, importance: #HIGH, groupLabel: 'Dates'}}
@UI.hidden: true
MaintOrdBasicStartDate,
@UI.hidden: true
MaintOrdBasicStartTime,
@EndUserText.label: 'End Date'
@Semantics.businessDate.to: true
@UI: {fieldGroup: {qualifier: 'Dates', position: 20, importance: #HIGH, groupLabel: 'Dates'}}
@UI.hidden: true
MaintOrdBasicEndDate,
@UI.hidden: true
MaintOrdBasicEndTime,
@EndUserText: {label: 'Basic Start', quickInfo: 'Basic Start Date and Time'}
@UI: {fieldGroup: {qualifier: 'Dates', position: 10, importance: #HIGH, groupLabel: 'Dates'}}
@ObjectModel.filter.transformedBy: 'ABAP:CL_MAINTORDER_DTETME_FLTREXIT'
cast(dats_tims_to_tstmp( MaintOrdBasicStartDate, MaintOrdBasicStartTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client,'NULL') as timestamp preserving type) as MaintOrdBasicStartDateTime,
@EndUserText: {label: 'Basic Finish', quickInfo: 'Basic Finish Date and Time'}
@UI: {fieldGroup: {qualifier: 'Dates', position: 20, importance: #HIGH, groupLabel: 'Dates'}}
@ObjectModel.filter.transformedBy: 'ABAP:CL_MAINTORDER_DTETME_FLTREXIT2'
case MaintOrdBasicEndTime when '240000'
then cast(dats_tims_to_tstmp( dats_add_days( MaintOrdBasicEndDate, 1, 'NULL'), cast( '000000' as abap.tims ),
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL') as timestamp preserving type)
else cast(dats_tims_to_tstmp( MaintOrdBasicEndDate, MaintOrdBasicEndTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client,'NULL') as timestamp preserving type)
end as MaintOrdBasicEndDateTime,
/************ Cost ******************/
@EndUserText.label: 'Cost Estimated / Planned'
@UI: {fieldGroup: {qualifier: 'Costs', position: 10, importance: #HIGH, groupLabel: 'Costs'}}
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EAM_WFL_ORD_COSTS_EXIT'
cast( '' as abap.sstring( 1333 ) ) as MaintOrdTotalCost,
/************ Account Assignment ******************/
@ObjectModel.text.element: [ 'CompanyCodeName' ]
@EndUserText: { label: 'Company Code Name (Org.)',
quickInfo: 'Company Code Name (Org.)'
}
@UI: {fieldGroup: {qualifier: 'AccAssignment', position: 10, importance: #HIGH, groupLabel: 'AccAssignment'}}
CompanyCode,
@Semantics.text: true
_CompanyCode.CompanyCodeName,
@ObjectModel.text.element: [ 'LocAcctAssgmtCtrlgAreaDesc' ]
@UI: {fieldGroup: {qualifier: 'AccAssignment', position: 20, importance: #HIGH, groupLabel: 'AccAssignment'}}
_LocationAccountAssignment.ControllingArea,
// as LocAcctAssgmtControllingArea,
@EndUserText.label: 'Controlling Area Name'
_LocationAccountAssignment._ControllingArea.ControllingAreaName as LocAcctAssgmtCtrlgAreaDesc,
@ObjectModel.text.association: '_CostCenterText'
@UI: {fieldGroup: {qualifier: 'AccAssignment', position: 30, importance: #HIGH, groupLabel: 'AccAssignment'}}
_LocationAccountAssignment.CostCenter as LocAcctAssgmtCostCenter,
@UI: {fieldGroup: {qualifier: 'AccAssignment', position: 40, importance: #HIGH, groupLabel: 'AccAssignment'}}
_LocationAccountAssignment.SettlementOrder,
@ObjectModel.text.element: [ 'WBSDescription' ]
@UI: {fieldGroup: {qualifier: 'AccAssignment', position: 50, importance: #HIGH, groupLabel: 'AccAssignment'}}
_WBSElement.WBSElement,
@Semantics.text: true
_WBSElement.WBSDescription,
/************ Associations ******************/
FunctionalLocation,
Equipment,
Currency,
MaintObjectLocAcctAssgmtNmbr,
_MaintOrderTypeControlParam.MaintOrderRespPartnerFunction,
_OrderTypeText,
_MaterialText,
_MainWorkCenterText,
_CostCenterText,
_MaintenancePlannerGroup,
_Equipment,
_LocationAccountAssignment,
_MaintOrdPersonResponsible,
_MaintOrderCost,
_MaintOrderCostAggrg
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COMPANYCODE",
"I_CONTROLLINGAREA",
"I_EQUIPMENTTEXT",
"I_FUNCTIONALLOCATIONLABEL",
"I_FUNCTIONALLOCATIONTEXT",
"I_LOCATIONACCOUNTASSIGNMENT",
"I_MAINTENANCEITEMBASIC",
"I_MAINTENANCENOTIFICATION",
"I_MAINTENANCEPLANBASIC",
"I_MAINTENANCETASKLIST",
"I_MAINTORDERTECHOBJ",
"I_MAINTORDERTYPECONTROLPARAM",
"I_ORDERITEM",
"I_PLANT",
"I_WBSELEMENTBYINTERNALKEY",
"I_WORKCENTER"
],
"ASSOCIATED":
[
"C_OBJPGMAINTORDERCOST",
"C_OBJPGMAINTORDERCOSTAGGRGDATA",
"I_COSTCENTERTEXT",
"I_EQUIPMENT",
"I_EQUIPMENTTEXT",
"I_FUNCTIONALLOCATIONLABEL",
"I_FUNCTIONALLOCATIONTEXT",
"I_LOCATIONACCOUNTASSIGNMENT",
"I_MAINTENANCEITEMBASIC",
"I_MAINTENANCEPLANNERGROUP",
"I_ORDERTYPETEXT",
"I_PERSONWORKAGREEMENT_1",
"I_PRODUCTIONRESOURCETEXT",
"I_PRODUCTTEXT"
],
"BASE":
[
"I_MAINTORDERTECHOBJ"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/