@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 : 'PCUSTRETPROCF20'
define view P_CustRetProcFlow20
as select from P_CustRetProcFlow10 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 = 'O' --> Credit Memo
or Level2.SubsequentDocumentCategory = 'J' --> Outbound Delivery
or Level2.SubsequentDocumentCategory = 'M' --> Customer Invoice
or Level2.SubsequentDocumentCategory = 'U' --> Pro Forma Invoice
)
left outer to one join I_DeliveryDocument as DeliveryDoc
on Level2.SubsequentDocument = DeliveryDoc.DeliveryDocument
and Level2.SubsequentDocumentCategory = DeliveryDoc.SDDocumentCategory
{
//Key
key cast (Level2.SubsequentDocument as preced_doc) as Level2Document,
key Level2.SubsequentDocumentItem as Level2DocumentItem,
key Level1.Level1Document,
key Level1.Level1DocumentItem,
//Customer Return
Level1.CustomerReturn,
//Category
Level1.CustomerReturnType,
Level2.SubsequentDocumentCategory as Level2DocumentCategory,
Level1.Level1DocumentCategory,
//Organization
Level1.SalesOrganization,
Level1.DistributionChannel,
Level1.OrganizationDivision,
//Relevance for planned subsequent processing
case
when ( DeliveryDoc.OverallDelivReltdBillgStatus = 'A' or
DeliveryDoc.OverallDelivReltdBillgStatus = 'B' )
then
'X'
else
''
end as BillingDocumentIsRequired
}
where Level1.Level1DocumentCategory = 'K' --> Credit Memo Request
or Level1.Level1DocumentCategory = 'I' --> Order w/o charge as Replacement Order
or Level1.Level1DocumentCategory = 'J' --> Outbound Delivery
or Level1.Level1DocumentCategory = 'T' --> Returns Delivery
/* union all select from P_CustRetProcFlow10 as Level1
inner join P_CustRetProcFlow05 as InspectionDoc
on InspectionDoc.CustomerReturn = Level1.CustomerReturn
and InspectionDoc.Level1DocumentItem = Level1.PrecedingDocumentItem
and InspectionDoc.ProductIsInspectedAtCustSite = ''
{
//Key
key cast (InspectionDoc.Level1Document as preced_doc) as Level2Document,
key InspectionDoc.Level1DocumentItem as Level2DocumentItem,
key Level1.Level1Document,
key Level1.Level1DocumentItem,
//Customer Return
Level1.CustomerReturn,
//Category
Level1.CustomerReturnType,
InspectionDoc.Level1DocumentCategory as Level2DocumentCategory,
Level1.Level1DocumentCategory,
//Organization
Level1.SalesOrganization,
Level1.DistributionChannel,
Level1.OrganizationDivision,
//Relevance for planned subsequent processing
'' as BillingDocumentIsRequired
}
where Level1.Level1DocumentCategory = 'T' */
Depth:
1
2
3
4
5
All
Reload