@AbapCatalog.sqlViewName: 'IORDERCOMP'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@AccessControl.privilegedAssociations: ['_LongText']
@Analytics.dataCategory: #FACT
@ClientHandling.algorithm: #SESSION_VARIABLE
@ClientHandling.type: #CLIENT_DEPENDENT
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.modelingPattern: #NONE
@ObjectModel.supportedCapabilities: [#CDS_MODELING_ASSOCIATION_TARGET, #CDS_MODELING_DATA_SOURCE, #SQL_DATA_SOURCE]
@ObjectModel.usageType: {serviceQuality: #B, sizeCategory: #XL, dataClass: #TRANSACTIONAL}
@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API
@VDM.viewType: #BASIC
@EndUserText.label: 'Order Component'
// Basic view for components assigend to any order category
// Due to the high number of consumers, this CDS view is protected against incompatible changes
/*+[hideWarning] { "IDS" : [ "CALCULATED_FIELD_CHECK" ] } */
define view I_OrderComponent
--as select from I_ReservationItem as resb //currently many fields missing
as select from resb as resb
inner join I_OrderBasic as aufk on resb.aufnr = aufk.OrderID
left outer to one join tcs03 as tcs03 on tcs03.agb29 = '29'
association [1..1] to I_ReservationDocumentHeader as _Reservation on $projection.Reservation = _Reservation.Reservation
association [1..1] to I_ReservationDocumentItem as _ReservationItem on $projection.Reservation = _ReservationItem.Reservation
and $projection.ReservationItem = _ReservationItem.ReservationItem
and $projection.RecordType = _ReservationItem.RecordType
association [0..1] to I_ReservationDocRecordType as _ReservationDocRecordType on $projection.RecordType = _ReservationDocRecordType.RecordType
association [0..1] to I_ManufacturingOrder as _ManufacturingOrder on $projection.OrderID = _ManufacturingOrder.ManufacturingOrder
association [1..1] to I_LogisticsOrder as _Order on $projection.OrderID = _Order.OrderID
association [0..1] to I_OrderItem as _OrderItem on $projection.OrderID = _OrderItem.OrderID
and $projection.OrderItem = _OrderItem.OrderItem
association [0..1] to I_OrderSequenceBySemKey as _OrderSequence on $projection.OrderID = _OrderSequence.OrderID
and $projection.Sequence = _OrderSequence.Sequence
association [1..1] to I_OrderOperationBySemKey as _OrderOperationBySemKey on $projection.OrderID = _OrderOperationBySemKey.OrderID
and $projection.Sequence = _OrderOperationBySemKey.Sequence
and $projection.OrderOperation = _OrderOperationBySemKey.OrderOperation
association [1..1] to I_OrderOperation as _OrderOperation on $projection.OrderInternalID = _OrderOperation.OrderInternalID
and $projection.OrderOperationInternalID = _OrderOperation.OrderOperationInternalID
association [1..1] to I_OrderCategory as _OrderCategory on $projection.OrderCategory = _OrderCategory.OrderCategory
association [1..1] to I_OrderType as _OrderType on $projection.OrderType = _OrderType.OrderType
association [1..1] to I_OrderInternalID as _OrderInternalID on $projection.OrderInternalID = _OrderInternalID.OrderInternalID
association [0..1] to I_SequenceCategory as _SequenceCategory on $projection.SequenceCategory = _SequenceCategory.SequenceCategory
association [1..1] to I_Plant as _ProductionPlant on $projection.ProductionPlant = _ProductionPlant.Plant
association [1..1] to I_MaterialRequirementType as _RequirementType on $projection.RequirementType = _RequirementType.RequirementType
association [1..1] to I_MaterialGroup as _MaterialGroup on $projection.MaterialGroup = _MaterialGroup.MaterialGroup
association [1..1] to I_Material as _Material on $projection.Material = _Material.Material
association [1..1] to I_MaterialPlant as _MaterialPlant on $projection.Material = _MaterialPlant.Material
and $projection.Plant = _MaterialPlant.Plant
association [1..1] to I_Product as _Product on $projection.Material = _Product.Product
association [1..1] to I_Plant as _Plant on $projection.Plant = _Plant.Plant
association [1..1] to I_ProductPlantBasic as _ProductPlant on $projection.Material = _ProductPlant.Product
and $projection.Plant = _ProductPlant.Plant
association [0..1] to I_ProductStorageLocationBasic as _ProductStorageLocation on $projection.Material = _ProductStorageLocation.Product
and $projection.Plant = _ProductStorageLocation.Plant
and $projection.StorageLocation = _ProductStorageLocation.StorageLocation
association [0..1] to I_SalesOrder as _SalesOrder on $projection.SalesOrder = _SalesOrder.SalesOrder
association [0..1] to I_SalesOrderItem as _SalesOrderItem on $projection.SalesOrder = _SalesOrderItem.SalesOrder
and $projection.SalesOrderItem = _SalesOrderItem.SalesOrderItem
association [0..1] to I_WBSElementByInternalKey as _WBSElement on $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
association [0..1] to I_WBSElementBasicData as _WBSElementBasicData on $projection.WBSElementInternalID = _WBSElementBasicData.WBSElementInternalID
association [0..1] to I_ChangeMaster as _ChangeNumber on $projection.ChangeNumber = _ChangeNumber.ChangeNumber
association [0..1] to I_ChangeMstrObjTypeRevisionLvl as _MaterialRevisionLevel on $projection.MaterialRevisionLevel = _MaterialRevisionLevel.RevisionLevel
and _MaterialRevisionLevel.ChangeNumberObjectType = '41'
association [0..1] to I_BOMExplosionDate as _BOMExplosion on $projection.BOMExplosionDateID = _BOMExplosion.BOMExplosionDateID
association [0..1] to I_BillOfMaterialItemBasic as _BillOfMaterialItem on $projection.BillOfMaterialCategory = _BillOfMaterialItem.BillOfMaterialCategory
and $projection.BillOfMaterialInternalID = _BillOfMaterialItem.BillOfMaterial
and $projection.BOMItem = _BillOfMaterialItem.BillOfMaterialItemNodeNumber
and $projection.BOMItemInternalChangeCount = _BillOfMaterialItem.BOMItemInternalChangeCount
association [0..1] to I_BillOfMaterialItemCategory as _BOMItemCategory on $projection.BOMItemCategory = _BOMItemCategory.BillOfMaterialItemCategory
association [0..1] to I_PurchasingInfoRecordApi01 as _PurchasingInfoRecord on $projection.PurchasingInfoRecord = _PurchasingInfoRecord.PurchasingInfoRecord
association [0..1] to I_PurchasingGroup as _PurchasingGroup on $projection.PurchasingGroup = _PurchasingGroup.PurchasingGroup
association [0..1] to I_PurchaseOrderAPI01 as _PurchaseOrder on $projection.PurchaseOrder = _PurchaseOrder.PurchaseOrder
association [0..1] to I_PurchaseOrderItemAPI01 as _PurchaseOrderItem on $projection.PurchaseOrder = _PurchaseOrderItem.PurchaseOrder
and $projection.PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem
association [0..1] to I_Purchaserequisition as _PurchaseRequisition on $projection.PurchaseRequisition = _PurchaseRequisition.PurchaseRequisition
association [0..1] to I_PurchaseRequisitionItemAPI01 as _PurchaseRequisitionItem on $projection.PurchaseRequisition = _PurchaseRequisitionItem.PurchaseRequisition
and $projection.PurchaseRequisitionItem = _PurchaseRequisitionItem.PurchaseRequisitionItem
association [0..1] to I_Supplier as _Supplier on $projection.Supplier = _Supplier.Supplier
association [0..1] to I_StorageLocation as _StorageLocation on $projection.Plant = _StorageLocation.Plant
and $projection.StorageLocation = _StorageLocation.StorageLocation
association [0..1] to I_Batch as _Batch on $projection.Plant = _Batch.Plant
and $projection.Material = _Batch.Material
and $projection.Batch = _Batch.Batch
association [0..1] to I_BatchSplitType as _BatchSplitType on $projection.BatchSplitType = _BatchSplitType.BatchSplitType
association [1..1] to I_DebitCreditCode as _DebitCreditCode on $projection.DebitCreditCode = _DebitCreditCode.DebitCreditCode
association [1..1] to I_GoodsMovementType as _GoodsMovementType on $projection.GoodsMovementType = _GoodsMovementType.GoodsMovementType
association [0..1] to I_InventorySpecialStockType as _InventorySpecialStockType on $projection.InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType
association [0..1] to I_InvtrySpecialStockValnType as _InventorySpecialStockValnType on $projection.InventorySpecialStockValnType = _InventorySpecialStockValnType.InventorySpecialStockValnType
association [0..1] to I_ConsumptionPosting as _ConsumptionPosting on $projection.ConsumptionPosting = _ConsumptionPosting.ConsumptionPosting
association [0..1] to I_ProductionSupplyArea as _SupplyArea on $projection.Plant = _SupplyArea.Plant
and $projection.SupplyArea = _SupplyArea.ProductionSupplyArea
association [0..1] to I_Warehouse as _Warehouse on $projection.Warehouse = _Warehouse.Warehouse
association [0..1] to I_Product as _PhantomAssembly on $projection.Assembly = _PhantomAssembly.Product
association [0..1] to I_Product as _FollowUpMaterial on $projection.FollowUpMaterial = _FollowUpMaterial.Product
association [0..1] to I_MatlCompDiscontinuationType as _DiscontinuationType on $projection.MatlCompDiscontinuationType = _DiscontinuationType.MatlCompDiscontinuationType
association [0..1] to I_MatlCompProvisionType as _ProvisionType on $projection.MaterialProvisionType = _ProvisionType.MaterialProvisionType
association [0..1] to I_MatlCompSparePartType as _SparePartType on $projection.MatlComponentSparePartType = _SparePartType.MatlComponentSparePartType
association [0..1] to I_CompanyCode as _CompanyCode on $projection.CompanyCode = _CompanyCode.CompanyCode
association [0..1] to I_BusinessArea as _BusinessArea on $projection.BusinessArea = _BusinessArea.BusinessArea
association [0..1] to I_GLAccount as _GLAccount on $projection.GLAccount = _GLAccount.GLAccount
and $projection.CompanyCode = _GLAccount.CompanyCode
association [0..1] to I_ControllingArea as _ControllingArea on $projection.ControllingArea = _ControllingArea.ControllingArea
association [0..1] to I_FunctionalArea as _FunctionalArea on $projection.FunctionalArea = _FunctionalArea.FunctionalArea
association [0..1] to I_AccountAssignmentCategory as _AccountAssignmentCategory on $projection.AccountAssignmentCategory = _AccountAssignmentCategory.AccountAssignmentCategory
association [0..1] to I_EarmarkedFundsDocument as _EarmarkedFunds on $projection.EarmarkedFundsDocument = _EarmarkedFunds.EarmarkedFundsDocument
association [0..1] to I_EarmarkedFundsDocumentItem as _EarmarkedFundsItem on $projection.EarmarkedFundsDocument = _EarmarkedFundsItem.EarmarkedFundsDocument
and $projection.EarmarkedFundsDocumentItem = _EarmarkedFundsItem.EarmarkedFundsDocumentItem
association [0..*] to I_Fund as _Fund on $projection.Fund = _Fund.Fund
association [0..*] to I_FundsCenter as _FundsCenter on $projection.FundsCenter = _FundsCenter.FundsCenter
association [0..*] to I_CommitmentItem as _CommitmentItem on $projection.CommitmentItem = _CommitmentItem.CommitmentItem
association [0..1] to I_CommitmentItemShortID as _CommitmentItemShortID on $projection.CommitmentItemShortID = _CommitmentItemShortID.CommitmentItemShortID
association [0..1] to I_UnitOfMeasure as _OpLeadTimeOffsetUnit on $projection.OperationLeadTimeOffsetUnit = _OpLeadTimeOffsetUnit.UnitOfMeasure
association [0..1] to I_UnitOfMeasure as _VariableSizeItemUnit on $projection.VariableSizeItemUnit = _VariableSizeItemUnit.UnitOfMeasure
association [0..1] to I_UnitOfMeasure as _VariableSizeComponentUnit on $projection.VariableSizeComponentUnit = _VariableSizeComponentUnit.UnitOfMeasure
association [1..1] to I_UnitOfMeasure as _BaseUnit on $projection.BaseUnit = _BaseUnit.UnitOfMeasure
association [1..1] to I_UnitOfMeasure as _EntryUnit on $projection.EntryUnit = _EntryUnit.UnitOfMeasure
association [0..1] to I_Currency as _Currency on $projection.Currency = _Currency.Currency
association [0..1] to I_Language as _LongTextLanguage on $projection.LongTextLanguage = _LongTextLanguage.Language
association [0..1] to I_OrderComponentLongText as _LongText on $projection.Reservation = _LongText.Reservation
and $projection.ReservationItem = _LongText.ReservationItem
and $projection.RecordType = _LongText.RecordType
{
// Key
@ObjectModel.foreignKey.association: '_Reservation'
key resb.rsnum as Reservation,
@ObjectModel.text.element: ['MaterialComponentText', 'ReservationItemText']
key cast(resb.rspos as pph_rspos preserving type) as ReservationItem,
@ObjectModel.foreignKey.association: '_ReservationDocRecordType'
key cast(resb.rsart as pph_rsart preserving type) as RecordType,
//Material data
@ObjectModel.foreignKey.association: '_MaterialGroup'
resb.matkl as MaterialGroup,
@ObjectModel.foreignKey.association: '_Material'
resb.matnr as Material,
@ObjectModel.foreignKey.association: '_Plant'
resb.werks as Plant,
// Order and Operation data
@ObjectModel.foreignKey.association: '_OrderCategory'
aufk.OrderCategory,
@ObjectModel.foreignKey.association: '_OrderType'
aufk.OrderType,
@ObjectModel.foreignKey.association: '_Order'
resb.aufnr as OrderID,
@ObjectModel.foreignKey.association: '_OrderItem'
resb.afpos as OrderItem,
@ObjectModel.foreignKey.association: '_OrderSequence'
case aufk.OrderCategory
when '10' then case resb.plnfl
when '' then '000000'
else resb.plnfl
end
else resb.plnfl
end as Sequence,
@ObjectModel.foreignKey.association: '_SequenceCategory'
cast(resb.flgat as folgenart preserving type) as SequenceCategory,
@ObjectModel.foreignKey.association: '_OrderOperationBySemKey'
cast(resb.vornr as vdm_vornr preserving type) as OrderOperation,
cast(resb.uvorn as vdm_uvorn preserving type) as OrderSuboperation, // EAM only
@ObjectModel.foreignKey.association: '_OrderInternalID'
cast(resb.aufpl as pph_aufpl preserving type) as OrderInternalID,
@ObjectModel.foreignKey.association: '_OrderOperation'
cast(resb.aplzl as operationinternalid preserving type) as OrderOperationInternalID,
@ObjectModel.foreignKey.association: '_ProductionPlant'
cast(aufk.Plant as pwwrk preserving type) as ProductionPlant,
// Date and Time
@Semantics.businessDate.at: true
cast(resb.bdter as pph_bdter preserving type) as MatlCompRequirementDate,
cast(resb.bdztp as pph_bdztp preserving type) as MatlCompRequirementTime,
cast(resb.sbter as pph_sbter preserving type) as LatestRequirementDate,
// Attributes
cast(resb.rssta as pph_rssta preserving type) as ReservationItemCreationCode,
resb.kzear as ReservationIsFinallyIssued,
cast(resb.xloek as sa_loekz preserving type) as MatlCompIsMarkedForDeletion,
resb.xfehl as MaterialComponentIsMissing,
resb.schgt as IsBulkMaterialComponent,
resb.rgekz as MatlCompIsMarkedForBackflush,
resb.kzkup as MaterialIsCoProduct,
resb.txtps as MatlCompIsTextItem,
cast(resb.no_disp as vdm_no_disp preserving type) as MaterialPlanningRelevance,
resb.kfpos as MatlCompIsConfigurable,
resb.clakz as MaterialComponentIsClassified,
resb.inpos as MaterialCompIsIntraMaterial,
cast(case
when resb.dbskz = 'E' then 'X'
when resb.dbskz <> 'E' then ''
end as clcor preserving type ) as MaterialIsDirectlyProduced,
cast(case
when resb.dbskz = 'F' then 'X'
when resb.dbskz <> 'F' then ''
end as dirpr preserving type ) as MaterialIsDirectlyProcured,
// Text
@Semantics.text: true
cast(resb.sgtxt as pph_sgtxt preserving type) as ReservationItemText,
@Semantics.text: true
resb.potx1 as MaterialComponentText,
@Semantics.text: true
resb.potx2 as MaterialComponentSecondText,
cast(case
when resb.ltxsp <> '' then 'X'
else resb.ltxsp
end as aufltext preserving type) as MaterialComponentHasLongText,
@ObjectModel.foreignKey.association: '_LongTextLanguage'
cast(resb.ltxsp as pph_longtextlang preserving type) as LongTextLanguage,
// Assignments
@ObjectModel.foreignKey.association: '_RequirementType'
cast(resb.bdart as pph_bdart preserving type) as RequirementType,
@ObjectModel.foreignKey.association: '_SalesOrder'
cast(resb.kdauf as co_kdauf preserving type) as SalesOrder,
@ObjectModel.foreignKey.association: '_SalesOrderItem'
cast(resb.kdpos as co_kdpos preserving type) as SalesOrderItem,
@ObjectModel.foreignKey.association: '_WBSElement'
cast(resb.pspel as ps_s4_pspnr preserving type) as WBSElementInternalID,
resb.cuobj as ProductConfiguration,
@ObjectModel.foreignKey.association: '_ChangeNumber'
resb.aennr as ChangeNumber,
cast(resb.revlv as vdm_qm_revlv preserving type) as MaterialRevisionLevel,
resb.techs as EffectivityParameterVariant,
@VDM.lifecycle.status: #DEPRECATED
@VDM.lifecycle.successor: 'MaterialComponentSortText'
resb.sortf as MatlCompFreeDefinedAttribute,
resb.sortf as MaterialComponentSortText,
resb.objnr as ObjectInternalID,
aufk.ObjectInternalID as OrderObjectInternalID,
// Assignments BOM
cast(resb.stlty as pph_stlty preserving type) as BillOfMaterialCategory,
cast(resb.stlnr as pph_stnum preserving type) as BillOfMaterialInternalID,
resb.stlal as BillOfMaterialVariant,
cast(resb.stlkn as pph_stlkn preserving type) as BOMItem,
resb.bom_versn as BillOfMaterialVersion,
resb.stpoz as BOMItemInternalChangeCount,
resb.stvkn as InheritedBOMItemNode,
cast(resb.postp as pph_postp preserving type) as BOMItemCategory,
cast(resb.posnr as vdm_sposn preserving type) as BillOfMaterialItemNumber,
@Semantics.text: true
resb.potx1 as BOMItemDescription,
@Semantics.text: true
resb.potx2 as BOMItemText2,
@ObjectModel.foreignKey.association: '_BOMExplosion'
cast(resb.sernr as pph_sernr preserving type) as BOMExplosionDateID,
// Assignments Purchasing
cast(resb.infnr as pph_infnr preserving type) as PurchasingInfoRecord,
@ObjectModel.foreignKey.association: '_PurchasingGroup'
cast(resb.ekgrp as pph_ekgrp preserving type) as PurchasingGroup,
-- @ObjectModel.foreignKey.association: '_PurchaseRequisition'
cast(resb.banfn as co_banfn preserving type) as PurchaseRequisition,
-- @ObjectModel.foreignKey.association: '_PurchaseRequisitionItem'
cast(resb.bnfpo as co_bnfpo preserving type) as PurchaseRequisitionItem,
-- @ObjectModel.foreignKey.association: '_PurchaseOrder'
cast(resb.ebeln as vdm_purchaseorder preserving type) as PurchaseOrder,
-- @ObjectModel.foreignKey.association: '_PurchaseOrderItem'
cast(resb.ebelp as vdm_purchaseorderitem preserving type) as PurchaseOrderItem,
-- @ObjectModel.foreignKey.association: '_PurchaseOrderScheduleLine'
cast(resb.ebele as fis_etenr preserving type) as PurchaseOrderScheduleLine,
@ObjectModel.foreignKey.association: '_Supplier'
resb.lifnr as Supplier,
cast(resb.lifzt as pph_lifzt preserving type) as DeliveryDurationInDays,
cast(resb.webaz as pph_webaz preserving type) as MaterialGoodsReceiptDuration,
-- Price
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'Currency'
cast(resb.gpreis as kblpreis preserving type) as ExternalProcessingPrice,
cast(resb.peinh as pph_peinh preserving type) as NumberOfPriceUnits,
// Goods Movement data
resb.xwaok as GoodsMovementIsAllowed,
@ObjectModel.foreignKey.association: '_StorageLocation'
cast(resb.lgort as pph_lgort preserving type) as StorageLocation,
@ObjectModel.foreignKey.association: '_DebitCreditCode'
cast(resb.shkzg as pph_shkzg preserving type) as DebitCreditCode,
@ObjectModel.foreignKey.association: '_GoodsMovementType'
resb.bwart as GoodsMovementType,
@ObjectModel.foreignKey.association: '_InventorySpecialStockType'
cast(resb.sobkz as inventoryspecialstocktype preserving type) as InventorySpecialStockType,
@ObjectModel.foreignKey.association: '_InventorySpecialStockValnType'
cast(resb.kzbws as pph_kzbws preserving type) as InventorySpecialStockValnType,
@ObjectModel.foreignKey.association: '_ConsumptionPosting'
cast(resb.kzvbr as pph_kzvbr preserving type) as ConsumptionPosting,
@ObjectModel.foreignKey.association: '_SupplyArea'
cast(resb.prvbe as pph_prvbe preserving type) as SupplyArea,
@Semantics.text: true
cast(resb.wempf as pph_wempf preserving type) as GoodsRecipientName,
@Semantics.text: true
resb.ablad as UnloadingPointName,
resb.sgt_scat as StockSegment,
resb.sgt_rcat as RequirementSegment,
// Batch data
@ObjectModel.foreignKey.association: '_Batch'
resb.charg as Batch,
-- @ObjectModel.foreignKey.association: '_BatchEntryDetermination'
cast(resb.kzech as vdm_pp_kzech preserving type) as BatchEntryDeterminationCode,
@ObjectModel.foreignKey.association: '_BatchSplitType'
resb.splkz as BatchSplitType,
cast(case resb.splkz
when '' then '0000'
else resb.splrv
end as vdm_splrv preserving type) as BatchMasterReservationItem,
resb.chobj as BatchClassification,
// Assignments WM
resb.berkz as MaterialStaging,
@ObjectModel.foreignKey.association: '_Warehouse'
resb.lgnum as Warehouse,
resb.lgtyp as StorageType,
resb.lgpla as StorageBin,
// Assignments FI/CO
resb.sanka as MaterialCompCostingRelevancy,
@ObjectModel.foreignKey.association: '_BusinessArea'
resb.gsber as BusinessArea,
@ObjectModel.foreignKey.association: '_CompanyCode'
aufk.CompanyCode as CompanyCode,
@ObjectModel.foreignKey.association: '_GLAccount'
resb.saknr as GLAccount,
@ObjectModel.foreignKey.association: '_FunctionalArea'
resb.fkber as FunctionalArea,
@ObjectModel.foreignKey.association: '_ControllingArea'
aufk.ControllingArea as ControllingArea,
@ObjectModel.foreignKey.association: '_AccountAssignmentCategory'
cast(resb.knttp as pph_knttp preserving type) as AccountAssignmentCategory,
@ObjectModel.foreignKey.association: '_EarmarkedFunds'
resb.kblnr as EarmarkedFundsDocument,
-- @ObjectModel.foreignKey.association: '_EarmarkedFundsItem'
resb.kblpos as EarmarkedFundsDocumentItem,
-- @ObjectModel.foreignKey.association: '_FundsCenter'
cast(resb.fistl as bbpfistl preserving type) as FundsCenter,
-- @ObjectModel.foreignKey.association: '_Fund'
resb.geber as Fund,
resb.fipex as CommitmentItem,
cast(resb.fipos as fmis_ci_internalname preserving type) as CommitmentItemShortID,
// Variable-size comp. data
resb.rohps as MaterialCompIsVariableSized,
-- Item quantity (ROANZ and ROAME)
@Semantics.unitOfMeasure: true
cast(case
when resb.rohps = 'X' then tcs03.roame
else resb.rohps
end as vdm_roame) as VariableSizeItemUnit,
@Semantics.quantity.unitOfMeasure: 'VariableSizeItemUnit'
@Aggregation.default: #SUM
cast(resb.roanz as pph_roanz preserving type) as VariableSizeItemQuantity,
-- Component quantity (ROKME and ROMEN)
@Semantics.unitOfMeasure: true
cast(resb.rokme as pph_rokme preserving type) as VariableSizeComponentUnit,
@Semantics.quantity.unitOfMeasure: 'VariableSizeComponentUnit'
@Aggregation.default: #SUM
cast(resb.romen as pph_romen preserving type) as VariableSizeComponentQuantity,
-- Dimensions (ROMEI and ROMSn)
@Semantics.unitOfMeasure: true
resb.romei as VariableSizeDimensionUnit,
@Semantics.quantity.unitOfMeasure: 'VariableSizeDimensionUnit'
@Aggregation.default: #MAX
resb.roms1 as VariableSizeDimension1,
@Semantics.quantity.unitOfMeasure: 'VariableSizeDimensionUnit'
@Aggregation.default: #MAX
resb.roms2 as VariableSizeDimension2,
@Semantics.quantity.unitOfMeasure: 'VariableSizeDimensionUnit'
@Aggregation.default: #MAX
resb.roms3 as VariableSizeDimension3,
@VDM.lifecycle.status: #DEPRECATED // incompatible with default data element in GFN
@VDM.lifecycle.successor: 'VariableSizeCompFormulaKey'
resb.rform as FormulaKey,
resb.rform as VariableSizeCompFormulaKey,
// Alternative item data
resb.alpos as MaterialCompIsAlternativeItem,
cast(resb.alpgr as pph_alpgr preserving type) as AlternativeItemGroup,
cast(resb.alpst as pph_alpst preserving type) as AlternativeItemStrategy,
cast(resb.alprf as pph_alprf preserving type) as AlternativeItemPriority,
resb.ewahr as UsageProbabilityPercent,
cast(case resb.alpos
when 'X' then resb.splrv
else '0000'
end as vdm_splrv_alt preserving type) as AlternativeMstrReservationItem,
resb.original_rsnum as OriginalReservation,
resb.original_rspos as OriginalReservationItem,
// Phantom assembly
cast(resb.dumps as pph_dumps preserving type) as MaterialComponentIsPhantomItem,
resb.aufwg as OrderPathValue,
resb.aufst as OrderLevelValue,
@ObjectModel.foreignKey.association: '_PhantomAssembly'
resb.baugr as Assembly,
resb.bauwg as AssemblyOrderPathValue,
resb.baust as AssemblyOrderLevelValue,
// Discontinuation
cast(resb.nfeag as pph_nfeag preserving type) as DiscontinuationGroup,
@ObjectModel.foreignKey.association: '_DiscontinuationType'
resb.kzaus as MatlCompDiscontinuationType,
cast(resb.nfpkz as pph_kznfp preserving type) as MatlCompIsFollowUpMaterial,
cast(resb.nfgrp as pph_nfgrp preserving type) as FollowUpGroup,
@ObjectModel.foreignKey.association: '_FollowUpMaterial'
cast(resb.nomat as pph_nomat preserving type) as FollowUpMaterial,
@VDM.lifecycle.status: #DEPRECATED
@VDM.lifecycle.successor: 'FollowUpMaterialIsActive'
cast(resb.nafkz as pph_nafkz preserving type) as FollowUpMaterialIsNotActive,
cast(resb.nafkz as pph_nafkz preserving type) as FollowUpMaterialIsActive,
cast(case resb.kzaus
when '5' then resb.splrv
else '0000'
end as vdm_splrv_dis preserving type) as DiscontinuationMasterResvnItem,
// Material provision
@Semantics.booleanIndicator: true
cast(case
when resb.beikz <> '' then 'X'
else resb.beikz
end as beikz preserving type) as IsMaterialProvision,
@ObjectModel.foreignKey.association: '_ProvisionType'
cast(resb.beikz as vdm_beikz preserving type) as MaterialProvisionType,
// Spare part
@Semantics.booleanIndicator: true
cast(case
when resb.erskz <> '' then 'X'
else resb.erskz
end as erskz preserving type) as MaterialComponentIsSparePart,
@ObjectModel.foreignKey.association: '_SparePartType'
cast(resb.erskz as vdm_erskz preserving type) as MatlComponentSparePartType,
// Lead-Time offset
cast(resb.nlfzt as pph_nlfzt preserving type) as LeadTimeOffset,
@Semantics.unitOfMeasure: true
cast(resb.nlfmv as pph_nlfmv preserving type) as OperationLeadTimeOffsetUnit,
cast(resb.nlfzv as pph_nlfzv preserving type) as OperationLeadTimeOffset,
// Fashion Manufacturing Fields
resb.fsh_critical_comp as CriticalComponentType,
resb.fsh_critical_level as CriticalComponentLevel,
// Quantities and UoM
resb.fmeng as QuantityIsFixed,
resb.netau as IsNetScrap,
resb.ausch as ComponentScrapInPercent,
resb.avoau as OperationScrapInPercent,
resb.umrez as MaterialQtyToBaseQtyNmrtr,
resb.umren as MaterialQtyToBaseQtyDnmntr,
-- Base unit
@Semantics.unitOfMeasure: true
resb.meins as BaseUnit,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
@Aggregation.default: #SUM
resb.bdmng as RequiredQuantity,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
@Aggregation.default: #SUM
cast(resb.enmng as pph_enmng preserving type) as WithdrawnQuantity,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
@Aggregation.default: #SUM
cast(resb.vmeng as pph_vmeng preserving type) as ConfirmedAvailableQuantity,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
@Aggregation.default: #SUM
cast(resb.nomng as pph_nomng preserving type) as MaterialCompOriginalQuantity,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
@Aggregation.default: #SUM
resb.esmng as MaterialComponentUsageQuantity,
-- Entry unit
@Semantics.unitOfMeasure: true
resb.erfme as EntryUnit,
@Semantics.quantity.unitOfMeasure: 'EntryUnit'
@Aggregation.default: #SUM
cast(resb.erfmg as pph_erfmg preserving type) as GoodsMovementEntryQty,
// Amount and Currency
@Semantics.currencyCode: true
resb.waers as Currency,
@DefaultAggregation: #SUM
@Semantics.amount.currencyCode: 'Currency'
resb.enwrt as WithdrawnQuantityAmount,
// Associations
_Reservation,
_ReservationItem,
_ReservationDocRecordType,
_ManufacturingOrder,
_Order,
_OrderCategory,
_OrderType,
_OrderItem,
_OrderSequence,
_OrderOperation,
_OrderOperationBySemKey,
_OrderInternalID,
_SequenceCategory,
_ProductionPlant,
_RequirementType,
_MaterialGroup,
_Material,
_MaterialPlant, // for DCLS
_Product,
_ProductPlant,
_ProductStorageLocation,
_Plant,
_StorageLocation,
_Batch,
_BatchSplitType,
_DebitCreditCode,
_GoodsMovementType,
_InventorySpecialStockType,
_InventorySpecialStockValnType,
_ConsumptionPosting,
_SupplyArea,
_FollowUpMaterial,
_DiscontinuationType,
_ProvisionType,
_SparePartType,
_PhantomAssembly,
_BOMExplosion,
_BillOfMaterialItem,
_BOMItemCategory,
_SalesOrder,
_SalesOrderItem,
_WBSElement,
_WBSElementBasicData,
_ChangeNumber,
_MaterialRevisionLevel,
_PurchasingGroup,
_PurchasingInfoRecord,
_PurchaseOrder,
_PurchaseOrderItem,
_PurchaseRequisition,
_PurchaseRequisitionItem,
_Supplier,
_Warehouse,
_CompanyCode,
_BusinessArea,
_GLAccount,
_ControllingArea,
_FunctionalArea,
_AccountAssignmentCategory,
_EarmarkedFunds,
_EarmarkedFundsItem,
_Fund,
_FundsCenter,
_CommitmentItem,
_CommitmentItemShortID,
_OpLeadTimeOffsetUnit,
_VariableSizeItemUnit,
_VariableSizeComponentUnit,
_BaseUnit,
_EntryUnit,
_Currency,
_LongText,
_LongTextLanguage
};