@AbapCatalog.sqlViewName: 'IMFGORDOPFORCONF'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #XL, dataClass: #MIXED}
@VDM.viewType: #COMPOSITE
@EndUserText.label: 'Mfg Order Operation for Confirmation'
define view I_MfgOrderOperationForConf
as select from I_MfgOrderOperation as oper
inner join I_OrderItem as orditem on orditem.OrderID = oper.ManufacturingOrder
and orditem.OrderItem = '0001'
left outer to one join I_StatusObjectStatusBasic as _isCreated on _isCreated.StatusObject = oper.ManufacturingObject and _isCreated.StatusCode = 'I0001' and _isCreated.StatusIsInactive = '' // OperationIsCreated
left outer to one join I_StatusObjectStatusBasic as _isReleased on _isReleased.StatusObject = oper.ManufacturingObject and _isReleased.StatusCode = 'I0002' and _isReleased.StatusIsInactive = '' // OperationIsReleased
left outer to one join I_StatusObjectStatusBasic as _isPrinted on _isPrinted.StatusObject = oper.ManufacturingObject and _isPrinted.StatusCode = 'I0007' and _isPrinted.StatusIsInactive = '' // OperationIsPrinted
left outer to one join I_StatusObjectStatusBasic as _isConfirmed on _isConfirmed.StatusObject = oper.ManufacturingObject and _isConfirmed.StatusCode = 'I0009' and _isConfirmed.StatusIsInactive = '' // OperationIsConfirmed
left outer to one join I_StatusObjectStatusBasic as _isPartConf on _isPartConf.StatusObject = oper.ManufacturingObject and _isPartConf.StatusCode = 'I0010' and _isPartConf.StatusIsInactive = '' // OperationIsPartiallyConfirmed
left outer to one join I_StatusObjectStatusBasic as _isDeleted on _isDeleted.StatusObject = oper.ManufacturingObject and _isDeleted.StatusCode = 'I0013' and _isDeleted.StatusIsInactive = '' // OperationIsDeleted
left outer to one join I_StatusObjectStatusBasic as _isTechCompl on _isTechCompl.StatusObject = oper.ManufacturingObject and _isTechCompl.StatusCode = 'I0045' and _isTechCompl.StatusIsInactive = '' // OperationIsTechnicallyCompleted
left outer to one join I_StatusObjectStatusBasic as _isClosed on _isClosed.StatusObject = oper.ManufacturingObject and _isClosed.StatusCode = 'I0046' and _isClosed.StatusIsInactive = '' // OperationIsClosed
left outer to one join I_StatusObjectStatusBasic as _isScheduled on _isScheduled.StatusObject = oper.ManufacturingObject and _isScheduled.StatusCode = 'I0117' and _isScheduled.StatusIsInactive = '' // OperationIsScheduled
left outer to one join I_StatusObjectStatusBasic as _isPartDeliv on _isPartDeliv.StatusObject = oper.ManufacturingObject and _isPartDeliv.StatusCode = 'I0377' and _isPartDeliv.StatusIsInactive = '' // OperationIsPartiallyDelivered
left outer to one join I_StatusObjectStatusBasic as _isDelivered on _isDelivered.StatusObject = oper.ManufacturingObject and _isDelivered.StatusCode = 'I0378' and _isDelivered.StatusIsInactive = '' // OperationIsDelivered
association [0..1] to I_UnitOfMeasure as _OperationUnit on $projection.OperationUnit = _OperationUnit.UnitOfMeasure
association [0..1] to I_UnitOfMeasure as _ProductionUnit on $projection.ProductionUnit = _ProductionUnit.UnitOfMeasure
association [0..1] to I_UnitOfMeasure as _OpWorkQuantityUnit1 on $projection.OpWorkQuantityUnit1 = _OpWorkQuantityUnit1.UnitOfMeasure
association [0..1] to I_UnitOfMeasure as _OpWorkQuantityUnit2 on $projection.OpWorkQuantityUnit2 = _OpWorkQuantityUnit2.UnitOfMeasure
association [0..1] to I_UnitOfMeasure as _OpWorkQuantityUnit3 on $projection.OpWorkQuantityUnit3 = _OpWorkQuantityUnit3.UnitOfMeasure
association [0..1] to I_UnitOfMeasure as _OpWorkQuantityUnit4 on $projection.OpWorkQuantityUnit4 = _OpWorkQuantityUnit4.UnitOfMeasure
association [0..1] to I_UnitOfMeasure as _OpWorkQuantityUnit5 on $projection.OpWorkQuantityUnit5 = _OpWorkQuantityUnit5.UnitOfMeasure
association [0..1] to I_UnitOfMeasure as _OpWorkQuantityUnit6 on $projection.OpWorkQuantityUnit6 = _OpWorkQuantityUnit6.UnitOfMeasure
{
// Technical Key
@ObjectModel.foreignKey.association: '_OrdInternalBillOfOperations'
key oper.OrderInternalBillOfOperations,
key oper.OrderIntBillOfOperationsItem,
// Semantic key
@ObjectModel.foreignKey.association: '_MfgOrder'
oper.ManufacturingOrder,
@ObjectModel.foreignKey.association: '_MfgOrderSequence'
oper.ManufacturingOrderSequence,
@ObjectModel.text.element: 'MfgOrderOperationText'
oper.ManufacturingOrderOperation,
@ObjectModel.text.element: 'MfgOrderOperationText'
cast(oper.ManufacturingOrderSubOperation as vdm_vornr preserving type) as ManufacturingOrderSubOperation,
// Order header data
@ObjectModel.foreignKey.association: '_MfgOrderCategory'
oper.ManufacturingOrderCategory,
@ObjectModel.foreignKey.association: '_MfgOrderType'
oper.ManufacturingOrderType,
@ObjectModel.foreignKey.association: '_ProductionSupervisor'
oper.ProductionSupervisor,
@ObjectModel.foreignKey.association: '_MRPController'
oper.MRPController,
// Order Item
@ObjectModel.foreignKey.association: '_Material'
orditem.Material,
// Operation
@Semantics.text: true
oper.MfgOrderOperationText,
@ObjectModel.foreignKey.association: '_OperationControlProfile'
oper.OperationControlProfile,
@ObjectModel.foreignKey.association: '_OperationConfirmation'
oper.OperationConfirmation,
@ObjectModel.foreignKey.association: '_FactoryCalendar'
oper.FactoryCalendar,
@ObjectModel.foreignKey.association: '_ProductionPlant'
oper.ProductionPlant,
// Status
case when _isCreated.StatusCode is null then '' else 'X' end as OperationIsCreated,
case when _isReleased.StatusCode is null then '' else 'X' end as OperationIsReleased,
case when _isPrinted.StatusCode is null then '' else 'X' end as OperationIsPrinted,
case when _isConfirmed.StatusCode is null then '' else 'X' end as OperationIsConfirmed,
case when _isPartConf.StatusCode is null then '' else 'X' end as OperationIsPartiallyConfirmed,
case when _isDeleted.StatusCode is null then '' else 'X' end as OperationIsDeleted,
case when _isTechCompl.StatusCode is null then '' else 'X' end as OperationIsTechlyCompleted,
case when _isClosed.StatusCode is null then '' else 'X' end as OperationIsClosed,
case when _isScheduled.StatusCode is null then '' else 'X' end as OperationIsScheduled,
case when _isPartDeliv.StatusCode is null then '' else 'X' end as OperationIsPartiallyDelivered,
case when _isDelivered.StatusCode is null then '' else 'X' end as OperationIsDelivered,
// Operation Control Profile
oper._OperationControlProfile.ConfirmationIsRequired,
oper._OperationControlProfile.ConfirmationIsNotPossible,
// WorkCenter
@ObjectModel.foreignKey.association: '_WorkCenter'
oper.WorkCenterInternalID,
@ObjectModel.foreignKey.association: '_WorkCenterType'
oper.WorkCenterTypeCode_2 as WorkCenterTypeCode,
// Dates and Times
@Semantics.calendarItem.dtStart: true
oper.OpErlstSchedldExecStrtDte,
oper.OpErlstSchedldExecStrtTme,
@Semantics.calendarItem.dtStart: true
oper.OpErlstSchedldProcgStrtDte,
oper.OpErlstSchedldProcgStrtTme,
@Semantics.calendarItem.dtStart: true
oper.OpErlstSchedldTrdwnStrtDte,
oper.OpErlstSchedldTrdwnStrtTme,
@Semantics.calendarItem.dtEnd: true
oper.OpErlstSchedldExecEndDte,
oper.OpErlstSchedldExecEndTme,
@Semantics.calendarItem.dtStart: true
oper.OpLtstSchedldExecStrtDte,
oper.OpLtstSchedldExecStrtTme,
@Semantics.calendarItem.dtStart: true
oper.OpLtstSchedldProcgStrtDte,
oper.OpLtstSchedldProcgStrtTme,
@Semantics.calendarItem.dtStart: true
oper.OpLtstSchedldTrdwnStrtDte,
oper.OpLtstSchedldTrdwnStrtTme,
@Semantics.calendarItem.dtEnd: true
oper.OpLtstSchedldExecEndDte,
oper.OpLtstSchedldExecEndTme,
@Semantics.calendarItem.dtStart: true
oper.OperationConfirmedStartDate,
oper.OperationConfirmedEndDate,
@Semantics.calendarItem.dtStart: true
oper.OpActualExecutionStartDate,
oper.OpActualExecutionStartTime,
@Semantics.calendarItem.dtEnd: true
oper.OpActualSetupEndDate,
oper.OpActualSetupEndTime,
@Semantics.calendarItem.dtStart: true
oper.OpActualProcessingStartDate,
oper.OpActualProcessingStartTime,
@Semantics.calendarItem.dtEnd: true
oper.OpActualProcessingEndDate,
oper.OpActualProcessingEndTime,
@Semantics.calendarItem.dtStart: true
oper.OpActualTeardownStartDate,
oper.OpActualTeardownStartTme,
@Semantics.calendarItem.dtEnd: true
oper.OpActualExecutionEndDate,
oper.OpActualExecutionEndTime,
// Quantities and UoM
@Semantics.unitOfMeasure: true
oper.OperationUnit,
@Semantics.unitOfMeasure: true
oper.ProductionUnit,
oper.OpQtyToBaseQtyDnmntr,
oper.OpQtyToBaseQtyNmrtr,
oper.OperationScrapPercent,
@Semantics.quantity.unitOfMeasure: 'OperationUnit'
@DefaultAggregation: #NONE
oper.OpPlannedTotalQuantity,
@Semantics.quantity.unitOfMeasure: 'OperationUnit'
@DefaultAggregation: #NONE
oper.OpPlannedScrapQuantity,
@Semantics.quantity.unitOfMeasure: 'OperationUnit'
@DefaultAggregation: #NONE
oper.OpPlannedYieldQuantity,
@Semantics.quantity.unitOfMeasure: 'OperationUnit'
@DefaultAggregation: #NONE
oper.OpTotalConfirmedYieldQty,
@Semantics.quantity.unitOfMeasure: 'OperationUnit'
@DefaultAggregation: #NONE
oper.OpTotalConfirmedScrapQty,
@Semantics.quantity.unitOfMeasure: 'OperationUnit'
@DefaultAggregation: #NONE
oper.OperationConfirmedReworkQty,
// Confirmed Work Quantities and UoM
@Semantics.unitOfMeasure: true
oper.OpWorkQuantityUnit1 as OpWorkQuantityUnit1,
@Semantics.quantity.unitOfMeasure: 'OpWorkQuantityUnit1'
@DefaultAggregation: #NONE
oper.OpConfirmedWorkQuantity1,
oper.NoFurtherOpWorkQuantity1IsExpd,
@Semantics.unitOfMeasure: true
oper.OpWorkQuantityUnit2 as OpWorkQuantityUnit2,
@Semantics.quantity.unitOfMeasure: 'OpWorkQuantityUnit2'
@DefaultAggregation: #NONE
oper.OpConfirmedWorkQuantity2,
oper.NoFurtherOpWorkQuantity2IsExpd,
@Semantics.unitOfMeasure: true
oper.OpWorkQuantityUnit3 as OpWorkQuantityUnit3,
@Semantics.quantity.unitOfMeasure: 'OpWorkQuantityUnit3'
@DefaultAggregation: #NONE
oper.OpConfirmedWorkQuantity3,
oper.NoFurtherOpWorkQuantity3IsExpd,
@Semantics.unitOfMeasure: true
oper.OpWorkQuantityUnit4 as OpWorkQuantityUnit4,
@Semantics.quantity.unitOfMeasure: 'OpWorkQuantityUnit4'
@DefaultAggregation: #NONE
oper.OpConfirmedWorkQuantity4,
oper.NoFurtherOpWorkQuantity4IsExpd,
@Semantics.unitOfMeasure: true
oper.OpWorkQuantityUnit5 as OpWorkQuantityUnit5,
@Semantics.quantity.unitOfMeasure: 'OpWorkQuantityUnit5'
@DefaultAggregation: #NONE
oper.OpConfirmedWorkQuantity5,
oper.NoFurtherOpWorkQuantity5IsExpd,
@Semantics.unitOfMeasure: true
oper.OpWorkQuantityUnit6 as OpWorkQuantityUnit6,
@Semantics.quantity.unitOfMeasure: 'OpWorkQuantityUnit6'
@DefaultAggregation: #NONE
oper.OpConfirmedWorkQuantity6,
oper.NoFurtherOpWorkQuantity6IsExpd,
// Work Quantities and UoM
@Semantics.unitOfMeasure: true
oper.WorkCenterStandardWorkQtyUnit1 as WorkCenterStandardWorkQtyUnit1,
@Semantics.quantity.unitOfMeasure: 'WorkCenterStandardWorkQtyUnit1'
@DefaultAggregation: #NONE
oper.WorkCenterStandardWorkQty1,
oper.CostCtrActivityType1,
@Semantics.unitOfMeasure: true
oper.WorkCenterStandardWorkQtyUnit2 as WorkCenterStandardWorkQtyUnit2,
@Semantics.quantity.unitOfMeasure: 'WorkCenterStandardWorkQtyUnit2'
@DefaultAggregation: #NONE
oper.WorkCenterStandardWorkQty2,
oper.CostCtrActivityType2,
@Semantics.unitOfMeasure: true
oper.WorkCenterStandardWorkQtyUnit3 as WorkCenterStandardWorkQtyUnit3,
@Semantics.quantity.unitOfMeasure: 'WorkCenterStandardWorkQtyUnit3'
@DefaultAggregation: #NONE
oper.WorkCenterStandardWorkQty3,
oper.CostCtrActivityType3,
@Semantics.unitOfMeasure: true
oper.WorkCenterStandardWorkQtyUnit4 as WorkCenterStandardWorkQtyUnit4,
@Semantics.quantity.unitOfMeasure: 'WorkCenterStandardWorkQtyUnit4'
@DefaultAggregation: #NONE
oper.WorkCenterStandardWorkQty4,
oper.CostCtrActivityType4,
@Semantics.unitOfMeasure: true
oper.WorkCenterStandardWorkQtyUnit5 as WorkCenterStandardWorkQtyUnit5,
@Semantics.quantity.unitOfMeasure: 'WorkCenterStandardWorkQtyUnit5'
@DefaultAggregation: #NONE
oper.WorkCenterStandardWorkQty5,
oper.CostCtrActivityType5,
@Semantics.unitOfMeasure: true
oper.WorkCenterStandardWorkQtyUnit6 as WorkCenterStandardWorkQtyUnit6,
@Semantics.quantity.unitOfMeasure: 'WorkCenterStandardWorkQtyUnit6'
@DefaultAggregation: #NONE
oper.WorkCenterStandardWorkQty6,
oper.CostCtrActivityType6,
// HR fields
oper.Personnel,
// Associations
oper._OrdInternalBillOfOperations,
oper._MfgOrder,
oper._MfgOrderSequence,
oper._MfgOrderCategory,
oper._MfgOrderType,
oper._ProductionSupervisor,
oper._MRPController,
oper._OperationConfirmation,
oper._FactoryCalendar,
oper._ProductionPlant,
_OperationUnit,
_ProductionUnit,
_OpWorkQuantityUnit1,
_OpWorkQuantityUnit2,
_OpWorkQuantityUnit3,
_OpWorkQuantityUnit4,
_OpWorkQuantityUnit5,
_OpWorkQuantityUnit6,
oper._WorkCenter_2 as _WorkCenter,
oper._WorkCenterType_2 as _WorkCenterType,
orditem._Material,
oper._OperationControlProfile
}
where oper.OperationIsToBeDeleted = '';
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MFGORDEROPERATION",
"I_OPERATIONCONTROLPROFILE",
"I_ORDERITEM",
"I_STATUSOBJECTSTATUSBASIC"
],
"ASSOCIATED":
[
"I_CONFIRMATIONGROUP",
"I_FACTORYCALENDAR",
"I_MATERIAL",
"I_MFGORDER",
"I_MFGORDERCATEGORY",
"I_MFGORDERSEQUENCE",
"I_MFGORDERTYPE",
"I_MRPCONTROLLER",
"I_OPERATIONCONTROLPROFILE",
"I_ORDINTERNALBILLOFOPERATIONS",
"I_PLANT",
"I_PRODUCTIONSUPERVISOR",
"I_UNITOFMEASURE",
"I_WORKCENTER",
"I_WORKCENTERTYPE"
],
"BASE":
[
"I_MFGORDEROPERATION",
"I_ORDERITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/