@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
@VDM.private: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #CONSUMPTION
@AbapCatalog.sqlViewName : 'PBILLGDOCPROCF10'
@AbapCatalog.preserveKey:true
define view P_BillingDocProcFlow10
as select from P_BillingDocProcFlow0 as Level0 --> Level 0
inner join I_SDDocumentProcessFlow as Level1 --> Level 1
on Level0.BillingDocument = Level1.PrecedingDocument
and (
Level1.SubsequentDocumentCategory = 'O' or --> Credit Memo
Level1.SubsequentDocumentCategory = 'P' or --> Debit Memo
Level1.SubsequentDocumentCategory = 'K' or --> Credit Memo Request
Level1.SubsequentDocumentCategory = 'L' or --> Debit Memo Request
Level1.SubsequentDocumentCategory = 'H' or --> Returns
Level1.SubsequentDocumentCategory = '6' or --> Intercompany Credit Memo
Level1.SubsequentDocumentCategory = 'N' or --> Invoice Cancellatiom
Level1.SubsequentDocumentCategory = 'S' --> Credit Memo Cancellation
)
left outer to one join
I_SalesDocumentBasic as SalesDocument
on Level1.SubsequentDocument = SalesDocument.SalesDocument
left outer to one join
I_BillingDocument as BillingDocument
on Level1.SubsequentDocument = BillingDocument.BillingDocument
{
//Key
key Level1.SubsequentDocument as Level1Document,
key Level1.SubsequentDocumentItem as Level1DocumentItem,
key
//Category
case when
( ( Level1.SubsequentDocumentCategory = 'K' or --> Credit Memo Request
Level1.SubsequentDocumentCategory = 'L' ) and --> Debit Memo Request
SalesDocument.SDDocumentCategory is not null ) --> not archived
then SalesDocument.SDDocumentCategory --> from header for mixed documents
when
( ( Level1.SubsequentDocumentCategory = 'O' or --> Credit Memo
Level1.SubsequentDocumentCategory = 'P' ) and --> Debit Memo
BillingDocument.SDDocumentCategory is not null ) --> not archived
then BillingDocument.SDDocumentCategory --> from header for mixed documents
when
( ( (Level0.SDDocumentCategory = 'M' or Level0.SDDocumentCategory = 'P') and --> Level 0 is an Invoice/Debit Memo
Level1.PrecedingDocumentCategory = 'K' and --> Level 1 PrecedingDocument is a Credit Memo Request
Level1.SubsequentDocumentCategory = 'S' ) and --> Level 1 SubsequentDocument is a Credit Memo Cancelation
BillingDocument.SDDocumentCategory is not null ) --> Level 1 Header SDDocumentCategory must not be empty
then BillingDocument.SDDocumentCategory --> Use Level 1 Header SDDocumentCategory for Level 1 Item SDDocumentCategory
when
( ( Level0.SDDocumentCategory = 'O' and --> Level 0 PrecedingDocument is a Credit Memo
Level1.PrecedingDocumentCategory = 'L' and --> Level 1 PrecedingDocument is a Debit Memo Request
Level1.SubsequentDocumentCategory = 'N' ) and --> Level 1 SubsequentDocument is an Invoice Cancelation
BillingDocument.SDDocumentCategory is not null ) --> Level 1 Header SDDocumentCategory must not be empty
then BillingDocument.SDDocumentCategory --> Use Level 1 Header SDDocumentCategory for Level 1 Item SDDocumentCategory
else Level1.SubsequentDocumentCategory
end as Level1DocumentCategory,
Level0.BillingDocument,
Level0.BillingDocumentType,
Level0.SDDocumentCategory,
//Organizatio
Level0.SalesOrganization
}
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_BILLINGDOCUMENT",
"I_SALESDOCUMENTBASIC",
"I_SDDOCUMENTPROCESSFLOW",
"P_BILLINGDOCPROCFLOW0"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_BillingDocProcFlow10 view