I_BatchVH

DDL: I_BATCHVH SQL: IBATCHVH Type: view COMPOSITE

Batch

I_BatchVH is a Composite CDS View that provides data about "Batch" in SAP S/4HANA. It reads from 9 data sources and exposes 90 fields with key fields Material, Batch, Material, Batch, Material. It has 4 associations to related views.

Data Sources (9)

SourceAliasJoin Type
I_BatchConfiguration I_BatchConfiguration inner
I_BatchConfiguration I_BatchConfiguration inner
I_BatchConfiguration I_BatchConfiguration inner
I_BatchCrossPlant I_BatchCrossPlant from
I_BatchCrossPlant I_BatchCrossPlant left_outer
I_BatchPlant I_BatchPlant union_all
I_BatchPlant I_BatchPlant union_all
I_MaterialPlant I_MaterialPlant inner
I_MaterialPlant I_MaterialPlant inner

Associations (4)

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

Annotations (16)

NameValueLevelField
AbapCatalog.sqlViewName IBATCHVH view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Batch view
AccessControl.authorizationCheck #CHECK view
ObjectModel.dataCategory #VALUE_HELP 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
Search.searchable true view
Consumption.ranked true view
VDM.private false view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view

Fields (90)

KeyFieldSource TableSource FieldDescription
KEY Material Material
KEY Batch Batch
BatchIsMarkedForDeletion BatchIsMarkedForDeletion
MatlBatchIsInRstrcdUseStock MatlBatchIsInRstrcdUseStock
Supplier Supplier
BatchBySupplier BatchBySupplier
CountryOfOrigin CountryOfOrigin
RegionOfOrigin RegionOfOrigin
MatlBatchAvailabilityDate MatlBatchAvailabilityDate
ShelfLifeExpirationDate ShelfLifeExpirationDate
ManufactureDate ManufactureDate
FreeDefinedDate1 FreeDefinedDate1
FreeDefinedDate2 FreeDefinedDate2
FreeDefinedDate3 FreeDefinedDate3
FreeDefinedDate4 FreeDefinedDate4
FreeDefinedDate5 FreeDefinedDate5
FreeDefinedDate6 FreeDefinedDate6
DefinitionOfBatchLevel DefinitionOfBatchLevel
CreationDateTime CreationDateTime
LastChangeDateTime LastChangeDateTime
ClfnObjectInternalID ClfnObjectInternalID
BatchExtWhseMgmtInternalId BatchExtWhseMgmtInternalId
_Plant _Plant
_Material _Material
_Supplier _Supplier
_CountryOfOrigin _CountryOfOrigin
_RegionOfOrigin _RegionOfOrigin
_Product _Product
_ClfnObjectClassForKeyDate _ClfnObjectClassForKeyDate
Plant
KEY Material I_BatchPlant Material
KEY Batch Batch
BatchIsMarkedForDeletion BatchIsMarkedForDeletion
MatlBatchIsInRstrcdUseStock MatlBatchIsInRstrcdUseStock
Supplier Supplier
BatchBySupplier BatchBySupplier
CountryOfOrigin I_BatchPlant CountryOfOrigin
RegionOfOrigin I_BatchPlant RegionOfOrigin
MatlBatchAvailabilityDate MatlBatchAvailabilityDate
ShelfLifeExpirationDate ShelfLifeExpirationDate
ManufactureDate ManufactureDate
FreeDefinedDate1 FreeDefinedDate1
FreeDefinedDate2 FreeDefinedDate2
FreeDefinedDate3 FreeDefinedDate3
FreeDefinedDate4 FreeDefinedDate4
FreeDefinedDate5 FreeDefinedDate5
FreeDefinedDate6 FreeDefinedDate6
DefinitionOfBatchLevel DefinitionOfBatchLevel
CreationDateTime CreationDateTime
LastChangeDateTime LastChangeDateTime
ClfnObjectInternalID ClfnObjectInternalID
BatchExtWhseMgmtInternalId BatchExtWhseMgmtInternalId
_Plant I_BatchPlant _Plant
_Material I_BatchPlant _Material
_Supplier _Supplier
_CountryOfOrigin _CountryOfOrigin
_RegionOfOrigin _RegionOfOrigin
_Product _Product
_ClfnObjectClassForKeyDate _ClfnObjectClassForKeyDate
Plant
KEY Material I_BatchPlant Material
KEY Batch I_BatchPlant Batch
BatchIsMarkedForDeletion I_BatchCrossPlant BatchIsMarkedForDeletion
MatlBatchIsInRstrcdUseStock I_BatchCrossPlant MatlBatchIsInRstrcdUseStock
Supplier I_BatchCrossPlant Supplier
BatchBySupplier I_BatchCrossPlant BatchBySupplier
CountryOfOrigin I_BatchCrossPlant CountryOfOrigin
RegionOfOrigin I_BatchCrossPlant RegionOfOrigin
MatlBatchAvailabilityDate I_BatchCrossPlant MatlBatchAvailabilityDate
ShelfLifeExpirationDate I_BatchCrossPlant ShelfLifeExpirationDate
ManufactureDate I_BatchCrossPlant ManufactureDate
FreeDefinedDate1 I_BatchCrossPlant FreeDefinedDate1
FreeDefinedDate2 I_BatchCrossPlant FreeDefinedDate2
FreeDefinedDate3 I_BatchCrossPlant FreeDefinedDate3
FreeDefinedDate4 I_BatchCrossPlant FreeDefinedDate4
FreeDefinedDate5 I_BatchCrossPlant FreeDefinedDate5
FreeDefinedDate6 I_BatchCrossPlant FreeDefinedDate6
DefinitionOfBatchLevel
CreationDateTime I_BatchPlant CreationDateTime
LastChangeDateTime I_BatchPlant LastChangeDateTime
ClfnObjectInternalID I_BatchCrossPlant ClfnObjectInternalID
BatchExtWhseMgmtInternalId I_BatchPlant BatchExtWhseMgmtInternalId
_Plant I_BatchPlant _Plant
_Material I_BatchPlant _Material
_Supplier I_BatchCrossPlant _Supplier
_CountryOfOrigin I_BatchCrossPlant _CountryOfOrigin
_RegionOfOrigin I_BatchCrossPlant _RegionOfOrigin
_Product _Product
_ClfnObjectClassForKeyDate _ClfnObjectClassForKeyDate
_ClfnObjectCharcValForKeyDate _ClfnObjectCharcValForKeyDate
@AbapCatalog.sqlViewName: 'IBATCHVH'
@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Batch'
@AccessControl.authorizationCheck: #CHECK

