@AbapCatalog.sqlViewName: 'PPROCORDMGMTOP'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
//@EndUserText.label: 'Process order operation'
@ClientHandling.algorithm: #SESSION_VARIABLE
@ClientHandling.type: #CLIENT_DEPENDENT
@ObjectModel.representativeKey: 'OrderOperationInternalID'
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #XL, dataClass: #TRANSACTIONAL}
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view P_ProcOrdMgmtOperation
as select from I_ProcOrdMgmtOpBasic as afvg
inner join P_ProcOrdAORListDistinct as _AORList on _AORList.OrderID = afvg.ProcessOrder
association [0..1] to P_ProcOrdMgmtOp as afvp on afvp.OrderInternalID = afvg.OrderInternalID //phase handling
and afvp.ProcessOrder = afvg.ProcessOrder
and afvp.ManufacturingOrderCategory = '40'
and afvp.OrderOperationInternalID = afvg.OrderIntBillOfOpItemOfPhase
and afvp.ProductionSupervisor = afvg.ProductionSupervisor
and afvp.ProductionPlant = afvg.ProductionPlant
association [0..1] to I_WorkCenter as _WorkCenter on $projection.WorkCenterInternalID = _WorkCenter.WorkCenterInternalID
and _WorkCenter.WorkCenterTypeCode = 'A'
{
key afvg.OrderInternalID,
key OrderOperationInternalID,
afvg.ProcessOrder,
afvg.ManufacturingOrderCategory,
afvg.ProductionPlant,
afvg.ProductionSupervisor,
Sequence,
OperationText,
Language,
Operation,
cast(afvp.Operation as vdm_supop preserving type) as MfgOrderPhaseSuperiorOperation,
afvg.Plant,
BillOfOperationsSequence,
afvg.BillOfOperationsType,
BillOfOperationsGroup,
afvg.BillOfOperationsVariant,
BOOOperationInternalID,
afvg.BillOfOperationsVersion,
SuperiorOperationInternalID,
afvg.ObjectInternalID,
OrderIntBillOfOpItemOfPhase,
MfgOrderOperationIsPhase,
afvg.WorkCenterInternalID,
_WorkCenter.WorkCenterTypeCode,
_WorkCenter.WorkCenter,
_WorkCenter._Text[1: Language=$session.system_language].WorkCenterText,
OperationUnit,
OpPlannedTotalQuantity,
OpPlannedScrapQuantity,
OpTotalConfirmedYieldQty,
OpTotalConfirmedScrapQty,
OpPlannedYieldQuantity,
// OrderOpenQuantity,
//Operation issues
ProcOrdOpHasQuantityIssue,
ProcOrdOpHasQualityIssue,
OpLtstSchedldExecStrtDte,
OpLtstSchedldExecStrtTme,
OpLtstSchedldExecEndDte,
OpLtstSchedldExecEndTme,
OpActualExecutionStartDate,
OpActualExecutionStartTime,
OpActualExecutionEndDate,
OpActualExecutionEndTime,
case OpLtstSchedldExecStrtTme when '240000' then
cast(cast(concat(OpLtstSchedldExecStrtDte,cast('235959' as tims))as abap.numc(15)) as timestamp)
else
cast(cast(concat(OpLtstSchedldExecStrtDte , OpLtstSchedldExecStrtTme)as abap.numc(15)) as timestamp)
end as ProcOrdOpSchedldStartDateTime,
case OpLtstSchedldExecEndTme when '240000' then
cast(cast(concat(OpLtstSchedldExecEndDte,cast('235959' as tims))as abap.numc(15)) as timestamp)
else
cast(cast(concat(OpLtstSchedldExecEndDte , OpLtstSchedldExecEndTme)as abap.numc(15)) as timestamp)
end as ProcOrdOpSchedldEndDateTime,
case OpActualExecutionStartTime when '240000' then
cast(cast(concat(OpActualExecutionStartDate,cast('235959' as tims))as abap.numc(15)) as timestamp)
else
cast(cast(concat(OpActualExecutionStartDate , OpActualExecutionStartTime)as abap.numc(15)) as timestamp)
end as ProcOrdOpActualStartDateTime,
case OpActualExecutionEndTime when '240000' then
cast(cast(concat(OpActualExecutionEndDate,cast('235959' as tims))as abap.numc(15)) as timestamp)
else
cast(cast(concat(OpActualExecutionEndDate , OpActualExecutionEndTime)as abap.numc(15)) as timestamp)
end as ProcOrdOpActualEndDateTime,
afvg._OrderInternalID
}
where
ManufacturingOrderCategory = '40'
and SuperiorOperationInternalID is initial //SuperiorOperationInternalID
and Sequence = '000000' //Sequence
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PROCORDMGMTOPBASIC",
"I_WORKCENTER",
"I_WORKCENTERTEXT",
"P_PROCORDAORLISTDISTINCT",
"P_PROCORDMGMTOP"
],
"ASSOCIATED":
[
"I_ORDERINTERNALID",
"I_WORKCENTER",
"P_PROCORDMGMTOP"
],
"BASE":
[
"I_PROCORDMGMTOPBASIC"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/