P_Fcdm_Keyf_Read_Custrq_Sls

DDL: P_FCDM_KEYF_READ_CUSTRQ_SLS SQL: PFKRCS Type: view BASIC

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.

Data Sources (3)

SourceAliasJoin Type
vbak vbak from
vbap vbap inner
vbep vbep inner

Annotations (8)

NameValueLevelField
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

Fields (11)

KeyFieldSource TableSource FieldDescription
KEY matnr vbap matnr
KEY werks vbap werks
KEY berid vbap werks
KEY vbeln vbap vbeln
KEY posnr vbep posnr
KEY etenr vbep etenr
lgort vbap lgort
wmeng vbep wmeng
edatu
meins vbep meins
thequantityisnowinMEINS
@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":""
}
}*/