P_DebitMemoReqProcFlow20

DDL: P_DEBITMEMOREQPROCFLOW20 SQL: PDMRPROCF20 Type: view CONSUMPTION

P_DebitMemoReqProcFlow20 is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (P_DebitMemoReqProcFlow10, I_SDDocumentProcessFlow) and exposes 10 fields with key fields Level1Document, Level1DocumentItem, Level2Document, Level2DocumentItem, DebitMemoRequest.

Data Sources (2)

SourceAliasJoin Type
P_DebitMemoReqProcFlow10 Level1 from
I_SDDocumentProcessFlow Level2 inner

Annotations (9)

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 PDMRPROCF20 view
AbapCatalog.preserveKey true view

Fields (10)

KeyFieldSource TableSource FieldDescription
KEY Level1Document Level1Document
KEY Level1DocumentItem Level1DocumentItem
KEY Level2Document I_SDDocumentProcessFlow SubsequentDocument
KEY Level2DocumentItem I_SDDocumentProcessFlow SubsequentDocumentItem
KEY DebitMemoRequest DebitMemoRequest
DebitMemoRequestType DebitMemoRequestType
Level1DocumentCategory Level1DocumentCategory
SalesOrganization P_DebitMemoReqProcFlow10 SalesOrganization
DistributionChannel P_DebitMemoReqProcFlow10 DistributionChannel
OrganizationDivision P_DebitMemoReqProcFlow10 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: 'PDMRPROCF20'
@AbapCatalog.preserveKey:true 

define view P_DebitMemoReqProcFlow20
 as select from   P_DebitMemoReqProcFlow10   as Level1
 inner join       I_SDDocumentProcessFlow    as Level2
on 
     Level1.Level1Document         = Level2.PrecedingDocument
and  Level1.Level1DocumentCategory = Level2.PrecedingDocumentCategory
and  Level1.Level1DocumentItem     = Level2.PrecedingDocumentItem
and ( Level2.SubsequentDocumentCategory = 'K' or   --> Credit Memo Request  
      Level2.SubsequentDocumentCategory = 'L' or   --> Debit Memo Request  
      Level2.SubsequentDocumentCategory = 'H' or   --> Returns
      Level2.SubsequentDocumentCategory = 'O' or   --> Credit Memo
      Level2.SubsequentDocumentCategory = 'P' )  --> Debit Memo      
      
left outer to one join 
I_SalesDocumentBasic as SalesDocument
  on Level2.SubsequentDocument         = SalesDocument.SalesDocument   
left outer to one join 
I_BillingDocument as BillingDocument
  on Level2.SubsequentDocument         = BillingDocument.BillingDocument              
{
   //Key

   key Level1Document,
   key Level1DocumentItem,
   key Level2.SubsequentDocument     as Level2Document,
   key Level2.SubsequentDocumentItem as Level2DocumentItem,

       
   //SalesOrder

   key DebitMemoRequest,
       DebitMemoRequestType,   
      
   //Category 

   Level1DocumentCategory,
    case 
      when
     ( ( Level2.SubsequentDocumentCategory  = 'K' or   --> Credit Memo Request  
       Level2.SubsequentDocumentCategory  = 'L' ) and    --> Debit Memo Request
       SalesDocument.SDDocumentCategory is not null )   --> not archived 
       then SalesDocument.SDDocumentCategory    --> from header for mixed documents
     when
     ( ( Level2.SubsequentDocumentCategory  = 'O' or   --> Credit Memo  
       Level2.SubsequentDocumentCategory  = 'P' ) and     --> Debit Memo 
       BillingDocument.SDDocumentCategory is not null )   --> not archived
       then BillingDocument.SDDocumentCategory    --> from header for mixed documents       
     else Level2.SubsequentDocumentCategory
    end as   Level2DocumentCategory,

   //Organization

   Level1.SalesOrganization     as SalesOrganization, 
   Level1.DistributionChannel   as DistributionChannel,
   Level1.OrganizationDivision  as OrganizationDivision
       
 }
                                   
  
  
  
  
  
  
  
  
  
  
  
  
 /*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLINGDOCUMENT",
"I_SALESDOCUMENTBASIC",
"I_SDDOCUMENTPROCESSFLOW",
"P_DEBITMEMOREQPROCFLOW10"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/