@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Order Operation Schedule'
//@Search.searchable: true
@ObjectModel.usageType: {serviceQuality: #D, sizeCategory: #XL, dataClass: #MIXED}
@UI.headerInfo: {
title : { type: #STANDARD, value: 'ManufacturingOrder' },
description : { type: #STANDARD, value: 'ManufacturingOrderOperation' },
typeName: 'Order Operation Schedule',
typeNamePlural: 'Order Operation Schedules'
}
@VDM.viewType: #CONSUMPTION
@Consumption.dbHints: [ 'OPTIMIZATION_LEVEL(MINIMAL_COST_BASED)','NO_RECOMPILE_WITH_SQL_PARAMETERS','NO_USE_HEX_PLAN' ]
define view entity C_OrderOperationSchedule
as select from P_ManageOperations as _OrderOperation
left outer join I_StatusObjectStatusBasic as _OrderShopFloorStatus on _OrderShopFloorStatus.StatusObject = _OrderOperation.ManufacturingObject
and _OrderShopFloorStatus.StatusIsInactive = ''
and _OrderShopFloorStatus.StatusCode = 'I0665'
left outer join I_StatusObjectStatusBasic as _OrderMarkedForDeletion on _OrderMarkedForDeletion.StatusObject = _OrderOperation.ManufacturingObject
and _OrderMarkedForDeletion.StatusIsInactive = ''
and _OrderMarkedForDeletion.StatusCode = 'I0076'
association [0..1] to I_ManufacturingFeatureStatus as _ManufacturingFeatureStatus on $projection.ProductionPlant = _ManufacturingFeatureStatus.Plant
and _ManufacturingFeatureStatus.ManufacturingFeature = 'EPO'
association [0..1] to I_OrderItem as _OrderItem on $projection.ManufacturingOrder = _OrderItem.OrderID
and _OrderItem.OrderItem = '0001'
association [0..1] to I_MfgOrderOperationOrigin as _MfgOrderOperationOrigin on $projection.MfgOrderOperationOrigin = _MfgOrderOperationOrigin.MfgOrderOperationOrigin
association [1..1] to E_OrderOperation as _Extension on $projection.OrderInternalBillOfOperations = _Extension.OrderInternalID
and $projection.OrderIntBillOfOperationsItem = _Extension.OrderOperationInternalID
association [1..1] to P_OperationSequence as _OperSequence on $projection.OrderInternalBillOfOperations = _OperSequence.OrderInternalID
and $projection.ManufacturingOrderSequence = _OperSequence.Sequence
association [0..1] to P_MFGOrderOpPRTAssignment as _ProdnRsceTool on $projection.OrderInternalBillOfOperations = _ProdnRsceTool.MfgOrderInternalID
and $projection.OrderIntBillOfOperationsItem = _ProdnRsceTool.OrderOperationInternalID
association [0..1] to P_Oper_UserStatuses as _UserStatus on $projection.OrderInternalBillOfOperations = _UserStatus.OrderInternalBillOfOperations
and $projection.OrderIntBillOfOperationsItem = _UserStatus.OrderIntBillOfOperationsItem
association [0..1] to P_LatestOperation as _latestOp on $projection.OrderInternalBillOfOperations = _latestOp.OrderInternalBillOfOperations
and $projection.ProductionPlant = _latestOp.Plant
{
@UI.hidden : true
key _OrderOperation.OrderInternalBillOfOperations, // 6
@UI.hidden : true
key _OrderOperation.OrderIntBillOfOperationsItem, // 7
@ObjectModel.foreignKey.association: '_MfgOrder'
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_MfgOrderStdVH', element: 'ManufacturingOrder' } } ]
// @Search: {defaultSearchElement: true, ranking: #MEDIUM, fuzzinessThreshold: 0.8}
cast(_OrderOperation.ManufacturingOrder as aufnr preserving type) as ManufacturingOrder, // 1
@ObjectModel.text.element:['MfgOrderOperationText']
@UI.hidden : true
_OrderOperation.ManufacturingOrderOperation, // 3
@UI.hidden : true
// @Search: {defaultSearchElement: true, ranking: #MEDIUM, fuzzinessThreshold: 0.8}
_OrderOperation.MfgOrderOperationText, // 2
// cast (case _OrderItem.SerialNumberAssgmtProfile when '' then '' else 'X' end as boolean preserving type ) as SerialNmbrAssgmtProfileIsAssgd,
//@UI.hidden : true
_OrderOperation.ManufacturingOrderSubOperation, // 4
_OperSequence.SequenceCategory as MfgOrderSequenceCategory,
_OperSequence.SequenceCategoryName,
@UI.hidden : true
_OperSequence.Sequence,
_OperSequence.MfgOrderSequenceBrnchOperation,
_OperSequence.MfgOrderSequenceRetOperation,
_OperSequence.ReferenceSequence,
@UI.hidden : true
_OperSequence.BranchOperationInternalID,
@UI.hidden : true
_OperSequence.ReturnOperationInternalID,
// @UI.hidden : true
// @Search: {defaultSearchElement: true, ranking: #MEDIUM, fuzzinessThreshold: 0.8}
// _MfgOrder._Material._Text[1: Language=$session.system_language].MaterialName,
// @Search: {defaultSearchElement: true, ranking: #MEDIUM, fuzzinessThreshold: 0.8}
@ObjectModel.foreignKey.association: '_Material'
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_MaterialStdVH', element: 'Material' } } ]
@EndUserText.quickInfo: 'Manufacturing Operation Material'
_OrderOperation._MfgOrder.Material,
_OrderOperation.ManufacturingOrderSequence,
// @ObjectModel.text.element: '_ProductionPlant.PlantName'
@ObjectModel.foreignKey.association: '_ProductionPlant'
_OrderOperation.ProductionPlant, // 10
@UI.hidden : true
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_WorkCenterStdVH', element: 'WorkCenterInternalID' } } ]
// @Search: {defaultSearchElement: true, ranking: #MEDIUM, fuzzinessThreshold: 0.8}
_OrderOperation.WorkCenterInternalID, // 16
@ObjectModel.foreignKey.association: '_WorkCenterBySemanticKey'
@Consumption.valueHelpDefinition: [ { entity: { name: 'I_WrkCtrBySemanticKeyStdVH', element: 'WorkCenter' } } ]
// @Search: {defaultSearchElement: true, ranking: #MEDIUM, fuzzinessThreshold: 0.8}
@EndUserText.quickInfo: 'Manufacturing Operation Work center'
_OrderOperation.WorkCenter, // 14
@UI.hidden: true
// @Search: {defaultSearchElement: true, ranking: #MEDIUM, fuzzinessThreshold: 0.8}
_OrderOperation._WorkCenter._Text[1: Language=$session.system_language].WorkCenterText, // 15
@UI.hidden : true
_OrderOperation.WorkCenterTypeCode, // 17
_OrderOperation.ManufacturingOrderCategory, // 5
_OrderOperation.ManufacturingOrderType,
_OrderOperation.ProductionSupervisor,
_OrderOperation._ProductionSupervisor.ProductionSupervisorName,
@EndUserText.quickInfo: 'Manufacturing Operation MRP Controller'
_OrderOperation.MRPController,
@EndUserText.quickInfo: 'Manufacturing Operation MRP Controller Name'
_OrderOperation.MRPControllerName,
// @UI.hidden : true
// NumberOfConfirmationSlips,
// @UI.hidden : true
// OperationImportance,
_OrderOperation._ProductionPlant.PlantName as ProductionPlantName,
cast(_OrderOperation._ProductionPlant._Address.AddressTimeZone as co_plant_timezone ) as PlantTimeZone,
// @UI.hidden : true
// NumberOfTimeTickets,
// @UI.hidden: true
_OrderOperation.OperationControlProfile,
// @UI.hidden: true
// _ControlProfile.ConfirmationIsNotPossible,
//Status
@UI.hidden: true
_OrderOperation.OperationIsClosed, // 21
@UI.hidden: true
_OrderOperation.OperationIsTechlyCompleted, // 22
@UI.hidden: true
_OrderOperation.OperationIsDelivered, // 23
@UI.hidden: true
_OrderOperation.OperationIsPartiallyDelivered, // 24
@UI.hidden: true
_OrderOperation.OperationIsPartiallyConfirmed, // 25
@UI.hidden: true
_OrderOperation.OperationIsPrinted, // 26
@UI.hidden: true
_OrderOperation.OperationIsReleased, // 27
@UI.hidden: true
_OrderOperation.OperationIsCreated, // 28
@UI.hidden: true
_OrderOperation.OperationIsScheduled, // 29
@UI.hidden: true
_OrderOperation.OperationIsConfirmed, // 30
@UI.hidden: true
_OrderOperation.OperationIsDeleted, // 31
//Internal keys for mapping the status, this is requried for sorting, flitering and display current status in the UI
@UI.hidden: true
cast( case
when _OrderOperation.OperationIsDeleted = 'X' then '10'
when _OrderOperation.OperationIsClosed = 'X' then '09'
when _OrderOperation.OperationIsTechlyCompleted = 'X' then '08'
when _OrderOperation.OperationIsDelivered = 'X' then '07'
when _OrderOperation.OperationIsPartiallyDelivered = 'X' then '06'
when _OrderOperation.OperationIsConfirmed = 'X' then '05'
when _OrderOperation.OperationIsPartiallyConfirmed = 'X' then '04'
when _OrderOperation.OperationIsReleased = 'X' then '03'
when _OrderOperation.OperationIsScheduled = 'X' then '02'
when _OrderOperation.OperationIsCreated = 'X' then '01'
end as abap.numc(2)) as OperationStatusInternalID, // 20
//Quantities and Unit
@Semantics.quantity.unitOfMeasure: 'OperationUnit'
_OrderOperation.OpPlannedTotalQuantity, // 19
@Semantics.quantity.unitOfMeasure: 'OperationUnit'
_OrderOperation.OpTotalConfirmedYieldQty, // 18
@EndUserText.quickInfo: 'Manufacturing Operation Base Quantity'
_OrderOperation.OperationReferenceQuantity,
_OrderOperation.OpPlannedScrapQuantity,
_OrderOperation.OperationConfirmedReworkQty,
_OrderOperation.OpTotalConfirmedScrapQty,
@UI.hidden : true
//@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
_latestOp.OpLtstConfirmedScrapQty as OpLtstConfirmedScrapQty,
--Ready quantity
// @UI.hidden: true
// @Semantics.quantity.unitOfMeasure: 'OperationUnit'
// @ObjectModel.virtualElement
// @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_MPE_OPERREADY_QTY'
// cast( 0 as mpe_ready_qty) as MfgOrderOperationReadyQuantity,
-- Not Ready Quantity
// @UI.hidden: true
// @Semantics.quantity.unitOfMeasure: 'OperationUnit'
// @ObjectModel.virtualElement
// @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_MPE_OPER_NOTREADY_QTY'
// cast( 0 as mpe_not_ready_qty) as MfgOrderOperationNotReadyQty,
// @Search: {defaultSearchElement: true, ranking: #MEDIUM, fuzzinessThreshold: 0.8}
@ObjectModel.foreignKey.association: '_OperationUnit'
_OrderOperation.OperationUnit,
//External Processing
_OrderOperation.GoodsRecipientName,
_OrderOperation.UnloadingPointName,
//Dates
_OrderOperation.OpLtstSchedldExecStrtDte, // 32
@UI.hidden: true
_OrderOperation.OpLtstSchedldExecStrtTme, // 33
_OrderOperation.OpLtstSchedldExecEndDte, // 36
@UI.hidden: true
_OrderOperation.OpLtstSchedldExecEndTme, // 37
_OrderOperation.OpActualExecutionStartDate, // 34
@UI.hidden: true
_OrderOperation.OpActualExecutionStartTime, // 35
_OrderOperation.OpActualExecutionEndDate, // 38
@UI.hidden: true
_OrderOperation.OpActualExecutionEndTime, // 39
// @UI.hidden : true
// case OpActualExecutionStartDate
// when '00000000'
// then OpLtstSchedldExecStrtDte
// else OpActualExecutionStartDate
// end as OperationStartDate,
//End Date checks
// @UI.hidden : true
// case OpActualExecutionEndDate
// when '00000000'
// then 'X'
// else ' '
// end as OpExecutionIsNotComplete,
// @UI.hidden : true
// case OpActualExecutionStartDate
// when '00000000'
// then 'X'
// else ' '
// end as OperationExecutionIsNotStarted,
//Quality Issue Calculation
// @UI.hidden: true
// case when OpTotalConfirmedScrapQty > OpPlannedScrapQuantity
// then 'X'
// else ' '
// end as OperationHasScrapQualityIssue,
//Missing Components
// @UI.hidden: true
// case when _Component.combined_operns_miss_comp = 'X' then 'X'
// else ''
// end as OperationHasMissingComponents,
//Reservation Finally Issued
// @UI.hidden: true
// case when _Component.ReservationIsFinallyIssued = 'X' then 'X'
// else ''
// end as ReservationIsFinallyIssued,
//Missing Quantity
// @UI.hidden : true
// @Semantics.quantity.unitOfMeasure: 'OperationUnit'
// case when OperationYieldDeviationQty < 0 then ( - 1 * OperationYieldDeviationQty )
// else 0
// end as MissingQuantity,
// @UI.hidden : true
// @Semantics.quantity.unitOfMeasure: 'OperationUnit'
// case when OperationYieldDeviationQty < 0 then 0
// else OperationYieldDeviationQty
// end as OverDeliveryQuantity,
// @UI.hidden : true
// case OpPlannedTotalQuantity
// when 0
// then 0
// else
// case when OperationYieldDeviationQty < 0 then ( cast(( - 1 * OperationYieldDeviationQty * 100) as abap.fltp ) / cast(OpPlannedTotalQuantity as abap.fltp) )
// else 0.0
// end
// end as MissingQuantityInPercent,
// @UI.hidden : true
// case OpPlannedTotalQuantity
// when 0
// then 0
// else
// case when OperationYieldDeviationQty < 0 then 0.0
// else ((cast((OperationYieldDeviationQty * 100) as abap.fltp ) / cast(OpPlannedTotalQuantity as abap.fltp)))
// end
// end as OverdeliveryInPercent,
//Delay & Delay Calculation
// @UI.hidden: true
// OperationExecutionEndIsLate,
// @UI.hidden: true
// OperationExecutionStartIsLate,
// @UI.hidden: true
// OperationYieldDeviationQty,
//
// @UI.hidden : true
// ExecutionStartLatenessInHours,
// @UI.hidden : true
// ExecutionEndLatenessInHours,
// @UI.hidden : true
// ExecutionStartLatenessInMins,
// @UI.hidden : true
// ExecutionEndLatenessInMinutes,
// @UI.hidden : true
// OperationStartDeviationDays,
// @UI.hidden : true
// PlannedEndDateDvtnInDays,
// @UI.hidden : true
// case _MfgOrder._InspectionLot.InspectionLotType
// when '03'
// then _MfgOrder._InspectionLot.InspectionLot
// else ' '
// end as InspectionLot,
// @UI.hidden : true
// _QualityIssue.InspHasRejectedCharc,
// @UI.hidden : true
// _QualityIssue.InspHasRejectedInspSubset,
// @UI.hidden : true
// _QualityIssue.InspHasRejectedInspLot,
// @UI.hidden : true
// cast( case
// when _MfgOrderOperationIsOnHold.OperationHasProductionHold = 'X'
// then 'X'
// else '-'
// end as boolean preserving type) as OperationHasProductionHold,
@UI.hidden : true
// _OrderStatus.OrderIsShopFloorOrder, // 13
case when _OrderShopFloorStatus.StatusCode is not null then 'X' end as OrderIsShopFloorOrder,
// @UI.hidden : true
// ProductConfiguration,
//associations
@UI.selectionField: [{ exclude: true }]
_OrderOperation._MfgOrder,
@UI.selectionField: [{ exclude: true }]
_OrderOperation._WorkCenter,
@UI.selectionField: [{ exclude: true }]
_OrderOperation._WorkCenterBySemanticKey,
@UI.selectionField: [{ exclude: true }]
_OrderOperation._ProductionPlant,
@UI.selectionField: [{ exclude: true }]
_OrderOperation._MfgOrder._Material,
@UI.selectionField: [{ exclude: true }]
_OrderOperation._OperationUnit,
@UI.hidden : true
_ManufacturingFeatureStatus.ManufacturingFeature, // 12
@UI.hidden : true
_ManufacturingFeatureStatus.ManufacturingFeatureIsActive, // 8
@UI.hidden : true
_ManufacturingFeatureStatus.MfgFeatureIsActiveInAnyPlant, // 9
-- Effectivity Parameter
@UI.hidden: true
_OrderItem.EffectivityParameterVariant, // needed for below two fields
@ObjectModel: {
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_MPE_GET_EFFECTIVITY_VALUE'
}
cast('' as mpe_effectivity_parameter_desc) as EffectivityParameterDesc, // 40
@UI.hidden: true
@ObjectModel: {
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_MPE_GET_EFFECTIVITY_VALUE'
}
cast('' as abap.sstring( 256 )) as EffctyTypeCnctntdParamDesc, // 41
_OrderOperation._MfgOrder._BillOfOperations._BillOfOperationsVersionType.BOOVersionChangeRecordIsRqd,
@UI.hidden: true
_OrderOperation.BillOfOperationsType,
@UI.lineItem: [{qualifier: 'Routing'}]
cast(_OrderOperation.BillOfOperationsGroup as mpe_rtg_routing_group preserving type ) as BillOfOperationsGroup,
@UI.lineItem: [{qualifier: 'Routing'}]
cast(_OrderOperation.BillOfOperationsVariant as mpe_rtg_routing_variant preserving type) as BillOfOperationsVariant,
@UI.lineItem: [{qualifier: 'Routing'}]
_OrderOperation.BillOfOperationsVersion,
@UI.lineItem: [{qualifier: 'Routing'}]
@UI.hidden:true
_OrderOperation.MfgOrderOperationOrigin,
_MfgOrderOperationOrigin._Text[1: Language=$session.system_language].MfgOrderOperationOriginName,
-- Highlight Impacted Operations
@UI.hidden: true
@ObjectModel: { filter: { transformedBy: 'ABAP:CL_MPE_CIMA_SADL_FILTER_CONV' } }
cast( ' ' as abap.char( 255 ) ) as NetChangeAnalysisPath,
@UI.hidden: true
@ObjectModel: { filter: { transformedBy: 'ABAP:CL_MPE_CIMA_SADL_FILTER_CONV' } }
cast( ' ' as boole_d preserving type ) as ChangeImpactRelevanceFlagIsSet,
@UI.hidden: true
@ObjectModel: { filter: { transformedBy: 'ABAP:CL_MPE_CIMA_SADL_FILTER_CONV' } }
cast( ' ' as boole_d preserving type ) as OperationIsImpacted, //11
@UI.hidden: true
_OrderOperation.ManufacturingObject,
@UI.hidden : true
case when _OrderMarkedForDeletion.StatusCode is not null then 'X' end as OrderIsMarkedForDeletion,
@EndUserText.quickInfo: 'Production Resources/Tools Assigned'
cast( case
when _ProdnRsceTool.OrderOperationInternalID is null then ''
else 'X'
end as mpe_has_prt) as OpHasAssgdProdnRsceTools,
@EndUserText:{label: 'User Status', quickInfo: 'User Status'}
@Semantics.text: true
_UserStatus(im_clnt: $session.client).UserStatusText ,
@UI.hidden: true
_UserStatus(im_clnt: $session.client).StatusProfile
}
where
_OrderOperation.ManufacturingOrderCategory = '10'
// and _OrderOperation.ManufacturingOrderSubOperation = ''