I_MFGORDEROPERATIONDELAYBASIC

CDS View

Manufacturing Order Operation Delay Basic Data

I_MFGORDEROPERATIONDELAYBASIC is a CDS View in S/4HANA. Manufacturing Order Operation Delay Basic Data. It contains 46 fields. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
P_MfgProcgExecOperation view from CONSUMPTION PEO Manufacturing Order Operation

Fields (46)

KeyField CDS FieldsUsed in Views
KEY OrderIntBillOfOperationsItem OrderIntBillOfOperationsItem 1
KEY OrderInternalBillOfOperations OrderInternalBillOfOperations 1
_ProductionPlant _ProductionPlant 1
_WorkCenter _WorkCenter 1
ManufacturingOrder ManufacturingOrder 1
ManufacturingOrderCategory ManufacturingOrderCategory 1
ManufacturingOrderOperation ManufacturingOrderOperation 1
ManufacturingOrderSequence ManufacturingOrderSequence 1
ManufacturingOrderType ManufacturingOrderType 1
MfgOrderOperationText MfgOrderOperationText 1
OpActualExecutionEndDate OpActualExecutionEndDate 1
OpActualExecutionEndDateTime OpActualExecutionEndDateTime 1
OpActualExecutionEndTime OpActualExecutionEndTime 1
OpActualExecutionStartDate OpActualExecutionStartDate 1
OpActualExecutionStartDateTime OpActualExecutionStartDateTime 1
OpActualExecutionStartTime OpActualExecutionStartTime 1
OperationExecutionEndIsLate OperationExecutionEndIsLate 1
OperationExecutionStartIsLate OperationExecutionStartIsLate 1
OperationIsConfirmed OperationIsConfirmed 1
OperationIsCreated OperationIsCreated 1
OperationIsDeleted OperationIsDeleted 1
OperationIsDelivered OperationIsDelivered 1
OperationIsPartiallyConfirmed OperationIsPartiallyConfirmed 1
OperationIsPartiallyDelivered OperationIsPartiallyDelivered 1
OperationIsPrinted OperationIsPrinted 1
OperationIsReleased OperationIsReleased 1
OperationIsScheduled OperationIsScheduled 1
OperationIsTechlyCompleted OperationIsTechlyCompleted 1
OperationUnit OperationUnit 1
OperationYieldDeviationQty OperationYieldDeviationQty 1
OpLtstSchedldExecEndDte OpLtstSchedldExecEndDte 1
OpLtstSchedldExecEndDteTme OpLtstSchedldExecEndDteTme 1
OpLtstSchedldExecEndTme OpLtstSchedldExecEndTme 1
OpLtstSchedldExecStrtDte OpLtstSchedldExecStrtDte 1
OpLtstSchedldExecStrtDteTme OpLtstSchedldExecStrtDteTme 1
OpLtstSchedldExecStrtTme OpLtstSchedldExecStrtTme 1
OpPlannedTotalQuantity OpPlannedTotalQuantity 1
OpTotalConfirmedScrapQty OpTotalConfirmedScrapQty 1
OpTotalConfirmedYieldQty OpTotalConfirmedYieldQty 1
PlantTimeZone PlantTimeZone 1
ProdnProcgIsFlexible ProdnProcgIsFlexible 1
ProduceOpActyNtwkInstance ProduceOpActyNtwkInstance 1
ProductionPlant ProductionPlant 1
Reservation Reservation 1
WorkCenterInternalID WorkCenterInternalID 1
WorkCenterTypeCode WorkCenterTypeCode 1
@AbapCatalog.sqlViewName: 'IMFGORDOPDELYBSC'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AccessControl.privilegedAssociations: ['_MRPController', '_ProductionSupervisor']
@Analytics.dataCategory: #DIMENSION
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.allowExtensions: true
@ObjectModel.modelingPattern: #NONE
@ObjectModel.supportedCapabilities: [#SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE]
@ObjectModel.representativeKey: 'OrderIntBillOfOperationsItem'
@ObjectModel.usageType: {serviceQuality: #D, sizeCategory: #XL, dataClass: #MIXED}
@VDM.viewType: #COMPOSITE
@EndUserText.label: 'Manufacturing Order Operation Delay Basic Data'
// Manufacturing Order Operation Delay data without suboperation and phase determination


define view I_MfgOrderOperationDelayBasic
  as select from           P_MfgOrderOperationDelayBasic as afvg
  --    inner join   P_OrderOperationStatusBasicAgg as stat on stat.ObjectInternalID = afvg.ObjectInternalID // Status

    left outer to one join I_StatusObjectStatusBasic     as isCreated   on  isCreated.StatusObject     = afvg.ObjectInternalID
                                                                        and isCreated.StatusCode       = 'I0001'
                                                                        and isCreated.StatusIsInactive = ''   // OperationIsCreated

    left outer to one join I_StatusObjectStatusBasic     as isReleased  on  isReleased.StatusObject     = afvg.ObjectInternalID
                                                                        and isReleased.StatusCode       = 'I0002'
                                                                        and isReleased.StatusIsInactive = ''  // OperationIsReleased

    left outer to one join I_StatusObjectStatusBasic     as isPrinted   on  isPrinted.StatusObject     = afvg.ObjectInternalID
                                                                        and isPrinted.StatusCode       = 'I0007'
                                                                        and isPrinted.StatusIsInactive = ''   // OperationIsPrinted

    left outer to one join I_StatusObjectStatusBasic     as isConfirmed on  isConfirmed.StatusObject     = afvg.ObjectInternalID
                                                                        and isConfirmed.StatusCode       = 'I0009'
                                                                        and isConfirmed.StatusIsInactive = '' // OperationIsConfirmed

    left outer to one join I_StatusObjectStatusBasic     as isPartConf  on  isPartConf.StatusObject     = afvg.ObjectInternalID
                                                                        and isPartConf.StatusCode       = 'I0010'
                                                                        and isPartConf.StatusIsInactive = ''  // OperationIsPartiallyConfirmed

    left outer to one join I_StatusObjectStatusBasic     as isDeleted   on  isDeleted.StatusObject     = afvg.ObjectInternalID
                                                                        and isDeleted.StatusCode       = 'I0013'
                                                                        and isDeleted.StatusIsInactive = ''   // OperationIsDeleted

    left outer to one join I_StatusObjectStatusBasic     as isTechCompl on  isTechCompl.StatusObject     = afvg.ObjectInternalID
                                                                        and isTechCompl.StatusCode       = 'I0045'
                                                                        and isTechCompl.StatusIsInactive = '' // OperationIsTechnicallyCompleted

    left outer to one join I_StatusObjectStatusBasic     as isClosed    on  isClosed.StatusObject     = afvg.ObjectInternalID
                                                                        and isClosed.StatusCode       = 'I0046'
                                                                        and isClosed.StatusIsInactive = ''    // OperationIsClosed

    left outer to one join I_StatusObjectStatusBasic     as isScheduled on  isScheduled.StatusObject     = afvg.ObjectInternalID
                                                                        and isScheduled.StatusCode       = 'I0117'
                                                                        and isScheduled.StatusIsInactive = '' // OperationIsScheduled

    left outer to one join I_StatusObjectStatusBasic     as isPartDeliv on  isPartDeliv.StatusObject     = afvg.ObjectInternalID
                                                                        and isPartDeliv.StatusCode       = 'I0377'
                                                                        and isPartDeliv.StatusIsInactive = '' // OperationIsPartiallyDelivered

    left outer to one join I_StatusObjectStatusBasic     as isDelivered on  isDelivered.StatusObject     = afvg.ObjectInternalID
                                                                        and isDelivered.StatusCode       = 'I0378'
                                                                        and isDelivered.StatusIsInactive = '' // OperationIsDelivered



  association [1..1] to I_OrderInternalID            as _OrdInternalBillOfOperations  on  $projection.OrderInternalBillOfOperations = _OrdInternalBillOfOperations.OrderInternalID
  association [1..1] to I_MfgOrder                   as _MfgOrder                     on  $projection.ManufacturingOrder = _MfgOrder.ManufacturingOrder
  association [1..1] to I_ManufacturingOrder         as _MfgOrder_2                   on  $projection.ManufacturingOrder = _MfgOrder_2.ManufacturingOrder
  association [1..1] to I_MfgOrderSequence           as _MfgOrderSequence             on  $projection.ManufacturingOrder         = _MfgOrderSequence.ManufacturingOrder
                                                                                      and $projection.ManufacturingOrderSequence = _MfgOrderSequence.ManufacturingOrderSequence
  association [1..1] to I_MfgOrderCategory           as _MfgOrderCategory             on  $projection.ManufacturingOrderCategory = _MfgOrderCategory.ManufacturingOrderCategory
  association [1..1] to I_MfgOrderType               as _MfgOrderType                 on  $projection.ManufacturingOrderType = _MfgOrderType.ManufacturingOrderType

  association [0..1] to I_OperationStandardText      as _OperationStandardTextCode    on  $projection.OperationStandardTextCode = _OperationStandardTextCode.OperationStandardTextCode
  association [1..1] to I_Plant                      as _ProductionPlant              on  $projection.ProductionPlant = _ProductionPlant.Plant
  association [1..1] to I_UnitOfMeasure              as _OperationUnit                on  $projection.OperationUnit = _OperationUnit.UnitOfMeasure
  association [0..1] to I_MRPController              as _MRPController                on  $projection.ProductionPlant = _MRPController.Plant
                                                                                      and $projection.MRPController   = _MRPController.MRPController
  association [0..1] to I_ProductionSupervisor       as _ProductionSupervisor         on  $projection.ProductionPlant      = _ProductionSupervisor.Plant
                                                                                      and $projection.ProductionSupervisor = _ProductionSupervisor.ProductionSupervisor
  association [0..1] to I_ResponsiblePlannerGroup    as _ResponsiblePlannerGroup      on  $projection.ProductionPlant         = _ResponsiblePlannerGroup.Plant
                                                                                      and $projection.ResponsiblePlannerGroup = _ResponsiblePlannerGroup.ResponsiblePlannerGroup
  association [0..1] to I_WorkCenterType             as _WorkCenterType               on  $projection.WorkCenterTypeCode = _WorkCenterType.WorkCenterTypeCode
  association [0..1] to I_WorkCenter                 as _WorkCenter                   on  $projection.WorkCenterTypeCode   = _WorkCenter.WorkCenterTypeCode
                                                                                      and $projection.WorkCenterInternalID = _WorkCenter.WorkCenterInternalID
  association [1..1] to I_OperationControlProfile    as _OperationControlProfile      on  $projection.OperationControlProfile = _OperationControlProfile.OperationControlProfile
  association [0..1] to I_BillOfOperationsType       as _BillOfOperationsType         on  $projection.BillOfOperationsType = _BillOfOperationsType.BillOfOperationsType
  association [0..1] to I_BillOfOperationsGroup      as _BillOfOperationsGroup        on  $projection.BillOfOperationsType  = _BillOfOperationsGroup.BillOfOperationsType
                                                                                      and $projection.BillOfOperationsGroup = _BillOfOperationsGroup.BillOfOperationsGroup
  association [0..1] to I_BillOfOperations           as _BillOfOperationsVariant      on  $projection.BillOfOperationsType    = _BillOfOperationsVariant.BillOfOperationsType
                                                                                      and $projection.BillOfOperationsGroup   = _BillOfOperationsVariant.BillOfOperationsGroup
                                                                                      and $projection.BillOfOperationsVariant = _BillOfOperationsVariant.BillOfOperationsVariant
  association [0..1] to I_BillOfOperationsSequence   as _BillOfOperationsSequence     on  $projection.BillOfOperationsType     = _BillOfOperationsSequence.BillOfOperationsType
                                                                                      and $projection.BillOfOperationsGroup    = _BillOfOperationsSequence.BillOfOperationsGroup
                                                                                      and $projection.BillOfOperationsVariant  = _BillOfOperationsSequence.BillOfOperationsVariant
                                                                                      and $projection.BillOfOperationsSequence = _BillOfOperationsSequence.BillOfOperationsSequence
  association [0..1] to I_BOOOperationInternalID     as _BOOOperationInternalID       on  $projection.BillOfOperationsType   = _BOOOperationInternalID.BillOfOperationsType
                                                                                      and $projection.BillOfOperationsGroup  = _BOOOperationInternalID.BillOfOperationsGroup
                                                                                      and $projection.BOOOperationInternalID = _BOOOperationInternalID.BOOOperationInternalID
  association [0..1] to I_FactoryCalendar            as _FactoryCalendar              on  $projection.FactoryCalendar = _FactoryCalendar.FactoryCalendar
  association [0..1] to I_CapacityRequirement        as _CapacityRequirement          on  $projection.CapacityRequirement = _CapacityRequirement.CapacityRequirement
  association [0..1] to I_CapacityRequirementItem    as _CapacityRequirementItem      on  $projection.CapacityRequirement     = _CapacityRequirementItem.CapacityRequirement
                                                                                      and $projection.CapacityRequirementItem = _CapacityRequirementItem.CapacityRequirementItem

  association [0..1] to I_ConfirmationGroup          as _OperationConfirmation        on  $projection.OperationConfirmation = _OperationConfirmation.ConfirmationGroup
  association [0..1] to I_ChangeMaster               as _ChangeNumber                 on  $projection.ChangeNumber = _ChangeNumber.ChangeNumber
  association [0..1] to I_EmployeeWageGroup          as _EmployeeWageGroup            on  $projection.ProductionPlant   = _EmployeeWageGroup.Plant
                                                                                      and $projection.EmployeeWageGroup = _EmployeeWageGroup.EmployeeWageGroup
  association [0..1] to I_EmployeeSuitability        as _EmployeeSuitability          on  $projection.ProductionPlant     = _EmployeeSuitability.Plant
                                                                                      and $projection.EmployeeSuitability = _EmployeeSuitability.EmployeeSuitability
  --association [0..1] to I_Employment                  as _Employee                     on  $projection.Personnel = _Employee.EmploymentInternalID
  association [0..1] to I_PersonWorkAgreement_1      as _Employee                     on  $projection.Personnel = _Employee.PersonWorkAgreement
  association [0..1] to I_CompanyCode                as _CompanyCode                  on  $projection.CompanyCode = _CompanyCode.CompanyCode
  association [0..*] to I_ProfitCenter               as _ProfitCenter                 on  $projection.ControllingArea = _ProfitCenter.ControllingArea
                                                                                      and $projection.ProfitCenter    = _ProfitCenter.ProfitCenter
  association [0..1] to I_ControllingArea            as _ControllingArea              on  $projection.ControllingArea = _ControllingArea.ControllingArea
  association [0..1] to I_ControllingObjectClass     as _ControllingObjectClass       on  $projection.ControllingObjectClass = _ControllingObjectClass.ControllingObjectClass
  association [0..1] to I_FunctionalArea             as _FunctionalArea               on  $projection.FunctionalArea = _FunctionalArea.FunctionalArea
  association [0..1] to I_BusinessArea               as _BusinessArea                 on  $projection.BusinessArea = _BusinessArea.BusinessArea
  association [0..1] to I_OperationDateOffsetRefCode as _StartDateOffsetReferenceCode on  $projection.StartDateOffsetReferenceCode = _StartDateOffsetReferenceCode.OperationDateOffsetRefCode
  association [0..1] to I_OperationDateOffsetRefCode as _EndDateOffsetReferenceCode   on  $projection.EndDateOffsetReferenceCode = _EndDateOffsetReferenceCode.OperationDateOffsetRefCode
  association [0..1] to I_Language                   as _Language                     on  $projection.Language = _Language.Language

{
      // Technical Key

      @ObjectModel.foreignKey.association: '_OrdInternalBillOfOperations'
  key cast(afvg.OrderInternalID          as pph_aufpl           preserving type)          as OrderInternalBillOfOperations,
  key cast(afvg.OrderOperationInternalID as operationinternalid preserving type)          as OrderIntBillOfOperationsItem,

      // Semantic key

      @ObjectModel.foreignKey.association: '_MfgOrder'
      cast(afvg.ManufacturingOrder as manufacturingorder preserving type)                 as ManufacturingOrder,
      @ObjectModel.foreignKey.association: '_MfgOrderSequence'
      cast(afvg.Sequence as manufacturingordersequence preserving type)                   as ManufacturingOrderSequence,
      @VDM.lifecycle.status: #DEPRECATED
      @VDM.lifecycle.successor: 'ManufacturingOrderOperation_2'
      @ObjectModel.text.element: ['MfgOrderOperationText']
      cast(afvg.Operation as manufacturingorderoperation preserving type)                 as ManufacturingOrderOperation,
      @ObjectModel.text.element: ['MfgOrderOperationText']
      cast(afvg.Operation as vdm_vornr preserving type)                                   as ManufacturingOrderOperation_2, // no conv. exit


      // Order header data

      @ObjectModel.foreignKey.association: '_MfgOrderCategory'
      cast(afvg.ManufacturingOrderCategory as manufacturingordercategory preserving type) as ManufacturingOrderCategory,
      @ObjectModel.foreignKey.association: '_MfgOrderType'
      cast(afvg.ManufacturingOrderType     as manufacturingordertype preserving type)     as ManufacturingOrderType,
      @ObjectModel.foreignKey.association: '_ProductionSupervisor'
      cast(afvg.ProductionSupervisor       as pph_fevor preserving type)                  as ProductionSupervisor,
      @ObjectModel.foreignKey.association: '_MRPController'
      cast(afvg.MRPController              as pph_dispo preserving type)                  as MRPController,
      @ObjectModel.foreignKey.association: '_ResponsiblePlannerGroup'
      cast(afvg.ResponsiblePlannerGroup    as vagrp preserving type)                      as ResponsiblePlannerGroup,
      cast(afvg.ProductConfiguration       as product_configuration preserving type)      as ProductConfiguration,
      afvg.InspectionLot,
      afvg.Reservation,
      afvg.ManufacturingOrderImportance,
      afvg.ProdnProcgIsFlexible,

      // Text

      @Semantics.text: true
      cast(afvg.OperationText as mfgorderoperationtext preserving type)                   as MfgOrderOperationText,
      @ObjectModel.foreignKey.association: '_Language'
      afvg.Language                                                                       as Language,
      @ObjectModel.foreignKey.association: '_OperationStandardTextCode'
      cast(afvg.StandardTextInternalID as pph_ktsch preserving type)                      as OperationStandardTextCode,

      // Attributes

      afvg.OperationIsToBeDeleted,
      cast(afvg.NumberOfCapacities as pph_anzkap preserving type)                         as NumberOfCapacities,
      afvg.NumberOfConfirmationSlips,
      afvg.OperationImportance,

      // Assignments

      @ObjectModel.foreignKey.association: '_ProductionPlant'
      cast(afvg.Plant as pwwrk preserving type)                                           as ProductionPlant,
      @ObjectModel.foreignKey.association: '_WorkCenter'
      cast(afvg.WorkCenterInternalID as pph_arbid preserving type)                        as WorkCenterInternalID,
      @ObjectModel.foreignKey.association: '_WorkCenterType'
      afvg.WorkCenterTypeCode                                                             as WorkCenterTypeCode,
      @ObjectModel.foreignKey.association: '_OperationControlProfile'
      cast(afvg.OperationControlProfile as pph_steus preserving type)                     as OperationControlProfile,
      @ObjectModel.foreignKey.association: '_OperationConfirmation'
      afvg.OperationConfirmation,
      cast(afvg.NumberOfOperationConfirmations as pph_noofconf preserving type)           as NumberOfOperationConfirmations,
      @ObjectModel.foreignKey.association: '_FactoryCalendar'
      cast(afvg.FactoryCalendar as cr_wfcid preserving type)                              as FactoryCalendar,
      @ObjectModel.foreignKey.association: '_CapacityRequirement'
      afvg.CapacityRequirement,
      @ObjectModel.foreignKey.association: '_CapacityRequirementItem'
      cast(afvg.CapacityRequirementItem as pph_bedzl preserving type)                     as CapacityRequirementItem,
      @ObjectModel.foreignKey.association: '_ChangeNumber'
      afvg.ChangeNumber,

      // Assignments BOO and BOM

      @ObjectModel.foreignKey.association: '_BillOfOperationsType'
      cast(afvg.BillOfOperationsType as billofoperationstype preserving type)             as BillOfOperationsType,
      @ObjectModel.foreignKey.association: '_BillOfOperationsGroup'
      afvg.BillOfOperationsGroup,
      @ObjectModel.foreignKey.association: '_BillOfOperationsVariant'
      afvg.BillOfOperationsVariant,
      @ObjectModel.foreignKey.association: '_BillOfOperationsSequence'
      afvg.BillOfOperationsSequence,
      @ObjectModel.foreignKey.association: '_BOOOperationInternalID'
      afvg.BOOOperationInternalID,
      afvg.BillOfOperationsVersion,
      cast(afvg.BillOfMaterialCategory       as pph_stlty preserving type)                as BillOfMaterialCategory,
      @VDM.lifecycle.status: #DEPRECATED
      @VDM.lifecycle.successor: 'BillOfMaterialInternalID_2'
      afvg.BillOfMaterialInternalID,
      cast(afvg.BillOfMaterialInternalID     as pph_stnum preserving type)                as BillOfMaterialInternalID_2, // no conv. eit

      cast(afvg.BillOfMaterialItemNodeNumber as pph_stlkn preserving type)                as BillOfMaterialItemNodeNumber,
      afvg.BOMItemNodeCount,

      // Assignments FI/CO

      @ObjectModel.foreignKey.association: '_CompanyCode'
      afvg.CompanyCode,
      @ObjectModel.foreignKey.association: '_BusinessArea'
      afvg.BusinessArea,
      @ObjectModel.foreignKey.association: '_ControllingArea'
      afvg.ControllingArea,
      afvg.ProfitCenter,
      @ObjectModel.foreignKey.association: '_ControllingObjectClass'
      afvg.ControllingObjectClass,
      @ObjectModel.foreignKey.association: '_FunctionalArea'
      afvg.FunctionalArea,

      // Assignments HR

      cast(afvg.EmployeeWageType    as pph_loart preserving type)                         as EmployeeWageType,
      @ObjectModel.foreignKey.association: '_EmployeeWageGroup'
      cast(afvg.EmployeeWageGroup   as pph_logrp preserving type)                         as EmployeeWageGroup,
      @ObjectModel.foreignKey.association: '_EmployeeSuitability'
      cast(afvg.EmployeeSuitability as pph_qualf preserving type)                         as EmployeeSuitability,
      afvg.NumberOfTimeTickets,
      @ObjectModel.foreignKey.association: '_Employee'
      cast(afvg.Personnel           as pph_pernr preserving type)                         as Personnel,
      cast(afvg.NumberOfEmployees   as pph_anzms preserving type)                         as NumberOfEmployees,

      // Dates and Times

      @Semantics.timeZone: true
      afvg.PlantTimeZone,
      @Semantics.calendarItem.dtStart: true
      cast(afvg.OpErlstSchedldExecStrtDte   as pph_fsavd preserving type)                 as OpErlstSchedldExecStrtDte,
      cast(afvg.OpErlstSchedldExecStrtTme   as pph_fsavz preserving type)                 as OpErlstSchedldExecStrtTme,
      @Semantics.calendarItem.dtStart: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpErlstSchedldExecStrtDteTme,
      @Semantics.calendarItem.dtStart: true
      cast(afvg.OpErlstSchedldProcgStrtDte  as pph_fssbd preserving type)                 as OpErlstSchedldProcgStrtDte,
      cast(afvg.OpErlstSchedldProcgStrtTme  as pph_fssbz preserving type)                 as OpErlstSchedldProcgStrtTme,
      @Semantics.calendarItem.dtStart: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpErlstSchedldProcgStrtDteTme,
      @Semantics.calendarItem.dtStart: true
      cast(afvg.OpErlstSchedldTrdwnStrtDte  as pph_fssad preserving type)                 as OpErlstSchedldTrdwnStrtDte,
      cast(afvg.OpErlstSchedldTrdwnStrtTme  as pph_fssaz preserving type)                 as OpErlstSchedldTrdwnStrtTme,
      @Semantics.calendarItem.dtStart: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpErlstSchedldTrdwnStrtDteTme,
      @Semantics.calendarItem.dtEnd: true
      cast(afvg.OpErlstSchedldExecEndDte    as pph_fsedd preserving type)                 as OpErlstSchedldExecEndDte,
      cast(afvg.OpErlstSchedldExecEndTme    as pph_fsedz preserving type)                 as OpErlstSchedldExecEndTme,
      @Semantics.calendarItem.dtEnd: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpErlstSchedldExecEndDteTme,
      @Semantics.calendarItem.dtStart: true
      cast(afvg.OpLtstSchedldExecStrtDte    as pph_ssavd preserving type)                 as OpLtstSchedldExecStrtDte,
      cast(afvg.OpLtstSchedldExecStrtTme    as pph_ssavz preserving type)                 as OpLtstSchedldExecStrtTme,
      @Semantics.calendarItem.dtStart: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpLtstSchedldExecStrtDteTme,
      @Semantics.calendarItem.dtStart: true
      cast(afvg.OpLtstSchedldProcgStrtDte   as pph_sssbd preserving type)                 as OpLtstSchedldProcgStrtDte,
      cast(afvg.OpLtstSchedldProcgStrtTme   as pph_sssbz preserving type)                 as OpLtstSchedldProcgStrtTme,
      @Semantics.calendarItem.dtStart: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpLtstSchedldProcgStrtDteTme,
      @Semantics.calendarItem.dtStart: true
      cast(afvg.OpLtstSchedldTrdwnStrtDte   as pph_sssad preserving type)                 as OpLtstSchedldTrdwnStrtDte,
      cast(afvg.OpLtstSchedldTrdwnStrtTme   as pph_sssaz preserving type)                 as OpLtstSchedldTrdwnStrtTme,
      @Semantics.calendarItem.dtStart: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpLtstSchedldTrdwnStrtDteTme,
      @Semantics.calendarItem.dtEnd: true
      cast(afvg.OpLtstSchedldExecEndDte     as pph_ssedd preserving type)                 as OpLtstSchedldExecEndDte,
      cast(afvg.OpLtstSchedldExecEndTme     as pph_ssedz preserving type)                 as OpLtstSchedldExecEndTme,
      @Semantics.calendarItem.dtEnd: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpLtstSchedldExecEndDteTme,
      @Semantics.calendarItem.dtStart: true
      cast(afvg.OperationConfirmedStartDate as pph_isavd preserving type)                 as OperationConfirmedStartDate,
      cast(afvg.OperationConfirmedEndDate   as pph_ieavd preserving type)                 as OperationConfirmedEndDate,
      @Semantics.calendarItem.dtStart: true
      afvg.OpActualExecutionStartDate,
      afvg.OpActualExecutionStartTime,
      @Semantics.calendarItem.dtStart: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpActualExecutionStartDateTime,
      @Semantics.calendarItem.dtEnd: true
      afvg.OpActualSetupEndDate,
      afvg.OpActualSetupEndTime,
      @Semantics.calendarItem.dtEnd: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpActualSetupEndDateTime,
      @Semantics.calendarItem.dtStart: true
      afvg.OpActualProcessingStartDate,
      afvg.OpActualProcessingStartTime,
      @Semantics.calendarItem.dtStart: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpActualProcessingStartDteTme,
      @Semantics.calendarItem.dtEnd: true
      afvg.OpActualProcessingEndDate,
      afvg.OpActualProcessingEndTime,
      @Semantics.calendarItem.dtEnd: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpActualProcessingEndDateTime,
      @Semantics.calendarItem.dtStart: true
      afvg.OpActualTeardownStartDate,
      afvg.OpActualTeardownStartTme,
      @Semantics.calendarItem.dtStart: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpActualTeardownStartDateTime,
      @Semantics.calendarItem.dtEnd: true
      afvg.OpActualExecutionEndDate,
      afvg.OpActualExecutionEndTime,
      @Semantics.calendarItem.dtEnd: true
      @Semantics.timeZoneReference: 'PlantTimeZone'
      afvg.OpActualExecutionEndDateTime,

      // Calculated Durations

      @Semantics.calendarItem.duration: true
      afvg.PlannedCurrentStrtDateDvtnDurn,
      @Semantics.calendarItem.duration: true
      afvg.PlannedCurrentEndDateDvtnDurn,
      @Semantics.calendarItem.duration: true
      afvg.PlannedActualStartDateDvtnDurn,
      @Semantics.calendarItem.duration: true
      afvg.PlannedActualEndDateDvtnDurn,

      // 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,

      case
        when isCreated.StatusCode   is null then ''
        when isCreated.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsCreated,
      case
        when isReleased.StatusCode   is null then ''
        when isReleased.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsReleased,
      case
        when isPrinted.StatusCode   is null then ''
        when isPrinted.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsPrinted,
      case
        when isConfirmed.StatusCode   is null then ''
        when isConfirmed.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsConfirmed,
      case
        when isPartConf.StatusCode   is null then ''
        when isPartConf.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsPartiallyConfirmed,
      case
        when isDeleted.StatusCode   is null then ''
        when isDeleted.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsDeleted,
      case
        when isTechCompl.StatusCode   is null then ''
        when isTechCompl.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsTechlyCompleted,
      case
        when isClosed.StatusCode   is null then ''
        when isClosed.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsClosed,
      case
        when isScheduled.StatusCode   is null then ''
        when isScheduled.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsScheduled,
      case
        when isPartDeliv.StatusCode   is null then ''
        when isPartDeliv.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsPartiallyDelivered,
      case
        when isDelivered.StatusCode   is null then ''
        when isDelivered.StatusCode   is not null then 'X'
      end                                                                                 as OperationIsDelivered,
      // Start and End is Late by Deviation in Seconds

      cast( case
        when isPartConf.StatusCode is not null then
          case
            when afvg.PlannedActualStartDateDvtnDurn > 0
            then 'X'
            else ''
          end
        else
          case
            when (isReleased.StatusCode is not null and isConfirmed.StatusCode is null) then
              case
                when afvg.PlannedCurrentStrtDateDvtnDurn > 0
                then 'X'
                else''
              end
            else ''
          end
      end as executionstartislate preserving type)                                        as OperationExecutionStartIsLate,
      cast( case
        when isConfirmed.StatusCode is not null then
          case
            when afvg.PlannedActualEndDateDvtnDurn > 0
            then 'X'
            else ''
          end
        else
          case
            when (isPartConf.StatusCode is not null and isConfirmed.StatusCode is null) then
              case
                when afvg.PlannedCurrentEndDateDvtnDurn > 0
                then 'X'
                else''
              end
            else ''
          end
      end as executionendislate preserving type)                                          as OperationExecutionEndIsLate,

      // Offset

      afvg.StartDateOffsetReferenceCode,
      afvg.StartDateOffsetDurationUnit,
      afvg.StartDateOffsetDuration,
      afvg.EndDateOffsetReferenceCode,
      afvg.EndDateOffsetDurationUnit,
      afvg.EndDateOffsetDuration,

      // Quantities and UoM

      @Semantics.unitOfMeasure: true
      cast(afvg.OperationUnit as operationunit preserving type)                           as OperationUnit,
      afvg.OperationScrapPercent,
      @Semantics.quantity.unitOfMeasure: 'OperationUnit'
      @DefaultAggregation: #MAX
      afvg.OperationReferenceQuantity,
      @Semantics.quantity.unitOfMeasure: 'OperationUnit'
      @DefaultAggregation: #SUM
      afvg.OpPlannedTotalQuantity,
      @Semantics.quantity.unitOfMeasure: 'OperationUnit'
      @DefaultAggregation: #SUM
      afvg.OpPlannedScrapQuantity,
      @Semantics.quantity.unitOfMeasure: 'OperationUnit'
      @DefaultAggregation: #SUM
      (afvg.OpPlannedTotalQuantity - afvg.OpPlannedScrapQuantity)                         as OpPlannedYieldQuantity,
      @Semantics.quantity.unitOfMeasure: 'OperationUnit'
      @DefaultAggregation: #SUM
      afvg.OpTotalConfirmedYieldQty,
      @Semantics.quantity.unitOfMeasure: 'OperationUnit'
      @DefaultAggregation: #SUM
      afvg.OpTotalConfirmedScrapQty,
      @Semantics.quantity.unitOfMeasure: 'OperationUnit'
      @DefaultAggregation: #SUM
      afvg.OperationConfirmedReworkQty,
      @Semantics.quantity.unitOfMeasure: 'OperationUnit'
      @DefaultAggregation: #MAX
      castcase
        when isConfirmed.StatusCode is null then 0
        else afvg.OpTotalConfirmedYieldQty - afvg.OpPlannedYieldQuantity
      end as opyielddeviationqty )                                                        as OperationYieldDeviationQty,

      // OAN data

      afvg.SetupOpActyNtwkInstance,
      afvg.ProduceOpActyNtwkInstance,
      afvg.TeardownOpActyNtwkInstance,

      // Associations

      _OrdInternalBillOfOperations,
      @VDM.lifecycle.status: #DEPRECATED
      @VDM.lifecycle.successor: '_MfgOrder_2'
      _MfgOrder,
      _MfgOrder_2,
      _MfgOrderSequence,
      _MfgOrderCategory,
      _MfgOrderType,
      _OperationStandardTextCode,
      _ProductionPlant,
      _ProductionSupervisor,
      _OperationUnit,
      _WorkCenter,
      _WorkCenterType,
      _OperationControlProfile,
      _BillOfOperationsType,
      _BillOfOperationsGroup,
      _BillOfOperationsVariant,
      _BillOfOperationsSequence,
      _BOOOperationInternalID,
      _MRPController,
      _ResponsiblePlannerGroup,
      _OperationConfirmation,
      _FactoryCalendar,
      _CapacityRequirement,
      _CapacityRequirementItem,
      _ChangeNumber,
      _EmployeeWageGroup,
      _EmployeeSuitability,
      _Employee,
      _CompanyCode,
      _ProfitCenter,
      _ControllingArea,
      _ControllingObjectClass,
      _FunctionalArea,
      _BusinessArea,
      _StartDateOffsetReferenceCode,
      _EndDateOffsetReferenceCode,
      _Language
}
where
      afvg.OperationIsToBeDeleted = '' //Non-deleted operations only

  and afvg.MfgOrderIsToBeDeleted  = '' //from non-deleted orders only

;