P_BatchInfo
P_BatchInfo is a Composite CDS View in SAP S/4HANA. It reads from 4 data sources (mch1, P_MaterialInfo, P_StockBatchInfo, I_Stockcustomising) and exposes 21 fields.
Data Sources (4)
| Source | Alias | Join Type |
|---|---|---|
| mch1 | mch1 | inner |
| P_MaterialInfo | P_MaterialInfo | inner |
| P_StockBatchInfo | stck_btch | from |
| I_Stockcustomising | StockCust | inner |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PBATCHINFO | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #MASTER | view |
Fields (21)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| matnr | P_StockBatchInfo | matnr | ||
| werks | P_StockBatchInfo | werks | ||
| charg_sid | P_StockBatchInfo | charg_sid | ||
| berid | P_StockBatchInfo | berid | ||
| plaab | P_StockBatchInfo | plaab | ||
| planr | P_StockBatchInfo | planr | ||
| sort1 | P_StockBatchInfo | sort1 | ||
| sort2 | P_StockBatchInfo | sort2 | ||
| delkz | P_StockBatchInfo | delkz | ||
| sobkz | P_StockBatchInfo | sobkz | ||
| lifnr | P_StockBatchInfo | lifnr | ||
| kdauf | P_StockBatchInfo | kdauf | ||
| kdpos | P_StockBatchInfo | kdpos | ||
| pspel | P_StockBatchInfo | pspel | ||
| vrfkz | P_StockBatchInfo | vrfkz | ||
| plumi | P_StockBatchInfo | plumi | ||
| mng01 | P_StockBatchInfo | mng01 | ||
| mng01c | P_StockBatchInfo | mng01c | ||
| vfdat | mch1 | vfdat | ||
| verab | mch1 | verab | ||
| fvdt6endasSalvageDate |
@AbapCatalog.sqlViewName: 'PBATCHINFO'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ObjectModel.usageType: {serviceQuality: #D, sizeCategory: #XL, dataClass: #MASTER}
define view P_BatchInfo
as select from P_StockBatchInfo as stck_btch
inner join mch1 as mch1 on stck_btch.matnr = mch1.matnr
and stck_btch.charg_sid = mch1.charg
inner join P_MaterialInfo on stck_btch.matnr = P_MaterialInfo.Material
inner join I_Stockcustomising as StockCust on stck_btch.mandt = StockCust.SAPClient
{
stck_btch.matnr,
stck_btch.werks,
stck_btch.charg_sid,
stck_btch.berid,
stck_btch.plaab,
stck_btch.planr,
stck_btch.sort1,
stck_btch.sort2,
stck_btch.delkz,
stck_btch.sobkz,
stck_btch.lifnr,
stck_btch.kdauf,
stck_btch.kdpos,
stck_btch.pspel,
stck_btch.vrfkz,
stck_btch.plumi,
stck_btch.mng01,
stck_btch.mng01c,
stck_btch.companycodecurrency,
mch1.vfdat,
mch1.verab,
// Salvage field has to come from customizing table
case
when StockCust.SalvageDate = 'FVDT1'
then mch1.fvdt1
when StockCust.SalvageDate = 'FVDT2'
then mch1.fvdt2
when StockCust.SalvageDate = 'FVDT3'
then mch1.fvdt3
when StockCust.SalvageDate = 'FVDT4'
then mch1.fvdt4
when StockCust.SalvageDate = 'FVDT5'
then mch1.fvdt5
when StockCust.SalvageDate = 'FVDT6'
then mch1.fvdt6
end as SalvageDate
}
where
verab > '00000000'
and SalvageDate > '00000000'
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA