@AbapCatalog.sqlViewName: 'PRSHOPCNFBASE'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@AccessControl.authorizationCheck: #NOT_REQUIRED@VDM.private: true@VDM.viewType: #CONSUMPTION/*
CONTRACT*************************************************************************************************************************
Name: Valid confirmations for operations that are part of the schedule
Specification: This view gives you Valid confirmations for operations that are part of the schedule
- Confirmation end date should fall within the schedule period
- Confirmation should not be a case of reversal
Requires: NA
Ensures: Valid Confirmations for the operations in the schedule is returned
Owners: AN, PSP
Contributors:
Unit Test required Y/N: Yes
Additional comments None
END OF CONTRACT******************************************************************************************************************
*/defineview P_RSHMaintSchedOpConfBase
asselectfrom I_RSHMaintSchedFrozenOp as FrozenOperations //We're only concerned about all the frozen operations
innerjoin I_MaintenanceOrderConfirmation on I_MaintenanceOrderConfirmation.MaintOrderConf = FrozenOperations.MaintOrderConfirmation
innerjoin I_RSHMaintSchedSimulation as ScheduleHeader on ScheduleHeader.MaintSchedSimlnUUID = FrozenOperations.MaintSchedSimlnUUID
{
key FrozenOperations.WorkCenterInternalID,
key FrozenOperations.MaintSchedSimlnUUID,
key I_MaintenanceOrderConfirmation.MaintOrderConf,
key MaintOrderConfCntrValue,
MaintenanceOrder,
MaintenanceOrderOperation,
MaintenanceOrderSubOperation,
FrozenOperations.WorkCenterTypeCode,
FrozenOperations.MaintOrderRoutingNumber,
FrozenOperations.MaintOrderOperationCounter,
IsFinalConfirmation,
IsReversed,
IsReversal,
OperationConfirmedStartDate,
OperationConfirmedStartTime,
OperationConfirmedEndDate,
OperationConfirmedEndTime,
ScheduleHeader.MaintSchedSimulationStartDate,
ScheduleHeader.MaintSchedSimulationEndDate,
FrozenOperations.MaintOrdOpSchedWork,
FrozenOperations.MaintOrdOpSimulatedStartDate,
FrozenOperations.MaintOrdOpSimulatedEndDate,
cast( unit_conversion(
QUANTITY => ActualWorkQuantity,
SOURCE_UNIT => ActualWorkQuantityUnit,
TARGET_UNIT => cast( 'S' asabap.unit(3) ),
ERROR_HANDLING => 'SET_TO_NULL' ) asabap.dec(24,0) ) as ActualWork,
cast( unit_conversion(
QUANTITY => RemainingWorkQuantity,
SOURCE_UNIT => RemainingWorkQuantityUnit,
TARGET_UNIT => cast( 'S' asabap.unit(3) ),
ERROR_HANDLING => 'SET_TO_NULL' ) asabap.dec(24,0) ) as RemainingWork,
NoFurtherWorkQuantityIsExpd as NoRemainingWork
}
where
(
IsReversed = ''
and IsReversal = '' //Shouldn't be a case of reversal or reversed
and OperationConfirmedEndDate >= ScheduleHeader.MaintSchedSimulationStartDate // confirmation end date should fall in the schedule week
and OperationConfirmedEndDate <= ScheduleHeader.MaintSchedSimulationEndDate
)
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MAINTENANCEORDERCONFIRMATION",
"I_RSHMAINTSCHEDFROZENOP",
"I_RSHMAINTSCHEDSIMULATION"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/