@ObjectModel.dataCategory: #VALUE_HELP
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.dataClass:#MASTER
@ObjectModel.representativeKey: 'Batch'
@ClientHandling.algorithm: #SESSION_VARIABLE

@Search.searchable: true
@Consumption.ranked: true

@VDM.private: false
@VDM.viewType: #COMPOSITE
@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API

define view I_BatchVH as select from I_BatchCrossPlant 
inner join I_BatchConfiguration on DefinitionOfBatchLevel <> '0'
association [0..1] to I_Plant                     as _Plant                         on  $projection.Plant    = _Plant.Plant
association [1..1] to I_Product                   as _Product                       on  $projection.Material = _Product.Product
association [0..1] to I_ClfnObjectClassForKeyDate as _ClfnObjectClassForKeyDate     on  $projection.ClfnObjectInternalID = _ClfnObjectClassForKeyDate.ClfnObjectInternalID
association [0..*] to I_ClfnObjectCharcValForKeyDate as _ClfnObjectCharcValForKeyDate on  $projection.ClfnObjectInternalID = _ClfnObjectCharcValForKeyDate.ClfnObjectInternalID
{
  @ObjectModel.foreignKey.association: '_Plant'
  --cannot be added to search (BC_CDSSRCH/021)
  --reason: defaulting by empty literal (in case of MCH1)
  --@Search.defaultSearchElement: true
  --@Search.fuzzinessThreshold: 0.8
  --@Search.ranking: #LOW
  key cast('    ' as werks_d preserving type) as Plant,
  @ObjectModel.foreignKey.association: '_Product'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  key Material,
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #HIGH
  key Batch,
  
  BatchIsMarkedForDeletion,

  MatlBatchIsInRstrcdUseStock,
  @ObjectModel.foreignKey.association: '_Supplier'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  Supplier,
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  BatchBySupplier,
  @ObjectModel.foreignKey.association: '_CountryOfOrigin'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  CountryOfOrigin,
  @ObjectModel.foreignKey.association: '_RegionOfOrigin'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  RegionOfOrigin,
  
  MatlBatchAvailabilityDate,
  ShelfLifeExpirationDate,
  ManufactureDate,
  FreeDefinedDate1,
  FreeDefinedDate2,
  FreeDefinedDate3,
  FreeDefinedDate4,
  FreeDefinedDate5,
  FreeDefinedDate6,
  DefinitionOfBatchLevel,
  
  @Semantics.systemDateTime.createdAt: true
  CreationDateTime,
  @Semantics.systemDateTime.lastChangedAt: true
  LastChangeDateTime,
  
  ClfnObjectInternalID,
  BatchExtWhseMgmtInternalId,
  
  _Plant,
  _Material,
  _Supplier,
  _CountryOfOrigin,
  _RegionOfOrigin,
  _Product,
  _ClfnObjectClassForKeyDate,
  _ClfnObjectCharcValForKeyDate
}

