@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 : 'PBILLGDOCPROCFM3'
@AbapCatalog.preserveKey:true
define view P_BillingDocProcFlowM3
as select distinct from P_BillingDocProcFlowM2 as LevelM2 --> Level -2
inner join I_SDDocumentProcessFlow as LevelM3 --> Level Minus3
on LevelM3.SubsequentDocument = LevelM2.LevelM2Document
and LevelM3.SubsequentDocumentItem = LevelM2.LevelM2DocumentItem
and ( LevelM3.PrecedingDocumentCategory = 'C' --> Order
or LevelM3.PrecedingDocumentCategory = 'M' --> Invoice
)
left outer to one join
I_SalesDocumentBasic as SalesDocument
on LevelM3.PrecedingDocument = SalesDocument.SalesDocument
{
//Key
key PrecedingDocument as LevelM3Document,
key PrecedingDocumentItem as LevelM3DocumentItem,
key case
when PrecedingDocumentCategory = 'M'
then 'MREF' --> allow assignmet to 'Reference' lane
else
PrecedingDocumentCategory
end as LevelM3DocumentCategory,
key LevelM2Document,
key LevelM2DocumentItem,
key LevelM2DocumentCategory,
//Billing Document
key BillingDocument,
BillingDocumentType,
//Order relevant for Project e.g Professional Service
case when
(
SalesDocument._SalesDocumentType.OrderTypeForBillingRequest != ' ' or
SalesDocument._SalesDocumentType.SalesDocumentProcessingType = 'P' --> Professional Service
)
then
'X'
else
''
end as SalesOrderIsProjectBased,
//Organization
LevelM2.SalesOrganization
}
where LevelM2DocumentCategory = 'H' --> Returns
or LevelM2DocumentCategory = 'J' --> Delivery
or LevelM2DocumentCategory = 'K' ---> Credit Memo Request
or LevelM2DocumentCategory = 'L' ---> Debit Memo Request
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_SALESDOCUMENTBASIC",
"I_SALESDOCUMENTTYPE",
"I_SDDOCUMENTPROCESSFLOW",
"P_BILLINGDOCPROCFLOWM2"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_BillingDocProcFlowM3 view