P_PurOrdMaintainHeaderDrfCalFs

DDL: P_PURORDMAINTAINHEADERDRFCALFS SQL: PPOMAINTHDRDRFCF Type: view CONSUMPTION

P_PurOrdMaintainHeaderDrfCalFs is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (ekko_po_d) and exposes 3 fields with key field PurchaseOrderHeaderDraftUUID. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
ekko_po_d header from

Associations (1)

CardinalityTargetAliasCondition
[1..*] ekpo_po_d item header.db_key = item.parent_key

Annotations (4)

NameValueLevelField
VDM.viewType #CONSUMPTION view
VDM.private true view
AbapCatalog.sqlViewName PPOMAINTHDRDRFCF view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view

Fields (3)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrderHeaderDraftUUID ekko_po_d guid
netwrendasNetValue
NumberOfItems
// =========================================================================

//   PO Maintenance: Calculated fields of Draft PO Header 

// =========================================================================


@VDM.viewType: #CONSUMPTION
@VDM.private: true
@AbapCatalog.sqlViewName: 'PPOMAINTHDRDRFCF'
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY

define view P_PurOrdMaintainHeaderDrfCalFs
  as select from ekko_po_d          as header
  association [1..*] to ekpo_po_d   as item       on header.db_key = item.parent_key

{
  key header.guid                   as PurchaseOrderHeaderDraftUUID,

      sum( case item.loekz 
           when 'L' then 0 
           when 'X' then 0
           when 'S' then 0
                     else item.netwr
           end )                    as NetValue,

    count( distinct item.ebelp )    as NumberOfItems  //TO CLARIFY: Do we have to exclude deleted/statistical/return items???

}        
group by header.guid  
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"EKKO_PO_D",
"EKPO_PO_D"
],
"ASSOCIATED":
[
"EKPO_PO_D"
],
"BASE":
[],
"VERSION":0
}
}*/