P_RSHExOpsForScheduling

DDL: P_RSHEXOPSFORSCHEDULING SQL: PRSHEXOPFRSCHD Type: view CONSUMPTION

P_RSHExOpsForScheduling is a Consumption CDS View in SAP S/4HANA. It reads from 7 data sources and exposes 21 fields with key fields MaintenanceOrder, MaintenanceOrderOperation, MaintenanceOrderSubOperation.

Data Sources (7)

SourceAliasJoin Type
I_StatusObjectStatusBasic excl_status left_outer
I_MaintOrderOperPlanningValues I_MaintOrderOperPlanningValues inner
I_StatusObjectStatusBasic incl_status inner
I_MaintOrderOperAndSubOper iop from
I_MaintenanceOrder iorder inner
I_OperationControlProfile OperationControlProfile inner
I_RSHAssignedWorkCenters user_var inner

Parameters (2)

NameTypeDefault
P_StartDate datum
P_EndDate datum

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PRSHEXOPFRSCHD view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.preserveKey true view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY MaintenanceOrder I_MaintOrderOperAndSubOper MaintenanceOrder Order
KEY MaintenanceOrderOperation I_MaintOrderOperAndSubOper MaintenanceOrderOperation Suboperation
KEY MaintenanceOrderSubOperation I_MaintOrderOperAndSubOper MaintenanceOrderSubOperation Suboperation
OperationControlKey I_MaintOrderOperAndSubOper OperationControlKey Control Key
MaintPriority I_MaintenanceOrder MaintPriority Priority
MaintPriorityType I_MaintenanceOrder MaintPriorityType PriorityType
MaintPriorityColorCode
MaintenanceActivityType I_MaintenanceOrder MaintenanceActivityType MaintActivType
MaintenanceOrderType I_MaintenanceOrder MaintenanceOrderType Order Type
WorkCenter I_RSHAssignedWorkCenters WorkCenter Work Center
WorkCenterInternalID I_MaintOrderOperAndSubOper OperationWorkCenterInternalID Object ID
WorkCenterTypeCode I_MaintOrderOperAndSubOper OperationWorkCenterTypeCode
WorkCenterCategoryCode I_RSHAssignedWorkCenters WorkCenterCategoryCode
CapacityInternalID I_RSHAssignedWorkCenters CapacityInternalID Capacity ID
Plant I_MaintOrderOperAndSubOper Plant Valuation Area
OperationPlannedWork I_MaintOrderOperPlanningValues OperationPlannedWork Work
OperationPlannedWorkUnit I_MaintOrderOperPlanningValues OperationPlannedWorkUnit Unit for work
RemainingWorkQuantity
clientNULLendendasPlannedStartDateTime
clientNULLendendasPlannedEndDateTime
OperationPersonResponsible I_MaintOrderOperAndSubOper OperationPersonResponsible Personnel no.

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_RSHExOpsForScheduling.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PRSHEXOPFRSCHD
-- Parameters: P_StartDate : datum, P_EndDate : datum

