I_BatchWithPlant_2

DDL: I_BATCHWITHPLANT_2 Type: view_entity COMPOSITE Package: LO_BM_BATCH_DB

Batch Info with Plant Specific Data

I_BatchWithPlant_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_BatchWithPlant_2 is a Composite CDS View (Dimension) that provides data about "Batch Info with Plant Specific Data" in SAP S/4HANA. It reads from 3 data sources (P_BatchPlant, R_Batch, R_Batch) and exposes 79 fields with key fields Material, Plant, Batch, Plant, Batch. It has 1 association 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 provides both root and plant-specific data, and it is aligned with the SAP business object Batch . This CDS view is intended to replace the CDS view Batch (Successor available) ( I_BATCH ). 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? In which plants has the batch been used? 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 restriction types: BEGRU_MAT (Authorization Group for Product) WERKS (Plant) 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 Plant Plant where the batch can or could be found. The view might return several rows for each batch. 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. IsSubordinateBatch Batches with plant are returned as subordinate entries. NextInspectionDate Describes the date for the next recurring inspection for the batch. InventoryValuationType Uniquely identifies separately valuated stocks of a material. The inventory valuation type will only be filled when also the plant field is filled.

When to Use Which CDS View
Use this CDS view if you are looking for a view that returns information about batches and in which plants they have been used. Use CDS view Batch Information by Batch Key ( I_Batch_2 ) if you are looking for a view that only returns one row per material and batch combination. Consider the following alternatives depending on your requirements: If only the assignment of batches to plants is relevant for you, you can filter out rows with empty plant fields in I_BatchWithPlant_2 . No standard CDS view is available that filters out rows with empty plant fields If only the batches are relevant (irrespective of their assignment to plants), you can use the view I_Batch_2 . If both the batches and their assignment are relevant, you can use I_BatchWithPlant_2 directly. In this case, be aware that a batch may have multiple rows: One row for the batch, with empty plant field One row for each plant assignment

View on SAP Help Portal →

SAP API Hub

CategoryComposite
StateC1
Line of BusinessManufacturing
Application ComponentLO-BM-MD-2CL
CapabilitiesData Source in SQL Select,Association Target for Defining CDS Entities,Data Source for Defining CDS Entities,Analytical Dimension
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 provides both root and plant-specific data, and it is aligned with the SAP business object Batch. This CDS view is intended to replace the CDS view Batch (Successor available) (I_BATCH).</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> <li><p>In which plants has the batch been used?</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 (3)

SourceAliasJoin Type
P_BatchPlant P_BatchPlant union_all
R_Batch R_Batch from
R_Batch R_Batch inner

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_Batch_2 _Batch $projection.Material = _Batch.Material and $projection.BatchIdentifyingPlant = _Batch.BatchIdentifyingPlant and $projection.Batch = _Batch.Batch

Annotations (14)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking #NOT_REQUIRED view
EndUserText.label Batch Info with Plant Specific Data view
ObjectModel.representativeKey Batch view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.dataClass #MASTER view
ObjectModel.modelingPattern #NONE 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 (79)

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

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_BatchWithPlant_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_BatchWithPlant_2 AS
SELECT
  Material,
  Plant,
  Batch,
  Plant AS BatchIdentifyingPlant,
  BatchIsMarkedForDeletion,
  cast('' as lvorm preserving type ) AS BatchPlantIsMarkedForDeletion,
  MatlBatchIsInRstrcdUseStock,
  Supplier,
  BatchBySupplier,
  CountryOfOrigin,
  RegionOfOrigin,
  MatlBatchAvailabilityDate,
  ShelfLifeExpirationDate,
  ManufactureDate,
  NextInspectionDate,
  LastGoodsReceiptDate,
  FreeDefinedDate1,
  FreeDefinedDate2,
  FreeDefinedDate3,
  FreeDefinedDate4,
  FreeDefinedDate5,
  FreeDefinedDate6,
  BatchCertificationDate,
  DefinitionOfBatchLevel,
  cast(' ' as subordinate_batch preserving type ) AS IsSubordinateBatch,
  CreationDateTime,
  LastChangeDateTime,
  ClfnObjectInternalID,
  BatchExtWhseMgmtInternalId,
  StockSegment,
  ExportAndImportProductGroup,
  InventoryValuationType,
  P_BatchPlant._Plant AS _Plant,
  R_Batch._Supplier AS _Supplier,
  R_Batch._CountryOfOrigin AS _CountryOfOrigin,
  R_Batch._RegionOfOrigin AS _RegionOfOrigin,
  P_BatchPlant._Product AS _Product,
  R_Batch._ClfnObjectClassForKeyDate AS _ClfnObjectClassForKeyDate,
  R_Batch._ClfnObjectCharcValForKeyDate AS _ClfnObjectCharcValForKeyDate
FROM R_Batch
INNER JOIN R_Batch ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Batch_2 AS _Batch ON Material = _Batch.Material AND BatchIdentifyingPlant = _Batch.BatchIdentifyingPlant AND Batch = _Batch.Batch  -- association [1..1]
-- UNION ALL with additional select branch(es): P_BatchPlant
;