union all
// Perform an inner join with I_BatchConfiguration to ensure that data is only returned of the customer

// has customized the batch configuration to not use I_BatchCrossPlant. (Only possible in OnPremise)

select from I_BatchPlant 
  inner join I_BatchConfiguration on DefinitionOfBatchLevel = '0'
  inner join I_MaterialPlant on I_BatchPlant.Plant = I_MaterialPlant.Plant
                           and I_BatchPlant.Material = I_MaterialPlant.Material
association [1..1] to I_Product                   as _Product                       on  $projection.Material = _Product.Product
association [0..1] to I_ClfnObjectClassForKeyDate as _ClfnObjectClassForKeyDate     on  $projection.ClfnObjectInternalID = _ClfnObjectClassForKeyDate.ClfnObjectInternalID
association [0..*] to I_ClfnObjectCharcValForKeyDate as _ClfnObjectCharcValForKeyDate on  $projection.ClfnObjectInternalID = _ClfnObjectCharcValForKeyDate.ClfnObjectInternalID
{
  @ObjectModel.foreignKey.association: '_Plant'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  key I_BatchPlant.Plant,
  @ObjectModel.foreignKey.association: '_Product'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  key I_BatchPlant.Material,
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #HIGH
  key Batch,
  
  BatchIsMarkedForDeletion,

  MatlBatchIsInRstrcdUseStock,
  @ObjectModel.foreignKey.association: '_Supplier'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  Supplier,
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  BatchBySupplier,
  @ObjectModel.foreignKey.association: '_CountryOfOrigin'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  I_BatchPlant.CountryOfOrigin,
  @ObjectModel.foreignKey.association: '_RegionOfOrigin'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  I_BatchPlant.RegionOfOrigin,
  
  MatlBatchAvailabilityDate,
  ShelfLifeExpirationDate,
  ManufactureDate,
  FreeDefinedDate1,
  FreeDefinedDate2,
  FreeDefinedDate3,
  FreeDefinedDate4,
  FreeDefinedDate5,
  FreeDefinedDate6,
  DefinitionOfBatchLevel,
  
  @Semantics.systemDateTime.createdAt: true
  CreationDateTime,
  @Semantics.systemDateTime.lastChangedAt: true
  LastChangeDateTime,
  
  ClfnObjectInternalID,
  BatchExtWhseMgmtInternalId,
  
  I_BatchPlant._Plant,
  I_BatchPlant._Material,
  _Supplier,
  _CountryOfOrigin,
  _RegionOfOrigin,
  _Product,
  _ClfnObjectClassForKeyDate,
  _ClfnObjectCharcValForKeyDate
}

union all
// Finally consider the case that a customer has cross-plant batches but uses the value help and searches by

// plant. In this case, both tables are filled but the main attributes are on I_BatchCrossPlant. 

// This will lead to additional entries to the first read from I_BatchCrossPlant having the Plant as part of

