I_BatchDistinct

DDL: I_BATCHDISTINCT SQL: IBATCHDISTINCT Type: view COMPOSITE

Batch information by batch key

I_BatchDistinct (Composite)

Package: Explore, extend and adapt the SAP S/4HANA Cloud Private Edition with built-in and side-by-side extension capabilities.

Manufacturing

I_BatchDistinct is a Composite CDS View (Dimension) that provides data about "Batch information by batch key" in SAP S/4HANA. It reads from 4 data sources (I_BatchConfiguration, I_BatchConfiguration, I_BatchCrossPlant, P_BatchPlant) and exposes 77 fields with key fields Plant, Material, Batch, Material, Batch. It has 5 associations to related views.

SAP API Hub

StateC1
Line of BusinessManufacturing
Application ComponentLO-BM-MD
CapabilitiesData Source in SQL Select, Association Target for Defining CDS Entities, Data Source for Defining CDS Entities, Analytical Dimension
PackageManufacturing for SAP S/4HANA Cloud Private Edition
Description <p>This CDS view provides the prerequisites for answering the following business questions:</p> <ul> <li><p>When will the shelf life of the batch expire?</p></li> <li><p>To which supplier can a batch be traced?</p></li> <li><p>Where and when was the batch manufactured?</p></li> <li><p>Which batches are available for unrestricted use?</p></li> </ul>

Documentation

Data Sources (4)

SourceAliasJoin Type
I_BatchConfiguration I_BatchConfiguration inner
I_BatchConfiguration I_BatchConfiguration inner
I_BatchCrossPlant I_BatchCrossPlant from
P_BatchPlant P_BatchPlant union_all

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[1..1] I_Product _Product $projection.Material = _Product.Product
[0..1] I_ClfnObjectClassForKeyDate _ClfnObjectClassForKeyDate $projection.ClfnObjectInternalID = _ClfnObjectClassForKeyDate.ClfnObjectInternalID
[0..*] I_ClfnObjectCharcValForKeyDate _ClfnObjectCharcValForKeyDate $projection.ClfnObjectInternalID = _ClfnObjectCharcValForKeyDate.ClfnObjectInternalID
[0..*] I_BatchDistinctText _BatchDistinctText $projection.Batch = _BatchDistinctText.Batch and $projection.Material = _BatchDistinctText.Material and $projection.Plant = _BatchDistinctText.Plant

Annotations (15)

NameValueLevelField
AbapCatalog.sqlViewName IBATCHDISTINCT view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Batch information by batch key view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #MASTER view
ObjectModel.representativeKey Batch view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
Analytics.dataCategory #DIMENSION view
Metadata.allowExtensions true view
Metadata.ignorePropagatedAnnotations true view

Fields (77)

