I_BatchHistory

DDL: I_BATCHHISTORY SQL: IBATCHISTORY Type: view BASIC

History of Batch Usage

I_BatchHistory is a Basic CDS View that provides data about "History of Batch Usage" in SAP S/4HANA. It reads from 1 data source (chvw) and exposes 43 fields with key fields IsGoodsIssueDocument, Plant, Material, Batch, ManufacturingOrder. It has 18 associations to related views.

Data Sources (1)

SourceAliasJoin Type
chvw chvw from

Associations (18)

CardinalityTargetAliasCondition
[1..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[1..1] I_Material _Material $projection.Material = _Material.Material
[1..1] I_Batch _Batch $projection.Plant = _Batch.Plant and $projection.Material = _Batch.Material and $projection.Batch = _Batch.Batch
[0..1] I_Material _IssgOrRcvgMaterial $projection.IssgOrRcvgMaterial = _IssgOrRcvgMaterial.Material
[1..1] I_Product _Product $projection.Material = _Product.Product
[0..1] I_Supplier _Supplier $projection.Supplier = _Supplier.Supplier
[0..1] I_SupplierCompany _SupplierCompany $projection.Supplier = _SupplierCompany.Supplier and $projection.companycode = _SupplierCompany.CompanyCode
[0..1] I_Customer _Customer $projection.Customer = _Customer.Customer
[0..1] I_CustomerCompany _CustomerCompany $projection.Customer = _CustomerCompany.Customer and $projection.companycode = _CustomerCompany.CompanyCode
[0..1] I_UnitOfMeasure _MaterialBaseUnit $projection.MaterialBaseUnit = _MaterialBaseUnit.UnitOfMeasure
[0..1] I_SalesOrder _SalesOrder $projection.SalesOrder = _SalesOrder.SalesOrder
[0..1] I_SalesOrderItem _SalesOrderItem $projection.SalesOrder = _SalesOrderItem.SalesOrder and $projection.SalesOrderItem = _SalesOrderItem.SalesOrderItem
[0..1] I_PurchaseOrder _PurchaseOrder $projection.PurchaseOrder = _PurchaseOrder.PurchaseOrder
[0..1] I_PurchaseOrderItem _PurchaseOrderItem $projection.PurchaseOrder = _PurchaseOrderItem.PurchaseOrder and $projection.PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem
[0..1] I_ManufacturingOrder _MfgOrder $projection.ManufacturingOrder = _MfgOrder.ManufacturingOrder
[0..1] I_ManufacturingOrderItem _MfgOrderItem $projection.ManufacturingOrder = _MfgOrderItem.ManufacturingOrder and $projection.ManufacturingOrderItem = _MfgOrderItem.ManufacturingOrderItem
[0..1] I_DeliveryDocument _DeliveryDocument $projection.DeliveryDocument = _DeliveryDocument.DeliveryDocument
[0..1] I_DeliveryDocumentItem _DeliveryDocumentItem $projection.DeliveryDocument = _DeliveryDocumentItem.DeliveryDocument and $projection.DeliveryDocumentItem = _DeliveryDocumentItem.DeliveryDocumentItem

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName IBATCHISTORY view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
EndUserText.label History of Batch Usage view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private false view
VDM.viewType #BASIC view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view

Fields (43)

KeyFieldSource TableSource FieldDescription
KEY IsGoodsIssueDocument Receipt indic.
KEY Plant werks Receiving Plant
KEY Material matnr Vehicle Model
KEY Batch charg Chargeable Proc.
KEY ManufacturingOrder SettlementOrder
KEY ManufacturingOrderItem Order item no.
KEY PurchaseOrder ebeln Source PurchDoc
KEY PurchaseOrderItem Item pur. doc.
KEY SalesOrder kdauf SD Document
KEY SalesOrderItem Sales Ord. Item
KEY MaterialDocumentYear mjahr Mat. Doc. Year
KEY MaterialDocument mblnr Material Doc.
KEY MaterialDocumentItem zeile Mat. Doc.Item
IsReversalMovementType xstbw RevMvmtTypeInd.
PostingDate budat Posting Date
QuantityInBaseUnit menge WarrCountValue
MaterialBaseUnit meins Valuation Unit
IssgOrRcvgMaterial ummat Receiving Mat.
Supplier lifnr Vendor no.
BatchBySupplier licha Supplier Batch
Customer kunnr Stock customer
DeliveryDocument vbeln SD Sched. Agmt
DeliveryDocumentItem WBS Element
GoodsMovementRefDocType kzbew Movement ind.
CompanyCode
_Plant _Plant
_Material _Material
_Product _Product
_Supplier _Supplier
_SupplierCompany _SupplierCompany
_Customer _Customer
_CustomerCompany _CustomerCompany
_Batch _Batch
_IssgOrRcvgMaterial _IssgOrRcvgMaterial
_MaterialBaseUnit _MaterialBaseUnit
_SalesOrder _SalesOrder
_SalesOrderItem _SalesOrderItem
_PurchaseOrder _PurchaseOrder
_PurchaseOrderItem _PurchaseOrderItem
_MfgOrder _MfgOrder
_MfgOrderItem _MfgOrderItem
_DeliveryDocument _DeliveryDocument
_DeliveryDocumentItem _DeliveryDocumentItem

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_BatchHistory.
-- 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.
-- SQL view name: IBATCHISTORY

CREATE VIEW I_BatchHistory AS
SELECT
  cast(xzuga as s4lobm_xzuga preserving type) AS IsGoodsIssueDocument,
  werks AS Plant,
  matnr AS Material,
  charg AS Batch,
  cast(aufnr as manufacturingorder preserving type) AS ManufacturingOrder,
  cast(aufps as manufacturingorderitem preserving type) AS ManufacturingOrderItem,
  ebeln AS PurchaseOrder,
  cast(ebelp as s4lobm_ebelp preserving type) AS PurchaseOrderItem,
  kdauf AS SalesOrder,
  cast(kdpos as s4lobm_kdpos preserving type) AS SalesOrderItem,
  mjahr AS MaterialDocumentYear,
  mblnr AS MaterialDocument,
  zeile AS MaterialDocumentItem,
  xstbw AS IsReversalMovementType,
  budat AS PostingDate,
  menge AS QuantityInBaseUnit,
  meins AS MaterialBaseUnit,
  ummat AS IssgOrRcvgMaterial,
  lifnr AS Supplier,
  licha AS BatchBySupplier,
  kunnr AS Customer,
  vbeln AS DeliveryDocument,
  cast(posnr as s4lobm_posnr preserving type) AS DeliveryDocumentItem,
  kzbew AS GoodsMovementRefDocType,
  _Plant._ValuationArea.CompanyCode AS CompanyCode
FROM chvw
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant  -- association [1..1]
LEFT OUTER JOIN I_Material AS _Material ON Material = _Material.Material  -- association [1..1]
LEFT OUTER JOIN I_Batch AS _Batch ON Plant = _Batch.Plant AND Material = _Batch.Material AND Batch = _Batch.Batch  -- association [1..1]
LEFT OUTER JOIN I_Material AS _IssgOrRcvgMaterial ON IssgOrRcvgMaterial = _IssgOrRcvgMaterial.Material  -- association [0..1]
LEFT OUTER JOIN I_Product AS _Product ON Material = _Product.Product  -- association [1..1]
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier  -- association [0..1]
LEFT OUTER JOIN I_SupplierCompany AS _SupplierCompany ON Supplier = _SupplierCompany.Supplier AND companycode = _SupplierCompany.CompanyCode  -- association [0..1]
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer  -- association [0..1]
LEFT OUTER JOIN I_CustomerCompany AS _CustomerCompany ON Customer = _CustomerCompany.Customer AND companycode = _CustomerCompany.CompanyCode  -- association [0..1]
LEFT OUTER JOIN I_UnitOfMeasure AS _MaterialBaseUnit ON MaterialBaseUnit = _MaterialBaseUnit.UnitOfMeasure  -- association [0..1]
LEFT OUTER JOIN I_SalesOrder AS _SalesOrder ON SalesOrder = _SalesOrder.SalesOrder  -- association [0..1]
LEFT OUTER JOIN I_SalesOrderItem AS _SalesOrderItem ON SalesOrder = _SalesOrderItem.SalesOrder AND SalesOrderItem = _SalesOrderItem.SalesOrderItem  -- association [0..1]
LEFT OUTER JOIN I_PurchaseOrder AS _PurchaseOrder ON PurchaseOrder = _PurchaseOrder.PurchaseOrder  -- association [0..1]
LEFT OUTER JOIN I_PurchaseOrderItem AS _PurchaseOrderItem ON PurchaseOrder = _PurchaseOrderItem.PurchaseOrder AND PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem  -- association [0..1]
LEFT OUTER JOIN I_ManufacturingOrder AS _MfgOrder ON ManufacturingOrder = _MfgOrder.ManufacturingOrder  -- association [0..1]
LEFT OUTER JOIN I_ManufacturingOrderItem AS _MfgOrderItem ON ManufacturingOrder = _MfgOrderItem.ManufacturingOrder AND ManufacturingOrderItem = _MfgOrderItem.ManufacturingOrderItem  -- association [0..1]
LEFT OUTER JOIN I_DeliveryDocument AS _DeliveryDocument ON DeliveryDocument = _DeliveryDocument.DeliveryDocument  -- association [0..1]
LEFT OUTER JOIN I_DeliveryDocumentItem AS _DeliveryDocumentItem ON DeliveryDocument = _DeliveryDocumentItem.DeliveryDocument AND DeliveryDocumentItem = _DeliveryDocumentItem.DeliveryDocumentItem  -- association [0..1]
;