P_RSHMAINTSCHEDOPCONFBASE

CDS View

P_RSHMAINTSCHEDOPCONFBASE is a CDS View in S/4HANA. It contains 1 fields. 2 CDS views read from this table.

CDS Views using this table (2)

ViewTypeJoinVDMDescription
P_RSHMaintSchedOpConfirmations view from CONSUMPTION Confirmations for operations added to schedule
P_RSHMaintSchedUtilBaseKPI view union_all CONSUMPTION Base view for Utilization KPI calculation

Fields (1)

KeyField CDS FieldsUsed in Views
KEY MaintOrderConf MaintOrderConf 1
@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******************************************************************************************************************
*/

define view P_RSHMaintSchedOpConfBase
  as select from I_RSHMaintSchedFrozenOp as FrozenOperations //We're only concerned about all the frozen operations

    inner join   I_MaintenanceOrderConfirmation on I_MaintenanceOrderConfirmation.MaintOrderConf = FrozenOperations.MaintOrderConfirmation
    inner join   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' 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
      
}
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":""
}
}*/