KeyFieldSource TableSource FieldDescription
KEY Plant Plant
KEY Material Material Material Number
KEY Batch Batch Batch Number
BatchIsMarkedForDeletion BatchIsMarkedForDeletion Deletion Flag for All Data in a Batch
MatlBatchIsInRstrcdUseStock MatlBatchIsInRstrcdUseStock Batch in Restricted-Use Stock
Supplier Supplier Supplier's Account Number
BatchBySupplier BatchBySupplier Supplier Batch Number
CountryOfOrigin CountryOfOrigin Country/Region of Origin of Material (Non-Preferential Ori.)
RegionOfOrigin RegionOfOrigin Region of Origin of Material (Non-Preferential Origin)
MatlBatchAvailabilityDate MatlBatchAvailabilityDate Availability date
ShelfLifeExpirationDate ShelfLifeExpirationDate Shelf Life Expiration or Best-Before Date
ManufactureDate ManufactureDate Date of Manufacture
NextInspectionDate NextInspectionDate Next Inspection Date
LastGoodsReceiptDate LastGoodsReceiptDate Date of last goods receipt
FreeDefinedDate1 FreeDefinedDate1 Date for Free Use 1
FreeDefinedDate2 FreeDefinedDate2 Date for Free Use 2
FreeDefinedDate3 FreeDefinedDate3 Date for Free Use 3
FreeDefinedDate4 FreeDefinedDate4 Date for Free Use 4
FreeDefinedDate5 FreeDefinedDate5 Date for Free Use 5
FreeDefinedDate6 FreeDefinedDate6 Date for Free Use 6
DefinitionOfBatchLevel DefinitionOfBatchLevel Indicator: definition of batch management level
BatchCertificationDate BatchCertificationDate Date of Certification
CreationDateTime CreationDateTime Created On Timestamp
LastChangeDateTime LastChangeDateTime Last Change Timestamp
ClfnObjectInternalID ClfnObjectInternalID Internal object no.: Batch classification
BatchExtWhseMgmtInternalId BatchExtWhseMgmtInternalId Batch ID
StockSegment StockSegment Stock Segment
ExportAndImportProductGroup ExportAndImportProductGroup Material Group for Intrastat
InventoryValuationType Valuation Type
BatchVersion BatchVersion Version of a batch
_Plant _Plant
_Material _Material
_Supplier _Supplier
_CountryOfOrigin _CountryOfOrigin
_RegionOfOrigin _RegionOfOrigin
_Product _Product
_ClfnObjectClassForKeyDate _ClfnObjectClassForKeyDate
_ClfnObjectCharcValForKeyDate _ClfnObjectCharcValForKeyDate
PlantkeyPlant
KEY Material Material Material Number
KEY Batch Batch Batch Number
BatchIsMarkedForDeletion BatchIsMarkedForDeletion Deletion Flag for All Data in a Batch
MatlBatchIsInRstrcdUseStock MatlBatchIsInRstrcdUseStock Batch in Restricted-Use Stock
Supplier Supplier Supplier's Account Number
BatchBySupplier BatchBySupplier Supplier Batch Number
CountryOfOrigin CountryOfOrigin Country/Region of Origin of Material (Non-Preferential Ori.)
RegionOfOrigin RegionOfOrigin Region of Origin of Material (Non-Preferential Origin)
MatlBatchAvailabilityDate MatlBatchAvailabilityDate Availability date
ShelfLifeExpirationDate ShelfLifeExpirationDate Shelf Life Expiration or Best-Before Date
ManufactureDate ManufactureDate Date of Manufacture
NextInspectionDate NextInspectionDate Next Inspection Date
LastGoodsReceiptDate LastGoodsReceiptDate Date of last goods receipt
FreeDefinedDate1 FreeDefinedDate1 Date for Free Use 1
FreeDefinedDate2 FreeDefinedDate2 Date for Free Use 2
FreeDefinedDate3 FreeDefinedDate3 Date for Free Use 3
FreeDefinedDate4 FreeDefinedDate4 Date for Free Use 4
FreeDefinedDate5 FreeDefinedDate5 Date for Free Use 5
FreeDefinedDate6 FreeDefinedDate6 Date for Free Use 6
DefinitionOfBatchLevel DefinitionOfBatchLevel Indicator: definition of batch management level
BatchCertificationDate BatchCertificationDate Date of Certification
CreationDateTime CreationDateTime Created On Timestamp
LastChangeDateTime LastChangeDateTime Last Change Timestamp
ClfnObjectInternalID ClfnObjectInternalID Internal object no.: Batch classification
BatchExtWhseMgmtInternalId BatchExtWhseMgmtInternalId Batch ID
StockSegment StockSegment Stock Segment
ExportAndImportProductGroup ExportAndImportProductGroup Material Group for Intrastat
InventoryValuationType InventoryValuationType Valuation Type
BatchVersion BatchVersion Version of a batch
_Plant _Plant
_Material _Material
_Supplier _Supplier
_CountryOfOrigin _CountryOfOrigin
_RegionOfOrigin _RegionOfOrigin
_Product _Product
_ClfnObjectClassForKeyDate _ClfnObjectClassForKeyDate
_ClfnObjectCharcValForKeyDate _ClfnObjectCharcValForKeyDate
_BatchDistinctText _BatchDistinctText

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_BatchDistinct.
-- 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: IBATCHDISTINCT

CREATE VIEW I_BatchDistinct AS
SELECT
  cast(' ' as werks_d preserving type) AS Plant,
  Material,
  Batch,
  BatchIsMarkedForDeletion,
  MatlBatchIsInRstrcdUseStock,
  Supplier,
  BatchBySupplier,
  CountryOfOrigin,
  RegionOfOrigin,
  MatlBatchAvailabilityDate,
  ShelfLifeExpirationDate,
  ManufactureDate,
  NextInspectionDate,
  LastGoodsReceiptDate,
  FreeDefinedDate1,
  FreeDefinedDate2,
  FreeDefinedDate3,
  FreeDefinedDate4,
  FreeDefinedDate5,
  FreeDefinedDate6,
  DefinitionOfBatchLevel,
  BatchCertificationDate,
  CreationDateTime,
  LastChangeDateTime,
  ClfnObjectInternalID,
  BatchExtWhseMgmtInternalId,
  StockSegment,
  ExportAndImportProductGroup,
  cast( ' ' as bwtar_d preserving type ) AS InventoryValuationType,
  BatchVersion
FROM I_BatchCrossPlant
INNER JOIN I_BatchConfiguration ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant  -- association [0..1]
LEFT OUTER JOIN I_Product AS _Product ON Material = _Product.Product  -- association [1..1]
LEFT OUTER JOIN I_ClfnObjectClassForKeyDate AS _ClfnObjectClassForKeyDate ON ClfnObjectInternalID = _ClfnObjectClassForKeyDate.ClfnObjectInternalID  -- association [0..1]
LEFT OUTER JOIN I_ClfnObjectCharcValForKeyDate AS _ClfnObjectCharcValForKeyDate ON ClfnObjectInternalID = _ClfnObjectCharcValForKeyDate.ClfnObjectInternalID  -- association [0..*]
LEFT OUTER JOIN I_BatchDistinctText AS _BatchDistinctText ON Batch = _BatchDistinctText.Batch AND Material = _BatchDistinctText.Material AND Plant = _BatchDistinctText.Plant  -- association [0..*]
-- UNION ALL with additional select branch(es): P_BatchPlant
;