I_Batch_2

DDL: I_BATCH_2 Type: view_entity COMPOSITE Package: LO_BM_BATCH_DB

Batch Information by Batch Key

Batch Information by Batch Key

I_Batch_2 (Composite)

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

Manufacturing

I_Batch_2 is a Composite CDS View (Dimension) that provides data about "Batch Information by Batch Key" in SAP S/4HANA. It reads from 1 data source (R_Batch) and exposes 38 fields with key fields Material, BatchIdentifyingPlant, Batch. It has 2 associations to related views. Part of development package LO_BM_BATCH_DB.

SAP Help Documentation

CategoryCDS Views for Batch Management
Purpose
This CDS view of the batch master record is aligned with the SAP business object Batch . This CDS view is intended to replace the CDS view Batch Distinct (Successor available) ( I_BatchDistinct ). This CDS view provides the data to answer the following business questions: When will the shelf life of the batch expire? To which supplier can a batch be traced? Where and when was the batch manufactured? Which batches are available for unrestricted use? To help you decide which CDS view to use for your purposes, SAP has introduced the annotation ObjectModel.supportedCapabilities that indicates the most appropriate use cases for each CDS view. To find out what use cases are best supported by this CDS view, access the entry of the CDS view in the View Browser app and find the values for this annotation under the Annotation tab. For more information, see Supported Capabilities for CDS Views .

Prerequisites
Authorizations To be able to test this CDS view in Cloud Development, the Developer role needs authorization for IAM app LO_BM_BATCH_DB_TRAN , which is used in business catalog SAP_A4C_BC_DEV_TST_LO_BM0_PC . See Display IAM Apps . Users who want to use this CDS view must have a role with the following restriction type: BEGRU_MAT (Authorization Group for Product) You can use the Display Restriction Types app to find out in which business catalogs and IAM apps these restriction types are included. See Display Restriction Types .

Structure
Parameters The view does not have any parameters. Important Fields Important fields in this view include the following: Field Name Description BatchIdentifyingPlant This field is always empty in SAP S/4HANA Cloud Public Edition . ShelfLifeExpirationDate Describes when the batch expires. BatchBySupplier Contains the alternative batch identifier which is assigned to the batch by the supplier. NextInspectionDate Describes the date for the next recurring inspection for the batch.

When to Use Which CDS View
Use this CDS view if you are looking for a view that returns one row per material and batch combination. Use CDS view Batch Information with Plant-Specific Data ( I_BatchWithPlant_2 ) if you are looking for a view that returns information about batches and in which plants they have been used.

View on SAP Help Portal →

SAP API Hub

CategoryComposite
StateC1
Line of BusinessManufacturing
Application ComponentLO-BM-MD-2CL
CapabilitiesData Source for Defining CDS Entities,Analytical Dimension,Data Source in SQL Select,Association Target for Defining CDS Entities
Extensible (Key User)No
Extensible (Developer)No
Release State (Key User)Released
Release State (Developer)Released
PackageManufacturing for SAP S/4HANA Cloud Public Edition
Description <p>This CDS view of the batch master record is aligned with the SAP business object Batch. This CDS view is intended to replace the CDS view Batch Distinct (Successor available) (I_BatchDistinct).</p> <p>This CDS view provides the data to answer 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> <p>To help you decide which CDS view to use for your purposes, SAP has introduced the annotation ObjectModel.supportedCapabilities that indicates the most appropriate use cases for each CDS view. To find out what use cases are best supported by this CDS view, access the entry of the CDS view in the View Browser app and find the values for this annotation under the Annotation tab. For more information, see Supported Capabilities for CDS Views.</p>

Documentation

Data Sources (1)

SourceAliasJoin Type
R_Batch R_Batch from

Associations (2)

CardinalityTargetAliasCondition
[0..*] I_BatchText_2 _BatchText $projection.Material = _BatchText.Material and $projection.BatchIdentifyingPlant = _BatchText.BatchIdentifyingPlant and $projection.Batch = _BatchText.Batch
[1..*] I_BatchWithPlant_2 _BatchWithPlant $projection.Material = _BatchWithPlant.Material and $projection.BatchIdentifyingPlant = _BatchWithPlant.BatchIdentifyingPlant and $projection.Batch = _BatchWithPlant.Batch

Annotations (13)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking #NOT_REQUIRED view
EndUserText.label Batch Information by Batch Key view
ObjectModel.representativeKey Batch view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.dataClass #MASTER view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
Analytics.dataCategory #DIMENSION view
Analytics.internalName #LOCAL view
Metadata.allowExtensions true view
Metadata.ignorePropagatedAnnotations true view

Fields (38)

KeyFieldSource TableSource FieldDescription
KEY Material Material Material Number
KEY BatchIdentifyingPlant Plant Valuation Area
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
_BatchIdentifyingPlant _Plant
_Supplier _Supplier
_CountryOfOrigin _CountryOfOrigin
_RegionOfOrigin _RegionOfOrigin
_Product _Product
_ClfnObjectClassForKeyDate _ClfnObjectClassForKeyDate
_ClfnObjectCharcValForKeyDate _ClfnObjectCharcValForKeyDate
_BatchText _BatchText
_BatchWithPlant _BatchWithPlant

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_Batch_2.
-- 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_Batch_2 AS
SELECT
  Material,
  Plant AS BatchIdentifyingPlant,
  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,
  InventoryValuationType
FROM R_Batch
LEFT OUTER JOIN I_BatchText_2 AS _BatchText ON Material = _BatchText.Material AND BatchIdentifyingPlant = _BatchText.BatchIdentifyingPlant AND Batch = _BatchText.Batch  -- association [0..*]
LEFT OUTER JOIN I_BatchWithPlant_2 AS _BatchWithPlant ON Material = _BatchWithPlant.Material AND BatchIdentifyingPlant = _BatchWithPlant.BatchIdentifyingPlant AND Batch = _BatchWithPlant.Batch  -- association [1..*]
;