CREATE VIEW P_RSHExOpsForScheduling AS
SELECT
  iop.MaintenanceOrder AS MaintenanceOrder,
  iop.MaintenanceOrderOperation AS MaintenanceOrderOperation,
  iop.MaintenanceOrderSubOperation AS MaintenanceOrderSubOperation,
  iop.OperationControlKey AS OperationControlKey,
  iorder.MaintPriority AS MaintPriority,
  iorder.MaintPriorityType AS MaintPriorityType,
  iorder._MaintenancePriority.MaintPriorityColorCode AS MaintPriorityColorCode,
  iorder.MaintenanceActivityType AS MaintenanceActivityType,
  iorder.MaintenanceOrderType AS MaintenanceOrderType,
  user_var.WorkCenter AS WorkCenter,
  iop.OperationWorkCenterInternalID AS WorkCenterInternalID,
  iop.OperationWorkCenterTypeCode AS WorkCenterTypeCode,
  user_var.WorkCenterCategoryCode AS WorkCenterCategoryCode,
  user_var.CapacityInternalID AS CapacityInternalID,
  iop.Plant AS Plant,
  I_MaintOrderOperPlanningValues.OperationPlannedWork AS OperationPlannedWork,
  I_MaintOrderOperPlanningValues.OperationPlannedWorkUnit AS OperationPlannedWorkUnit,
  I_MaintOrderOperPlanningValues.ForecastedWorkQty - I_MaintOrderOperPlanningValues.ConfirmationTotalQuantity AS RemainingWorkQuantity,
  case when I_SchedulingType.SchedulingIsPerformedBackward = '' then case when I_MaintOrderOperPlanningValues.OpErlstSchedldExecStrtTme = '240000' then dats_tims_to_tstmp( dats_add_days(I_MaintOrderOperPlanningValues.OpErlstSchedldExecStrtDte,1,'FAIL'), '000000',abap_system_timezone( $session.client,'NULL'),$session.client,'NULL') else dats_tims_to_tstmp( I_MaintOrderOperPlanningValues.OpErlstSchedldExecStrtDte, I_MaintOrderOperPlanningValues.OpErlstSchedldExecStrtTme, abap_system_timezone( $session.client,'NULL'),$session.client,'NULL') end else case when I_MaintOrderOperPlanningValues.OpLtstSchedldExecStrtTme = '240000' then dats_tims_to_tstmp( dats_add_days(I_MaintOrderOperPlanningValues.OpLtstSchedldExecStrtDte,1,'FAIL'), '000000',abap_system_timezone( $session.client,'NULL'),$session.client,'NULL') else dats_tims_to_tstmp( I_MaintOrderOperPlanningValues.OpLtstSchedldExecStrtDte, I_MaintOrderOperPlanningValues.OpLtstSchedldExecStrtTme, abap_system_timezone( $session.client,'NULL'),$session.client,'NULL') end end as PlannedStartDateTime AS clientNULLendendasPlannedStartDateTime,
  case when I_SchedulingType.SchedulingIsPerformedBackward = '' then case when I_MaintOrderOperPlanningValues.OpErlstSchedldExecEndTme = '240000' then dats_tims_to_tstmp( dats_add_days(I_MaintOrderOperPlanningValues.OpErlstSchedldExecEndDte,1,'FAIL'), '000000',abap_system_timezone( $session.client,'NULL'),$session.client,'NULL') else dats_tims_to_tstmp( I_MaintOrderOperPlanningValues.OpErlstSchedldExecEndDte, I_MaintOrderOperPlanningValues.OpErlstSchedldExecEndTme, abap_system_timezone( $session.client,'NULL'),$session.client,'NULL') end else case when I_MaintOrderOperPlanningValues.OpLtstSchedldExecEndTme = '240000' then dats_tims_to_tstmp( dats_add_days(I_MaintOrderOperPlanningValues.OpLtstSchedldExecEndDte,1,'FAIL'), '000000',abap_system_timezone( $session.client,'NULL'),$session.client,'NULL') else dats_tims_to_tstmp( I_MaintOrderOperPlanningValues.OpLtstSchedldExecEndDte, I_MaintOrderOperPlanningValues.OpLtstSchedldExecEndTme, abap_system_timezone( $session.client,'NULL'),$session.client,'NULL') end end as PlannedEndDateTime AS clientNULLendendasPlannedEndDateTime,
  iop.OperationPersonResponsible AS OperationPersonResponsible
FROM I_MaintOrderOperAndSubOper AS iop
INNER JOIN I_MaintenanceOrder AS iorder ON /* join condition not captured in parsed metadata */
INNER JOIN I_MaintOrderOperPlanningValues ON /* join condition not captured in parsed metadata */
INNER JOIN I_OperationControlProfile AS OperationControlProfile ON /* join condition not captured in parsed metadata */
INNER JOIN I_RSHAssignedWorkCenters AS user_var ON /* join condition not captured in parsed metadata */
INNER JOIN I_StatusObjectStatusBasic AS incl_status ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_StatusObjectStatusBasic AS excl_status ON /* join condition not captured in parsed metadata */
;