P_RSHMaintSchedAddlConfBase

DDL: P_RSHMAINTSCHEDADDLCONFBASE SQL: PRSHADLCNFBASE Type: view CONSUMPTION

Confirmations for operations not in schedule

P_RSHMaintSchedAddlConfBase is a Consumption CDS View that provides data about "Confirmations for operations not in schedule" in SAP S/4HANA. It reads from 4 data sources (I_RSHMaintSchedFrozenOp, I_MaintenanceOrderConfirmation, I_OrderOperationBasic, I_RSHMaintSchedWrkCtrCap) and exposes 25 fields with key fields WorkCenterInternalID, MaintSchedSimlnUUID, MaintOrderConf, MaintOrderConfCntrValue.

Data Sources (4)

SourceAliasJoin Type
I_RSHMaintSchedFrozenOp FrozenOperations left_outer
I_MaintenanceOrderConfirmation I_MaintenanceOrderConfirmation inner
I_OrderOperationBasic I_OrderOperationBasic from
I_RSHMaintSchedWrkCtrCap I_RSHMaintSchedWrkCtrCap inner

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PRSHADLCNFBASE view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #CONSUMPTION view
EndUserText.label Confirmations for operations not in schedule view

Fields (25)

KeyFieldSource TableSource FieldDescription
KEY WorkCenterInternalID I_RSHMaintSchedWrkCtrCap WorkCenterInternalID
KEY MaintSchedSimlnUUID I_RSHMaintSchedWrkCtrCap MaintSchedSimlnUUID
KEY MaintOrderConf I_MaintenanceOrderConfirmation MaintOrderConf
KEY MaintOrderConfCntrValue MaintOrderConfCntrValue
MaintenanceOrder MaintenanceOrder
MaintenanceOrderOperation MaintenanceOrderOperation
MaintenanceOrderSubOperation MaintenanceOrderSubOperation
WorkCenterTypeCode I_RSHMaintSchedWrkCtrCap WorkCenterTypeCode
MaintOrderRoutingNumber I_OrderOperationBasic OrderInternalID
MaintOrderOperationCounter I_OrderOperationBasic OrderOperationInternalID
IsFinalConfirmation IsFinalConfirmation
IsReversed IsReversed
IsReversal IsReversal
ConfWorkCenterInternalID I_MaintenanceOrderConfirmation WorkCenterInternalID
OperationConfirmedStartDate OperationConfirmedStartDate
OperationConfirmedStartTime OperationConfirmedStartTime
OperationConfirmedEndDate OperationConfirmedEndDate
OperationConfirmedEndTime OperationConfirmedEndTime
dec240asActualWork
dec240asRemainingWork
NoRemainingWork NoFurtherWorkQuantityIsExpd
TotalAvailableCapacity TotalAvailableCapacity
TotalPlannedCapacity TotalPlannedCapacity
dec240asOperationPlannedWork
OperationPlannedWorkUnit
@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":""
}
}*/