Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view I_OrderComponentBasic.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
CREATE VIEW I_OrderComponentBasic AS
SELECT
resb.rsnum AS Reservation,
cast(resb.rspos as pph_rspos preserving type) AS ReservationItem,
cast(resb.rsart as pph_rsart preserving type) AS RecordType,
resb.matkl AS MaterialGroup,
resb.matnr AS Material,
resb.werks AS Plant,
resb.aufnr AS OrderID,
resb.afpos AS OrderItem,
resb.plnfl AS Sequence,
cast(resb.flgat as folgenart preserving type) AS SequenceCategory,
cast(resb.vornr as vdm_vornr preserving type) AS OrderOperation,
cast(resb.uvorn as vdm_uvorn preserving type) AS OrderSuboperation,
cast(resb.aufpl as pph_aufpl preserving type) AS OrderInternalID,
cast(resb.aplzl as operationinternalid preserving type) AS OrderOperationInternalID,
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,
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(resb.sgtxt as pph_sgtxt preserving type) AS ReservationItemText,
resb.potx1 AS MaterialComponentText,
resb.potx2 AS MaterialComponentSecondText,
cast(resb.ltxsp as pph_longtextlang preserving type) AS LongTextLanguage,
cast(resb.bdart as pph_bdart preserving type) AS RequirementType,
cast(resb.kdauf as co_kdauf preserving type) AS SalesOrder,
cast(resb.kdpos as co_kdpos preserving type) AS SalesOrderItem,
cast(resb.pspel as ps_s4_pspnr preserving type) AS WBSElementInternalID,
resb.cuobj AS ProductConfiguration,
resb.aennr AS ChangeNumber,
cast(resb.revlv as vdm_qm_revlv preserving type) AS MaterialRevisionLevel,
resb.techs AS EffectivityParameterVariant,
resb.sortf AS MaterialComponentSortText,
resb.objnr AS ObjectInternalID,
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,
resb.potx1 AS BOMItemDescription,
resb.potx2 AS BOMItemText2,
cast(resb.sernr as pph_sernr preserving type) AS BOMExplosionDateID,
cast(resb.infnr as pph_infnr preserving type) AS PurchasingInfoRecord,
cast(resb.ekgrp as pph_ekgrp preserving type) AS PurchasingGroup,
cast(resb.banfn as co_banfn preserving type) AS PurchaseRequisition,
cast(resb.bnfpo as co_bnfpo preserving type) AS PurchaseRequisitionItem,
cast(resb.ebeln as vdm_purchaseorder preserving type) AS PurchaseOrder,
cast(resb.ebelp as vdm_purchaseorderitem preserving type) AS PurchaseOrderItem,
cast(resb.ebele as fis_etenr preserving type) AS PurchaseOrderScheduleLine,
resb.lifnr AS Supplier,
cast(resb.lifzt as pph_lifzt preserving type) AS DeliveryDurationInDays,
cast(resb.webaz as pph_webaz preserving type) AS MaterialGoodsReceiptDuration,
cast(resb.peinh as pph_peinh preserving type) AS NumberOfPriceUnits,
resb.xwaok AS GoodsMovementIsAllowed,
cast(resb.lgort as pph_lgort preserving type) AS StorageLocation,
cast(resb.shkzg as pph_shkzg preserving type) AS DebitCreditCode,
resb.bwart AS GoodsMovementType,
cast(resb.sobkz as inventoryspecialstocktype preserving type) AS InventorySpecialStockType,
cast(resb.kzbws as pph_kzbws preserving type) AS InventorySpecialStockValnType,
cast(resb.kzvbr as pph_kzvbr preserving type) AS ConsumptionPosting,
cast(resb.prvbe as pph_prvbe preserving type) AS SupplyArea,
cast(resb.wempf as pph_wempf preserving type) AS GoodsRecipientName,
resb.ablad AS UnloadingPointName,
resb.sgt_scat AS StockSegment,
resb.sgt_rcat AS RequirementSegment,
resb.charg AS Batch,
resb.splkz AS BatchSplitType,
resb.chobj AS BatchClassification,
resb.berkz AS MaterialStaging,
resb.lgnum AS Warehouse,
resb.lgtyp AS StorageType,
resb.lgpla AS StorageBin,
resb.sanka AS MaterialCompCostingRelevancy,
resb.gsber AS BusinessArea,
resb.saknr AS GLAccount,
resb.fkber AS FunctionalArea,
cast(resb.knttp as pph_knttp preserving type) AS AccountAssignmentCategory,
resb.kblnr AS EarmarkedFundsDocument,
resb.kblpos AS EarmarkedFundsDocumentItem,
cast(resb.fistl as bbpfistl preserving type) AS FundsCenter,
resb.geber AS Fund,
resb.fipex AS CommitmentItem,
cast(resb.fipos as fmis_ci_internalname preserving type) AS CommitmentItemShortID,
resb.rohps AS MaterialCompIsVariableSized,
cast(resb.roanz as pph_roanz preserving type) AS VariableSizeItemQuantity,
cast(resb.romen as pph_romen preserving type) AS VariableSizeComponentQuantity,
resb.roms1 AS VariableSizeDimension1,
resb.roms2 AS VariableSizeDimension2,
resb.roms3 AS VariableSizeDimension3,
resb.rform AS VariableSizeCompFormulaKey,
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,
resb.original_rsnum AS OriginalReservation,
resb.original_rspos AS OriginalReservationItem,
cast(resb.dumps as pph_dumps preserving type) AS MaterialComponentIsPhantomItem,
resb.aufwg AS OrderPathValue,
resb.aufst AS OrderLevelValue,
resb.baugr AS Assembly,
resb.bauwg AS AssemblyOrderPathValue,
resb.baust AS AssemblyOrderLevelValue,
cast(resb.nfeag as pph_nfeag preserving type) AS DiscontinuationGroup,
resb.kzaus AS MatlCompDiscontinuationType,
cast(resb.nfpkz as pph_kznfp preserving type) AS MatlCompIsFollowUpMaterial,
cast(resb.nfgrp as pph_nfgrp preserving type) AS FollowUpGroup,
cast(resb.nomat as pph_nomat preserving type) AS FollowUpMaterial,
cast(resb.nafkz as pph_nafkz preserving type) AS FollowUpMaterialIsActive,
cast(resb.beikz as vdm_beikz preserving type) AS MaterialProvisionType,
cast(resb.erskz as vdm_erskz preserving type) AS MatlComponentSparePartType,
cast(resb.nlfzt as pph_nlfzt preserving type) AS LeadTimeOffset,
cast(resb.nlfmv as pph_nlfmv preserving type) AS OperationLeadTimeOffsetUnit,
cast(resb.nlfzv as pph_nlfzv preserving type) AS OperationLeadTimeOffset,
resb.fsh_critical_comp AS CriticalComponentType,
resb.fsh_critical_level AS CriticalComponentLevel,
resb.fmeng AS QuantityIsFixed,
resb.netau AS IsNetScrap,
resb.ausch AS ComponentScrapInPercent,
resb.avoau AS OperationScrapInPercent,
resb.umrez AS MaterialQtyToBaseQtyNmrtr,
resb.umren AS MaterialQtyToBaseQtyDnmntr,
resb.bdmng AS RequiredQuantity,
cast(resb.enmng as pph_enmng preserving type) AS WithdrawnQuantity,
cast(resb.vmeng as pph_vmeng preserving type) AS ConfirmedAvailableQuantity,
cast(resb.nomng as pph_nomng preserving type) AS MaterialCompOriginalQuantity,
resb.esmng AS MaterialComponentUsageQuantity,
cast(resb.erfmg as pph_erfmg preserving type) AS GoodsMovementEntryQty,
resb.waers AS Currency,
resb.enwrt AS WithdrawnQuantityAmount
FROM I_ReservationItem AS resb
LEFT OUTER JOIN I_OrderBasic AS _OrderBasic ON resb.aufnr = _OrderBasic.OrderID -- association [0..1]
LEFT OUTER JOIN I_LogisticsOrder AS _LogisticsOrder ON OrderID = _LogisticsOrder.OrderID -- association [1..1]
;