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 R_MaintenanceOrderOperationTP.
-- 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.
CREATE VIEW R_MaintenanceOrderOperationTP AS
SELECT
MaintenanceOrder,
cast( MaintenanceOrderOperation as maintenanceorderoperation preserving type ) AS MaintenanceOrderOperation,
cast( MaintenanceOrderSubOperation as maintenanceordersuboperation preserving type ) AS MaintenanceOrderSubOperation,
cast( MaintenanceOrderOperation as maintenanceorderoperation preserving type ) AS MaintOrderOperationForEdit,
cast( MaintenanceOrderSubOperation as maintenanceordersuboperation preserving type ) AS MaintOrderSubOperationForEdit,
MaintOrderRoutingNumber,
MaintOrderOperationCounter AS MaintenanceOrderRoutingNode,
SuperiorOperationInternalID,
OperationControlKey,
OperationDescription,
OperationWorkCenterInternalID,
OperationWorkCenterTypeCode,
Plant,
OperationStandardTextCode,
Language,
NumberOfTimeTickets,
OperationPurgInfoRecdSearchTxt,
OperationSupplier,
OpExternalProcessingPrice,
OpExternalProcessingPriceUnit,
CostElement,
OpExternalProcessingCurrency,
OperationPurchasingInfoRecord,
PurchasingOrganization,
PurchasingGroup,
MaterialGroup,
OpPurchaseOutlineAgreement,
OpPurchaseOutlineAgreementItem,
OperationRequisitionerName,
OperationTrackingNumber,
NumberOfCapacities,
OperationWorkPercent,
OperationCalculationControl,
CostCtrActivityType AS ActivityType,
OperationSystemCondition,
OperationGoodsRecipientName,
OperationUnloadingPointName,
OperationPersonResponsible,
EAMPlannedDeliveryDurnInDays,
MaintOrderOperationDuration,
MaintOrdOperationDurationUnit,
OpBscStartDateConstraintType,
OpBscEndDateConstraintType,
MaintOrdOperationWorkDuration,
MaintOrdOpWorkDurationUnit,
MaintOrdOperationExecutionRate,
Equipment,
FunctionalLocation,
case when OpErlstSchedldExecStrtTme = '240000' and OpErlstSchedldExecStrtDte is not initial then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpErlstSchedldExecStrtDte, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_dats( dats_tims_to_tstmp(OpErlstSchedldExecStrtDte, OpErlstSchedldExecStrtTme, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as OpErlstSchedldExecStrtDte AS clientNULLendasOpErlstSchedldExecStrtDte,
case when OpErlstSchedldExecStrtTme = '240000' and OpErlstSchedldExecStrtDte is not initial then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpErlstSchedldExecStrtDte, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_tims( dats_tims_to_tstmp(OpErlstSchedldExecStrtDte, OpErlstSchedldExecStrtTme, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as OpErlstSchedldExecStrtTme AS clientNULLendasOpErlstSchedldExecStrtTme,
case when OpErlstSchedldExecEndTme = '240000' and OpErlstSchedldExecEndDte is not initial then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpErlstSchedldExecEndDte, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_dats( dats_tims_to_tstmp(OpErlstSchedldExecEndDte, OpErlstSchedldExecEndTme, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as OpErlstSchedldExecEndDte AS clientNULLendasOpErlstSchedldExecEndDte,
case when OpErlstSchedldExecEndTme = '240000' and OpErlstSchedldExecEndDte is not initial then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpErlstSchedldExecEndDte, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_tims( dats_tims_to_tstmp(OpErlstSchedldExecEndDte, OpErlstSchedldExecEndTme, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as OpErlstSchedldExecEndTme AS clientNULLendasOpErlstSchedldExecEndTme,
case when OpLtstSchedldExecStrtTme = '240000' and OpLtstSchedldExecStrtDte is not initial then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpLtstSchedldExecStrtDte, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_dats( dats_tims_to_tstmp(OpLtstSchedldExecStrtDte, OpLtstSchedldExecStrtTme, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as OpLtstSchedldExecStrtDte AS clientNULLendasOpLtstSchedldExecStrtDte,
case when OpLtstSchedldExecStrtTme = '240000' and OpLtstSchedldExecStrtDte is not initial then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpLtstSchedldExecStrtDte, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_tims( dats_tims_to_tstmp(OpLtstSchedldExecStrtDte, OpLtstSchedldExecStrtTme, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as OpLtstSchedldExecStrtTme AS clientNULLendasOpLtstSchedldExecStrtTme,
case when OpLtstSchedldExecEndTme = '240000' and OpLtstSchedldExecEndDte is not initial then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpLtstSchedldExecEndDte, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_dats( dats_tims_to_tstmp(OpLtstSchedldExecEndDte, OpLtstSchedldExecEndTme, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as OpLtstSchedldExecEndDte AS clientNULLendasOpLtstSchedldExecEndDte,
case when OpLtstSchedldExecEndTme = '240000' and OpLtstSchedldExecEndDte is not initial then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpLtstSchedldExecEndDte, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_tims( dats_tims_to_tstmp(OpLtstSchedldExecEndDte, OpLtstSchedldExecEndTme, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as OpLtstSchedldExecEndTme AS clientNULLendasOpLtstSchedldExecEndTme,
case when OpActualExecutionEndTime = '240000' and OpActualExecutionEndDate is not initial then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpActualExecutionEndDate, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_dats( dats_tims_to_tstmp(OpActualExecutionEndDate, OpActualExecutionEndTime, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as OpActualExecutionEndDate AS clientNULLendasOpActualExecutionEndDate,
case when OpActualExecutionEndTime = '240000' and OpActualExecutionEndDate is not initial then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpActualExecutionEndDate, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_tims( dats_tims_to_tstmp(OpActualExecutionEndDate, OpActualExecutionEndTime, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as OpActualExecutionEndTime AS clientNULLendasOpActualExecutionEndTime,
case when ActyConfFcstdEndTime = '240000' and ActyConfFcstdEndDate is not initial then tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( ActyConfFcstdEndDate, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_dats( dats_tims_to_tstmp(ActyConfFcstdEndDate, ActyConfFcstdEndTime, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as ActyConfFcstdEndDate AS clientNULLendasActyConfFcstdEndDate,
case when ActyConfFcstdEndTime = '240000' and ActyConfFcstdEndDate is not initial then tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( ActyConfFcstdEndDate, 1, 'NULL'), cast( '000000' as abap.tims ), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) else tstmp_to_tims( dats_tims_to_tstmp(ActyConfFcstdEndDate, ActyConfFcstdEndTime, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) end as ActyConfFcstdEndTime AS clientNULLendasActyConfFcstdEndTime,
ActualWorkQuantity,
BusinessArea,
ProfitCenter,
CostingSheet,
TaxJurisdiction,
FunctionalArea,
MaintOrdOperationIsMRPRelevant,
MaintControllingObjectClass,
WrkCtrIntCapRqmtsDistr,
MaintOrdOperationOverheadCode,
MaintOrderOperationQuantity,
MaintOrdOperationQuantityUnit,
Assembly,
MaintOperationExecStageCode,
MaintOrdOpAssgdWBSElmntInt,
cast ( _WBSElement.WBSElement as vdm_ps_posid ) AS WBSElement,
IsMarkedForDeletion,
MaintOrderOperationInternalID,
PurchaseRequisition,
PurchaseRequisitionItem,
MaintOrdOpProcessPhaseCode,
MaintOrdOpProcessSubPhaseCode,
AllMaintOrdCompCmtdQtsAreKept,
MaintOrderConfirmation,
MaintOrderConfCntrValue,
MaintOrdOpHasNoRemainingWork,
MaintOrdOpHasLeanServices,
_MaintOrderOpObjectListLink._MaintenanceItemObject.MaintenanceNotification AS MaintenanceNotification,
ExtProcgOperationHasSubcontrg,
MaintOrdOpDelivDateAdjustment,
TaskListType,
TaskListGroup,
TaskListGroupCounter,
TaskListSequence,
TaskListOperationInternalId,
MaintOperationalChecklistType,
_MaintenanceOrder.ControllingArea AS ControllingArea,
_MaintOrderOperObjectListLink.MaintenanceObjectListItem AS MaintenanceObjectListItem,
_MaintOrdOpAdditionalData.MaintenanceActivityType AS MaintenanceActivityType,
_OperationWorkCenter.WorkCenter AS WorkCenter
FROM I_MaintOrderOperAndSubOper
LEFT OUTER JOIN I_WorkCenter AS _OperationWorkCenter ON _OperationWorkCenter.WorkCenterInternalID = OperationWorkCenterInternalID AND _OperationWorkCenter.WorkCenterTypeCode = OperationWorkCenterTypeCode -- association [0..1]
LEFT OUTER JOIN I_WBSElementBasicData AS _WBSElement ON _WBSElement.WBSElementInternalID = MaintOrdOpAssgdWBSElmntInt -- association [0..1]
LEFT OUTER JOIN I_CostCenterActivityTypeText AS _CostCenterActivityTypeText ON ControllingArea = _CostCenterActivityTypeText.ControllingArea AND ActivityType = _CostCenterActivityTypeText.CostCtrActivityType AND _CostCenterActivityTypeText.ValidityStartDate <= $session.system_date AND _CostCenterActivityTypeText.ValidityEndDate = '99991231' -- association [0..*]
LEFT OUTER JOIN I_MaintenanceActivityTypeText AS _MaintenanceActivityTypeText ON maintenanceactivitytype = _MaintenanceActivityTypeText.MaintenanceActivityType -- association [0..*]
LEFT OUTER JOIN I_MaintOrderOperObjectListLink AS _MaintOrderOpObjectListLink ON MaintenanceOrderRoutingNode = _MaintOrderOpObjectListLink.MaintOrderOperationCounter AND MaintOrderRoutingNumber = _MaintOrderOpObjectListLink.MaintOrderRoutingNumber -- association [0..1]
LEFT OUTER JOIN E_MaintenanceOrderOperation AS _MaintOrderOperExtension ON _MaintOrderOperExtension.MaintOrderRoutingNumber = MaintOrderRoutingNumber AND _MaintOrderOperExtension.MaintOrderOperationCounter = MaintenanceOrderRoutingNode -- association [0..1]
LEFT OUTER JOIN I_MaterialGroupText AS _MaterialGroupText ON MaterialGroup = _MaterialGroupText.MaterialGroup -- association [0..*]
LEFT OUTER JOIN I_CostElement AS _CostElement ON ControllingArea = _CostElement.ControllingArea AND CostElement = _CostElement.CostElement -- association [0..1]
LEFT OUTER JOIN I_MaintenanceNotification AS _MaintenanceNotification ON _MaintenanceNotification.MaintenanceNotification = maintenancenotification -- association [0..1]
LEFT OUTER JOIN I_OperationControlProfileText AS _OperationControlProfileText ON _OperationControlProfileText.OperationControlProfile = OperationControlKey -- association [0..*]
LEFT OUTER JOIN I_MaintOpExecStageCodeText AS _MaintOpExecStageCodeText ON _MaintOpExecStageCodeText.MaintOperationExecStageCode = MaintOperationExecStageCode -- association [0..*]
LEFT OUTER JOIN I_MaterialText AS _AssemblyText ON _AssemblyText.Material = Assembly -- association [0..*]
LEFT OUTER JOIN I_EquipmentText AS _EquipmentText ON _EquipmentText.Equipment = Equipment -- association [0..*]
LEFT OUTER JOIN I_FunctionalLocationLabel AS _FunctionalLocationLabel ON _FunctionalLocationLabel.FunctionalLocation = FunctionalLocation -- association [0..1]
LEFT OUTER JOIN I_FunctionalLocationText AS _FunctionalLocationText ON _FunctionalLocationText.FunctionalLocation = FunctionalLocation -- association [0..*]
LEFT OUTER JOIN I_MaintOperationSystConditionT AS _MaintOpSystemConditionText ON _MaintOpSystemConditionText.OperationSystemCondition = OperationSystemCondition -- association [0..*]
LEFT OUTER JOIN I_WorkCenterText AS _WorkCenterText ON _WorkCenterText.WorkCenterTypeCode = OperationWorkCenterTypeCode AND _WorkCenterText.WorkCenterInternalID = OperationWorkCenterInternalID -- association [0..*]
LEFT OUTER JOIN I_OperationCalcControlText AS _OperationCalcControlText ON _OperationCalcControlText.OperationCalculationControl = OperationCalculationControl -- association [0..*]
LEFT OUTER JOIN I_EAMProcessPhaseText AS _EAMProcessPhaseText ON _EAMProcessPhaseText.EAMProcessPhaseCode = MaintOrdOpProcessPhaseCode -- association [0..*]
LEFT OUTER JOIN I_EAMProcessSubPhaseText AS _EAMProcessSubPhaseText ON _EAMProcessSubPhaseText.EAMProcessSubPhaseCode = MaintOrdOpProcessSubPhaseCode -- association [0..*]
LEFT OUTER JOIN I_PurReqnOrResvnGenerationText AS _PurReqnOrResvnGenerationText ON _PurReqnOrResvnGenerationText.PurReqnOrResvnGeneration = MaintOrdOperationIsMRPRelevant -- association [0..*]
LEFT OUTER JOIN I_MaintOrdOpDeliveryDateAdjmtT AS _MaintOrdOpDeliveryDateAdjmtT ON _MaintOrdOpDeliveryDateAdjmtT.MaintOrdOpDelivDateAdjustment = MaintOrdOpDelivDateAdjustment -- association [0..*]
LEFT OUTER JOIN R_MaintOrderOpRelationshipTP AS _MaintOrderOpRelationship ON /* condition not available in parsed metadata */ -- association [0..*]
LEFT OUTER JOIN R_MaintOrderOpComponentTP AS _MaintOrderOpComponent ON /* condition not available in parsed metadata */ -- association [0..*]
LEFT OUTER JOIN R_MaintOrderOpComponentTP_2 AS _MaintOrderOpComponent_2 ON /* condition not available in parsed metadata */ -- association [0..*]
LEFT OUTER JOIN R_MaintOrderOpLongTextTP AS _MaintOrderOpLongText ON /* condition not available in parsed metadata */ -- association [0..*]
LEFT OUTER JOIN R_MaintOrderOpPhaseControlTP AS _MaintOrderOpPhaseControl ON /* condition not available in parsed metadata */ -- association [0..*]
LEFT OUTER JOIN R_MaintOrderOpProdnRsceToolTP AS _MaintOrderOpProdnRsceTool ON /* condition not available in parsed metadata */ -- association [0..*]
LEFT OUTER JOIN R_MaintOrderOpRqmtAssgmtTP AS _MaintOrderOpRqmtAssgmt ON /* condition not available in parsed metadata */ -- association [0..*]
;