P_Fcdm_Keyf_Read_Custrq_Sls
P_Fcdm_Keyf_Read_Custrq_Sls is a Basic CDS View in SAP S/4HANA. It reads from 3 data sources (vbak, vbap, vbep) and exposes 11 fields with key fields matnr, werks, berid, vbeln, posnr.
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PFKRCS | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #AUTOMATED | view | |
| VDM.private | true | view | |
| VDM.viewType | #BASIC | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view |
@AbapCatalog.sqlViewName: 'PFKRCS'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #AUTOMATED
@VDM.private: true
@VDM.viewType: #BASIC
@ObjectModel.usageType: {serviceQuality: #X, sizeCategory: #XL, dataClass: #TRANSACTIONAL}
define view P_Fcdm_Keyf_Read_Custrq_Sls
as select from vbak as vbak -- order header
inner join vbap as vbap -- order items
on vbak.vbeln = vbap.vbeln
inner join vbep as vbep -- schedule lines
on vbap.vbeln = vbep.vbeln
and vbap.posnr = vbep.posnr
{
key vbap.matnr,
key vbap.werks,
key vbap.werks as berid,
key vbap.vbeln,
key vbep.posnr,
key vbep.etenr,
vbap.lgort,
vbep.wmeng,
case vbap.abgru -- if not cancelled take requested quantity, else the already delivered quantity
when '' then DIVISION( vbep.cmeng -- we do not take directly the requested quantity (WMENG) but rather the rounded quantiy CMENG. it is in sales unit
* vbep.umvkz, vbep.umvkn, 3 ) -- conversion factors
else DIVISION( 0 * vbep.umvkz, vbep.umvkn, 3 ) -- TODO: order cancelled but (partial) quantity already delivered --> take this into account --> new fields TODO
end as quantity, -- converted to base unit
vbep.edatu,
@Semantics.unitOfMeasure: true
vbep.meins, -- the quantity is now in MEINS, not in VRKME
vbep.mbdat as mbdat -- requested date scheduled when the material should be provided
}
where
vbap.werks <> ' '
and vbap.sobkz <> 'W'
and vbap.sobkz <> 'V'
and vbak.vbtyp = 'C' -- only customer orders
and vbep.lfrel = 'X' -- only delivery relevant items
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"VBAK",
"VBAP",
"VBEP"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
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