P_BillingDocProcFlowCP0

DDL: P_BILLINGDOCPROCFLOWCP0 SQL: PBILLGDOPROCFCP0 Type: view CONSUMPTION

P_BillingDocProcFlowCP0 is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_BillingDocumentItem) and exposes 6 fields with key fields LevelM1Document, LevelM1DocumentItem, LevelM1DocumentCategory, BillingDocument.

Data Sources (1)

SourceAliasJoin Type
I_BillingDocumentItem LevelCM1 inner

Annotations (8)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
VDM.private true view
VDM.viewType #CONSUMPTION view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.sqlViewName PBILLGDOPROCFCP0 view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY LevelM1Document LevelC0 LevelM1Document
KEY LevelM1DocumentItem LevelC0 LevelM1DocumentItem
KEY LevelM1DocumentCategory LevelC0 LevelM1DocumentCategory
KEY BillingDocument LevelC0 BillingDocument
BillingDocumentType LevelC0 BillingDocumentType
SalesOrganization LevelC0 SalesOrganization
@ClientHandling.algorithm: #SESSION_VARIABLE 
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL

@VDM.private: true
@VDM.viewType: #CONSUMPTION
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AbapCatalog.sqlViewName: 'PBILLGDOPROCFCP0'
define view P_BillingDocProcFlowCP0 
  as select distinct from P_BillingDocProcFlowC0 as LevelC0  --> Level 0 
    inner join            I_BillingDocumentItem as LevelCM1 --> Level Minus 1 (Check for Preliminary Billing Documents)
    on  LevelC0.LevelC0Document             = LevelCM1.BillingDocument
    and LevelC0.LevelC0DocumentItem         = LevelCM1.BillingDocumentItem
    and LevelC0.LevelM1DocumentCategory     != 'PBD' // exclude manual items     

{
      //Key

  key LevelC0.LevelM1Document,  
  key LevelC0.LevelM1DocumentItem,      
  key LevelC0.LevelM1DocumentCategory,   
  key case 
    when LevelCM1.PrelimBillingDocument is initial
      then LevelC0.LevelC0Document
    else
      LevelCM1.PrelimBillingDocument
    end as LevelC0Document,

  key case 
    when LevelCM1.PrelimBillingDocument is initial
      then LevelC0.LevelC0DocumentItem
    else
      LevelCM1.PrelimBillingDocumentItem
    end as LevelC0DocumentItem,

  key case 
    when LevelCM1.PrelimBillingDocument is initial
      then LevelC0.LevelC0DocumentCategory
    else
      'PBD'
    end as LevelC0DocumentCategory,

      //Billing Document

  key LevelC0.BillingDocument,  
      LevelC0.BillingDocumentType,

      //Organization

      LevelC0.SalesOrganization
}