// the key. It will not lead to additional entries if the batch is not cross-plant as I_BatchCrossPlant would

// be empty in that case and thus the result of the inner join.

select from I_BatchPlant
  inner join I_BatchConfiguration on DefinitionOfBatchLevel <> '0'
  inner join I_MaterialPlant on I_BatchPlant.Plant = I_MaterialPlant.Plant
                            and I_BatchPlant.Material = I_MaterialPlant.Material
  left outer join I_BatchCrossPlant on I_BatchPlant.Material = I_BatchCrossPlant.Material and
                                       I_BatchPlant.Batch = I_BatchCrossPlant.Batch         
association [1..1] to I_Product                   as _Product                       on  $projection.Material = _Product.Product
association [0..1] to I_ClfnObjectClassForKeyDate as _ClfnObjectClassForKeyDate     on  $projection.ClfnObjectInternalID = _ClfnObjectClassForKeyDate.ClfnObjectInternalID
association [0..*] to I_ClfnObjectCharcValForKeyDate as _ClfnObjectCharcValForKeyDate on  $projection.ClfnObjectInternalID = _ClfnObjectCharcValForKeyDate.ClfnObjectInternalID
{
  @ObjectModel.foreignKey.association: '_Plant'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  key I_BatchPlant.Plant,
  @ObjectModel.foreignKey.association: '_Material'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  key I_BatchPlant.Material,
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #HIGH
  key I_BatchPlant.Batch,
  
  I_BatchCrossPlant.BatchIsMarkedForDeletion,

  I_BatchCrossPlant.MatlBatchIsInRstrcdUseStock,
  @ObjectModel.foreignKey.association: '_Supplier'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  I_BatchCrossPlant.Supplier,
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  I_BatchCrossPlant.BatchBySupplier,
  @ObjectModel.foreignKey.association: '_CountryOfOrigin'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  I_BatchCrossPlant.CountryOfOrigin,
  @ObjectModel.foreignKey.association: '_RegionOfOrigin'
  @Search.defaultSearchElement: true
  @Search.fuzzinessThreshold: 0.8
  @Search.ranking: #LOW
  I_BatchCrossPlant.RegionOfOrigin,
  
  I_BatchCrossPlant.MatlBatchAvailabilityDate,
  I_BatchCrossPlant.ShelfLifeExpirationDate,
  I_BatchCrossPlant.ManufactureDate,
  I_BatchCrossPlant.FreeDefinedDate1,
  I_BatchCrossPlant.FreeDefinedDate2,
  I_BatchCrossPlant.FreeDefinedDate3,
  I_BatchCrossPlant.FreeDefinedDate4,
  I_BatchCrossPlant.FreeDefinedDate5,
  I_BatchCrossPlant.FreeDefinedDate6,
  cast('1' as kzdch) as DefinitionOfBatchLevel,
  
  @Semantics.systemDateTime.createdAt: true
  I_BatchPlant.CreationDateTime,
  @Semantics.systemDateTime.lastChangedAt: true
  I_BatchPlant.LastChangeDateTime,
  
  I_BatchCrossPlant.ClfnObjectInternalID,
  I_BatchPlant.BatchExtWhseMgmtInternalId,
  
  I_BatchPlant._Plant,
  I_BatchPlant._Material,
  I_BatchCrossPlant._Supplier,
  I_BatchCrossPlant._CountryOfOrigin,
  I_BatchCrossPlant._RegionOfOrigin,
  _Product,
  _ClfnObjectClassForKeyDate,
  _ClfnObjectCharcValForKeyDate
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BATCHCONFIGURATION",
"I_BATCHCROSSPLANT",
"I_BATCHPLANT",
"I_MATERIALPLANT"
],
"ASSOCIATED":
[
"I_CLFNOBJECTCHARCVALFORKEYDATE",
"I_CLFNOBJECTCLASSFORKEYDATE",
"I_COUNTRY",
"I_MATERIAL",
"I_PLANT",
"I_PRODUCT",
"I_REGION",
"I_SUPPLIER"
],
"BASE":
[
"I_BATCHCROSSPLANT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/