@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":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_DebitMemoReqProcFlow20 view