//@AbapCatalog.sqlViewName: 'CMAINTCONF'
//@AbapCatalog.compiler.compareFilter: true
//@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #REQUIRED
@EndUserText.label: 'Maintenance Order Confirmation Details'
@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #XL, dataClass: #MIXED}
//@ClientHandling.algorithm: #SESSION_VARIABLE
@UI.lineItem: [{criticality: 'IsCancelled'}]
define view entity C_MaintenanceOrderConfirmation
as select from I_MaintenanceOrderConfirmation
association [0..1] to I_User as _EnteredByUser on _EnteredByUser.UserID = $projection.EnteredByUser
association [1..1] to C_ObjPgMaintOrderConfirmation as _OrderConfirmation on _OrderConfirmation.MaintOrderConf = $projection.MaintOrderConf
and _OrderConfirmation.MaintOrderConfCntrValue = $projection.MaintOrderConfCntrValue
association[0..1] to I_MaintenanceOrderConfirmation as _CancelledConfirmations on _CancelledConfirmations.MaintOrderConf = $projection.MaintOrderConf and
_CancelledConfirmations.CancldMaintOrderConfCntrValue = $projection.MaintOrderConfCntrValue
{
@UI.hidden: true
key MaintOrderConf,
@UI.hidden: true
key MaintOrderConfCntrValue,
@Consumption.semanticObject: 'MaintOrderConfirmation'
@UI.lineItem: [ {position: 10, importance: #HIGH,
type: #WITH_INTENT_BASED_NAVIGATION,
semanticObject: 'MaintOrderConfirmation',
label:'Confirmation', semanticObjectAction: 'displayFactSheet', value: 'MaintOrdConfLabel'}]
concat(concat(ltrim(MaintOrderConf, '0') ,'/'), ltrim(MaintOrderConfCntrValue, '0')) as MaintOrdConfLabel,
@ObjectModel.text.element: [ 'CreatedByUserDescription' ]
@UI.textArrangement: #TEXT_ONLY
@UI.lineItem: [{position: 20, importance: #HIGH }]
@UI.hidden: true
EnteredByUser,
@UI.hidden: true
_EnteredByUser.UserDescription as CreatedByUserDescription,
@UI.lineItem: [{position: 30, importance: #HIGH, label: 'Personnel Number' }]
@ObjectModel.text.element: [ 'PersonFullName' ]
PersonnelNumber,
@UI.hidden: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EAM_OBJPG_MAINT_BP_TXT_EXIT'
cast('' as eams_person_responsible_name ) as PersonFullName,
//_PersonResponsible.PersonFullName,
@Semantics.quantity.unitOfMeasure: 'ActualDurationUnit'
ActualDuration,
@UI.hidden: true
ActualDurationUnit,
@Semantics.quantity.unitOfMeasure: 'ActualWorkQuantityUnit'
@UI.lineItem: [{position: 50, importance: #HIGH }]
ActualWorkQuantity,
@UI.hidden: true
ActualWorkQuantityUnit,
@Semantics.quantity.unitOfMeasure: 'RemainingWorkQuantityUnit'
RemainingWorkQuantity,
@UI.hidden: true
RemainingWorkQuantityUnit,
@Semantics.text: true
@UI.lineItem: [{position: 70, importance: #HIGH, label: 'Confirmation Text' }]
ConfirmationText,
@UI.lineItem: [{position: 90, importance: #HIGH, label: 'Final Confirmation' }]
IsFinalConfirmation,
@UI.lineItem: [{position: 80, importance: #HIGH, label: 'Confirmation Long Text'}]
@UI.multiLineText: true
_OrderConfLongText.PlainLongText as LongText,
ActivityType,
@UI.hidden: true
case I_MaintenanceOrderConfirmation.IsReversed
when 'X' then cast(1 as mpe_criticality_type preserving type)
else cast(0 as mpe_criticality_type preserving type)
end as IsCancelled,
@EndUserText.label: 'Cancelled'
IsReversed,
@UI.hidden: true
@ObjectModel.foreignKey.association: '_Plant'
Plant,
@UI.hidden: true
MaintenanceOrder,
@UI.lineItem: [{position: 60, importance: #HIGH, label: 'Posting Date' }]
I_MaintenanceOrderConfirmation.PostingDate,
@EndUserText.label: 'Cancelled By'
@ObjectModel.text.element: [ 'MaintOrdConfCancelledByName' ]
_CancelledConfirmations.PersonnelNumber as MaintOrdConfCancldByPersNmbr,
@UI.hidden: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EAM_OBJPG_MAINT_BP_TXT_EXIT'
cast('' as eams_person_responsible_name ) as MaintOrdConfCancelledByName,
//_CancelledConfirmations._PersonnelName.PersonFullName as MaintOrdConfCancelledByName,
@EndUserText.label: 'Cancelled On'
_CancelledConfirmations.MaintOrderConfirmationEntryDte as MaintOrdConfCancelledOnDate,
@EndUserText.label: 'Cancelled Confirmation Text'
_CancelledConfirmations.ConfirmationText as MaintOrdConfCancellationText,
@EndUserText.label: 'Cancelled Confirmation Long Text'
_CancelledConfirmations._OrderConfLongText.PlainLongText as MaintOrdConfCanclnLongText,
/*Associations*/
_OrderConfirmation,
_ConfirmationGroup,
_MaintenanceOrder,
_PersonnelName,
_Plant,
_IsFinalConfirmation,
_IsReversed,
_OrderConfLongText //confirmation longtext
}
where IsReversal = ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MAINTENANCEORDERCONFIRMATION",
"I_ORDERCONFLONGTEXT",
"I_USER"
],
"ASSOCIATED":
[
"C_OBJPGMAINTORDERCONFIRMATION",
"I_CONFIRMATIONGROUP",
"I_INDICATOR",
"I_MAINTENANCEORDER",
"I_ORDERCONFLONGTEXT",
"I_PLANT",
"I_WORKFORCEPERSON"
],
"BASE":
[
"I_MAINTENANCEORDERCONFIRMATION"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/