@AbapCatalog.sqlViewName: 'IPPMFGORDERBASIC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AccessControl.privilegedAssociations: ['_MRPController', '_ProductionSupervisor', '_CreatedByUser', '_LastChangedByUser']
@Analytics.dataCategory: #DIMENSION
@ClientHandling.algorithm: #SESSION_VARIABLE
@ClientHandling.type: #CLIENT_DEPENDENT
@Metadata.allowExtensions: true
@ObjectModel.modelingPattern: #NONE
@ObjectModel.supportedCapabilities: [#ANALYTICAL_DIMENSION, #CDS_MODELING_ASSOCIATION_TARGET, #CDS_MODELING_DATA_SOURCE, #SQL_DATA_SOURCE]
@ObjectModel.representativeKey: 'ManufacturingOrder'
@ObjectModel.semanticKey: ['ManufacturingOrder']
@ObjectModel.usageType: {serviceQuality: #B, sizeCategory: #L, dataClass: #TRANSACTIONAL}
@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API
@VDM.viewType: #BASIC
@EndUserText.label: 'Manufacturing Order Basic'
// Basic view on Manufacturing Orders without Order Item (AFPO) join - for better performance or
// foreign key relations or joins in composite views (to filter on Manufacturing Orders)
/*+[hideWarning] { "IDS" : [ "CALCULATED_FIELD_CHECK" ] } */
define view I_MfgOrderBasic
as select from I_LogisticsOrder as aufv
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 [1..1] to I_OrderInternalID as _OrderInternalID on $projection.OrderInternalID = _OrderInternalID.OrderInternalID
association [1..1] to I_UnitOfMeasure as _ProductionUnit on $projection.ProductionUnit = _ProductionUnit.UnitOfMeasure
association [1..1] to I_Plant as _ProductionPlant on $projection.ProductionPlant = _ProductionPlant.Plant
association [1..1] to I_User as _CreatedByUser on $projection.CreatedByUser = _CreatedByUser.UserID
association [0..1] to I_User as _LastChangedByUser on $projection.LastChangedByUser = _LastChangedByUser.UserID
association [0..1] to I_GLAccount as _GLAccount on $projection.GLAccount = _GLAccount.GLAccount
and $projection.CompanyCode = _GLAccount.CompanyCode
{
// Key
@ObjectModel.text.element: ['ManufacturingOrderText']
key aufv.OrderID as ManufacturingOrder,
// Internal Key
@ObjectModel.foreignKey.association: '_OrderInternalID'
aufv.OrderInternalBillOfOperations as OrderInternalID,
@ObjectModel.foreignKey.association: '_Reservation'
aufv.Reservation,
// Category and Type
@ObjectModel.foreignKey.association: '_MfgOrderCategory'
aufv.OrderCategory as ManufacturingOrderCategory,
@ObjectModel.foreignKey.association: '_MfgOrderType'
aufv.OrderType as ManufacturingOrderType,
// Attributes
aufv.IsMarkedForDeletion as MfgOrderIsToBeDeleted,
aufv.MfgOrderHasMultipleItems,
aufv.MfgOrderIsPartOfCollvOrder,
//Extended Quality Check
aufv.ExtdQualityCheckIsRequired as ExtdQualityCheckIsRequired,
// Text
@Semantics.text: true
aufv.OrderDescription as ManufacturingOrderText,
@ObjectModel.foreignKey.association: '_LongTextLanguage'
aufv.LongTextLanguage,
// Admin data
@Semantics.systemDate.createdAt: true
cast(aufv.CreationDate as ordercreationdate preserving type) as CreationDate,
@Semantics.systemTime.createdAt: true
cast(aufv.CreationTime as ordercreationtime preserving type) as CreationTime,
@Semantics.user.createdBy: true
aufv.CreatedByUser,
@Semantics.systemDate.lastChangedAt: true
aufv.LastChangeDate,
@Semantics.systemTime.lastChangedAt: true
aufv.LastChangeTime,
@Semantics.user.lastChangedBy: true
aufv.LastChangedByUser,
// Assignments
@ObjectModel.foreignKey.association: '_ProductionPlant'
cast(aufv.Plant as pwwrk preserving type) as ProductionPlant,
@ObjectModel.foreignKey.association: '_ProductionSupervisor'
cast(aufv.ProductionSupervisor as pph_fevor preserving type) as ProductionSupervisor,
@ObjectModel.foreignKey.association: '_MRPController'
cast(aufv.MRPController as pph_dispo preserving type) as MRPController,
@ObjectModel.foreignKey.association: '_ResponsiblePlannerGroup'
aufv.ResponsiblePlannerGroup,
@ObjectModel.foreignKey.association: '_ProductionSchedulingProfile'
cast(aufv.ProductionSchedulingProfile as pph_prodprf preserving type) as ProductionSchedulingProfile,
cast(aufv.PriorityCode as orderimportancecode preserving type) as ManufacturingOrderImportance,
aufv.ProdnProcgIsFlexible,
aufv.ObjectInternalID,
@ObjectModel.foreignKey.association: '_InspectionLot'
aufv.InspectionLot,
aufv.ProductConfiguration,
@ObjectModel.foreignKey.association: '_CapacityRequirement'
aufv.CapacityRequirement,
@ObjectModel.foreignKey.association: '_ChangeNumber'
aufv.ChangeNumber,
aufv.MaterialRevisionLevel_2 as MaterialRevisionLevel,
// Assignments FI/CO
@ObjectModel.foreignKey.association: '_BusinessArea'
aufv.BusinessArea,
@ObjectModel.foreignKey.association: '_CompanyCode'
aufv.CompanyCode,
@ObjectModel.foreignKey.association: '_ControllingArea'
aufv.ControllingArea,
aufv.CostCenter,
aufv.ProfitCenter,
@ObjectModel.foreignKey.association: '_GLAccount'
aufv.GLAccount,
@ObjectModel.foreignKey.association: '_ProductCostCollector'
aufv.ProductCostCollector,
// Assignments BOO
aufv.Material as BillOfOperationsMaterial,
@ObjectModel.foreignKey.association: '_BillOfOperationsType'
aufv.BillOfOperationsType,
@VDM.lifecycle.status: #DEPRECATED // default data element change -> deprecated to avoid RTT2 error in ATC
@VDM.lifecycle.successor: 'BillOfOperationsGroup'
aufv.BillOfOperations,
aufv.BillOfOperationsGroup,
aufv.BillOfOperationsVariant,
aufv.BillOfOperationsUsage,
aufv.BillOfOperationsVersion,
// Floats
@ObjectModel.foreignKey.association: '_SchedulingFloatProfile'
aufv.SchedulingFloatProfile,
aufv.FloatBeforeProductionInWrkDays,
aufv.FloatAfterProductionInWorkDays,
aufv.ReleasePeriodInWorkDays,
// Dates and Times
cast(aufv.PlannedStartDate as mfgorderplannedstartdate preserving type) as MfgOrderPlannedStartDate,
cast(aufv.PlannedStartTime as mfgorderplannedstarttime preserving type) as MfgOrderPlannedStartTime,
cast(aufv.PlannedEndDate as mfgorderplannedenddate preserving type) as MfgOrderPlannedEndDate,
cast(aufv.PlannedEndTime as mfgorderplannedendtime preserving type) as MfgOrderPlannedEndTime,
cast(aufv.PlannedReleaseDate as mfgorderplannedreleasedate preserving type) as MfgOrderPlannedReleaseDate,
cast(aufv.ScheduledBasicStartDate as mfgorderscheduledstartdate preserving type) as MfgOrderScheduledStartDate,
cast(aufv.ScheduledBasicStartTime as mfgorderscheduledstarttime preserving type) as MfgOrderScheduledStartTime,
cast(aufv.ScheduledBasicEndDate as mfgorderscheduledenddate preserving type) as MfgOrderScheduledEndDate,
cast(aufv.ScheduledBasicEndTime as mfgorderscheduledendtime preserving type) as MfgOrderScheduledEndTime,
cast(aufv.ScheduledReleaseDate as mfgorderscheduledreleasedate preserving type) as MfgOrderScheduledReleaseDate,
cast(aufv.ActualStartDate as mfgorderactualstartdate preserving type) as MfgOrderActualStartDate,
cast(aufv.ActualStartTime as mfgorderactualstarttime preserving type) as MfgOrderActualStartTime,
cast(aufv.ActualEndDate as mfgorderactualenddate preserving type) as MfgOrderActualEndDate,
cast(aufv.ActualReleasedDate as mfgorderactualreleasedate preserving type) as MfgOrderActualReleaseDate,
cast(aufv.ConfirmedEndDate as mfgorderconfirmedenddate preserving type) as MfgOrderConfirmedEndDate,
cast(aufv.ConfirmedEndTime as mfgorderconfirmedendtime preserving type) as MfgOrderConfirmedEndTime,
aufv.TechnicalCompletionDate as MfgOrderActualCompletionDate,
// Quantities and UoM
@Semantics.unitOfMeasure: true
cast(aufv.BaseUnit as productionunit preserving type) as ProductionUnit,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
@Aggregation.default: #SUM
cast(aufv.OrderPlannedTotalQty as mfgorderplannedtotalqty preserving type) as MfgOrderPlannedTotalQty,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
@Aggregation.default: #SUM
cast(aufv.OrderPlannedScrapQty as mfgorderplannedscrapqty preserving type) as MfgOrderPlannedScrapQty,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
@Aggregation.default: #SUM
cast(aufv.OrderConfirmedYieldQty as co_igmng preserving type) as MfgOrderConfirmedYieldQty,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
@Aggregation.default: #SUM
cast(aufv.OrderConfirmedScrapQty as co_iasmg preserving type) as MfgOrderConfirmedScrapQty,
@Semantics.quantity.unitOfMeasure: 'ProductionUnit'
@Aggregation.default: #SUM
aufv.MfgOrderConfirmedReworkQty,
// Fashion Manufacturing Fields
aufv.MasterProductionOrder,
// Associations
_MfgOrderCategory,
_MfgOrderType,
_OrderInternalID,
_LongTextLanguage,
_Reservation,
_ProductionUnit,
_ProductionPlant,
_ProductionSupervisor,
_MRPController,
_ResponsiblePlannerGroup,
_ProductionSchedulingProfile,
_InspectionLot,
_CapacityRequirement,
_ChangeNumber,
_BusinessArea,
_CompanyCode,
_ControllingArea,
_GLAccount,
_ProductCostCollector,
_BillOfOperationsType,
_SchedulingFloatProfile,
_CreatedByUser,
_LastChangedByUser
}
where
aufv.OrderCategory = '10'
or aufv.OrderCategory = '40'; //Manufacturing orders only
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_LOGISTICSORDER"
],
"ASSOCIATED":
[
"I_BILLOFOPERATIONSTYPE",
"I_BUSINESSAREA",
"I_CAPACITYREQUIREMENT",
"I_CHANGEMASTER",
"I_COMPANYCODE",
"I_CONTROLLINGAREA",
"I_GLACCOUNT",
"I_INSPECTIONLOT",
"I_LANGUAGE",
"I_MFGORDERCATEGORY",
"I_MFGORDERTYPE",
"I_MRPCONTROLLER",
"I_ORDERINTERNALID",
"I_PLANT",
"I_PRODUCTCOSTCTRLGORDER",
"I_PRODUCTIONSCHEDULINGPROFILE",
"I_PRODUCTIONSUPERVISOR",
"I_RESERVATIONDOCUMENTHEADER",
"I_RESPONSIBLEPLANNERGROUP",
"I_SCHEDULINGFLOATPROFILE",
"I_UNITOFMEASURE",
"I_USER"
],
"BASE":
[
"I_LOGISTICSORDER"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/