P_CustRetProcFlow31

DDL: P_CUSTRETPROCFLOW31 SQL: PCUSTRETPROCF31 Type: view CONSUMPTION

P_CustRetProcFlow31 is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_AccountingDocument) and exposes 10 fields with key fields Level2Document, AccountingDocument, CustomerReturn.

Data Sources (1)

SourceAliasJoin Type
I_AccountingDocument AccountingDoc 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 PCUSTRETPROCF31 view

Fields (10)

KeyFieldSource TableSource FieldDescription
KEY Level2Document Level2 Level2Document
KEY AccountingDocument I_AccountingDocument AccountingDocument
KEY CustomerReturn Level2 CustomerReturn
CompanyCode I_AccountingDocument CompanyCode
FiscalYear I_AccountingDocument FiscalYear
CustomerReturnType Level2 CustomerReturnType
Level2DocumentCategory Level2 Level2DocumentCategory
SalesOrganization Level2 SalesOrganization
DistributionChannel Level2 DistributionChannel
OrganizationDivision Level2 OrganizationDivision
@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: 'PCUSTRETPROCF31'

define view P_CustRetProcFlow31
as select distinct from P_CustRetProcFlow20 as Level2
  
inner join I_AccountingDocument             as AccountingDoc
  on Level2.Level2Document               = AccountingDoc.OriginalReferenceDocument
 and AccountingDoc.ReferenceDocumentType = 'VBRK'    
 and AccountingDoc.LedgerGroup           = ''
 
{
    //Key

    key Level2.Level2Document,
    key AccountingDoc.AccountingDocument,
    
    //Customer Return

    key Level2.CustomerReturn,
      
    //Accounting additional keys

    AccountingDoc.CompanyCode,
    AccountingDoc.FiscalYear,    
   
    //Category

    Level2.CustomerReturnType,
    Level2.Level2DocumentCategory,
    
    //Organization

    Level2.SalesOrganization,
    Level2.DistributionChannel,
    Level2.OrganizationDivision
}
where Level2.Level2DocumentCategory = 'M'  --> Customer Invoice  
   or Level2.Level2DocumentCategory = 'O'  --> Credit Memo 
   or Level2.Level2DocumentCategory = 'P'  --> Debit Memo