@AbapCatalog.sqlViewName: 'PRSHADLCNFBASE'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@EndUserText.label: 'Confirmations for operations not in schedule'
/*
CONTRACT*************************************************************************************************************************
Name: Confirmations for operations which belong to frozen work centers are returned
Specification: This view provides a list of all confirmations for frozen work centers
Requires: NA
Ensures: Confirmations for operations which belong to frozen work centers are returned
All units are converted to seconds
Owners: AN, CK
Contributors:
Unit Test required Y/N: Yes
Additional comments None
END OF CONTRACT******************************************************************************************************************
*/
define view P_RSHMaintSchedAddlConfBase
as select from I_OrderOperationBasic
inner join I_RSHMaintSchedWrkCtrCap on I_RSHMaintSchedWrkCtrCap.WorkCenterInternalID = I_OrderOperationBasic.WorkCenterInternalID
and I_RSHMaintSchedWrkCtrCap.WorkCenterTypeCode = I_OrderOperationBasic.WorkCenterTypeCode
inner join I_MaintenanceOrderConfirmation on I_MaintenanceOrderConfirmation.MaintOrderConf = I_OrderOperationBasic.OperationConfirmation
left outer join I_RSHMaintSchedFrozenOp as FrozenOperations on FrozenOperations.MaintOrderConfirmation = I_OrderOperationBasic.OperationConfirmation
and FrozenOperations.MaintSchedSimlnUUID = I_RSHMaintSchedWrkCtrCap.MaintSchedSimlnUUID
association [1..1] to I_MaintOrderOperPlanningValues on $projection.MaintOrderRoutingNumber = I_MaintOrderOperPlanningValues.MaintOrderRoutingNumber
and $projection.MaintOrderOperationCounter = I_MaintOrderOperPlanningValues.MaintOrderOperationCounter
{
key I_RSHMaintSchedWrkCtrCap.WorkCenterInternalID,
key I_RSHMaintSchedWrkCtrCap.MaintSchedSimlnUUID,
key I_MaintenanceOrderConfirmation.MaintOrderConf,
key MaintOrderConfCntrValue,
MaintenanceOrder,
MaintenanceOrderOperation,
MaintenanceOrderSubOperation,
I_RSHMaintSchedWrkCtrCap.WorkCenterTypeCode,
I_OrderOperationBasic.OrderInternalID as MaintOrderRoutingNumber,
I_OrderOperationBasic.OrderOperationInternalID as MaintOrderOperationCounter,
IsFinalConfirmation,
IsReversed,
IsReversal,
I_MaintenanceOrderConfirmation.WorkCenterInternalID as ConfWorkCenterInternalID,
OperationConfirmedStartDate,
OperationConfirmedStartTime,
OperationConfirmedEndDate,
OperationConfirmedEndTime,
cast( unit_conversion(
QUANTITY => ActualWorkQuantity,
SOURCE_UNIT => ActualWorkQuantityUnit,
TARGET_UNIT => cast( 'S' as abap.unit(3) ),
ERROR_HANDLING => 'SET_TO_NULL' ) as abap.dec(24,0) ) as ActualWork,
cast( unit_conversion(
QUANTITY => RemainingWorkQuantity,
SOURCE_UNIT => RemainingWorkQuantityUnit,
TARGET_UNIT => cast( 'S' as abap.unit(3) ),
ERROR_HANDLING => 'SET_TO_NULL' ) as abap.dec(24,0) ) as RemainingWork,
NoFurtherWorkQuantityIsExpd as NoRemainingWork,
TotalAvailableCapacity,
TotalPlannedCapacity,
cast( unit_conversion(
QUANTITY => I_MaintOrderOperPlanningValues.OperationPlannedWork,
SOURCE_UNIT => I_MaintOrderOperPlanningValues.OperationPlannedWorkUnit,
TARGET_UNIT => cast( 'S' as abap.unit(3) ),
ERROR_HANDLING => 'SET_TO_NULL' ) as abap.dec(24,0) ) as OperationPlannedWork,
'S' as OperationPlannedWorkUnit
}
where
(
IsReversed = ''
and IsReversal = '' //Shouldn't be a case of reversal or reversed
and OperationConfirmedEndDate >= _MaintSchedSimulation.MaintSchedSimulationStartDate // confirmation end date should fall in the schedule week
and OperationConfirmedEndDate <= _MaintSchedSimulation.MaintSchedSimulationEndDate
)
// filter out confirmations for operations in the schedule
and FrozenOperations.MaintOrderConfirmation is null
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MAINTENANCEORDERCONFIRMATION",
"I_MAINTORDEROPERPLANNINGVALUES",
"I_ORDEROPERATIONBASIC",
"I_RSHMAINTSCHEDFROZENOP",
"I_RSHMAINTSCHEDSIMULATION",
"I_RSHMAINTSCHEDWRKCTRCAP"
],
"ASSOCIATED":
[
"I_MAINTORDEROPERPLANNINGVALUES"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/