P_SLSORDPROCFLOW10
Sales Order Process Flow: Level +1 Sales & Distribution
P_SLSORDPROCFLOW10 is a CDS View in S/4HANA. Sales Order Process Flow: Level +1 Sales & Distribution. It contains 9 fields. 2 CDS views read from this table.
CDS Views using this table (2)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| P_SlsOrdProcFlow20 | view | from | CONSUMPTION | Sales Order Process Flow: Level +2 Sales & Distribution |
| P_SlsOrdProcFlow24 | view | from | CONSUMPTION | Sales Order Process Flow: Level +2 Intercompany Sales Order |
Fields (9)
| Key | Field | CDS Fields | Used in Views |
|---|---|---|---|
| KEY | Level1Document | Level1Document | 1 |
| KEY | Level1DocumentItem | Level1DocumentItem | 1 |
| KEY | SalesOrder | SalesOrder | 1 |
| DistributionChannel | DistributionChannel | 2 | |
| Level1DocumentCategory | Level1DocumentCategory | 1 | |
| OrganizationDivision | OrganizationDivision | 2 | |
| SalesOrderIsProjectBased | SalesOrderIsProjectBased | 1 | |
| SalesOrderType | SalesOrderType | 1 | |
| SalesOrganization | SalesOrganization | 2 |
@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: 'PSLSORDPROCF10'
@AbapCatalog.preserveKey:true
define view P_SlsOrdProcFlow10
as select from P_SlsOrdProcFlow0 as Level0 --> Level 0
inner join I_SDDocumentProcessFlow as Level1 --> Level 1
on Level0.SalesOrder = Level1.PrecedingDocument
and (
Level1.SubsequentDocumentCategory = 'J' or --> Delivery
Level1.SubsequentDocumentCategory = 'T' or --> Returns Delivery
Level1.SubsequentDocumentCategory = 'M' or --> Invoice
Level1.SubsequentDocumentCategory = 'U' or --> Pro Forma Invoice
Level1.SubsequentDocumentCategory = 'O' or --> Credit Memo
Level1.SubsequentDocumentCategory = 'P' or --> Debit Memo
Level1.SubsequentDocumentCategory = 'C' or --> Order
Level1.SubsequentDocumentCategory = 'I' or --> Order w/o charge
Level1.SubsequentDocumentCategory = 'K' or --> Credit Memo Request
Level1.SubsequentDocumentCategory = 'L' or --> Debit Memo Request
Level1.SubsequentDocumentCategory = '5' or --> Intercompany Invoice
Level1.SubsequentDocumentCategory = '6' or --> Intercompany Credit Memo
Level1.SubsequentDocumentCategory = 'H' or --> Customer Return
Level1.SubsequentDocumentCategory = 'V' or --> Purchase Order
Level1.SubsequentDocumentCategory = 'PBRQ' or --> Project Billing Request
Level1.SubsequentDocumentCategory = 'DPRQ' --> Advanced Down Payment Request
)
left outer to one join
I_DeliveryDocument as DeliveryDocument
on
Level1.SubsequentDocument = DeliveryDocument.DeliveryDocument
and Level1.SubsequentDocumentCategory = DeliveryDocument.SDDocumentCategory
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
left outer to one join
P_SlsOrdProcFlowPrjBlgReq as ProjBillgReq
on Level1.SubsequentDocument = ProjBillgReq.ProjectBillingRequest
{
//Key
key Level1.SubsequentDocument as Level1Document,
key Level1.SubsequentDocumentItem as Level1DocumentItem,
//Category //
key 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
else Level1.SubsequentDocumentCategory
end as Level1DocumentCategory,
//SalesOrder
SalesOrder,
SalesOrderType,
SalesOrderCategory,
//Order relevant for Project e.g Professional Service
SalesOrderIsProjectBased,
//Organization
Level0.SalesOrganization,
Level0.DistributionChannel,
Level0.OrganizationDivision,
//Status
case when
(
( DeliveryDocument.OverallDelivReltdBillgStatus = 'A' or
DeliveryDocument.OverallDelivReltdBillgStatus = 'B' )
or
//Planned document for Professional Service Scernario
( Level0.SalesOrderIsProjectBased = 'X' and
SalesDocument.SDDocumentCategory = 'L' and ---> Debit Memo Request
(SalesDocument.OverallOrdReltdBillgStatus = 'A' or
SalesDocument.OverallOrdReltdBillgStatus = 'B' ) )
)
then
'X'
else
''
end as BillingDocumentIsRequired
}
where (Level0.SalesOrderCategory = 'C' --> Order
or Level0.SalesOrderCategory = 'I' ) --> Order w/o charge
and (ProjBillgReq.ProjBillgReqCreatedAtDte is null or ProjBillgReq.ProjBillgReqCreatedAtDte > ProjBillgReq.ValidOnDate)
union all select distinct from P_SlsOrdProcFlow12 //Level1 Purchase Order from EKKN
{
//Key
key PurchaseOrder as Level1Document,
key '000000' as Level1DocumentItem,
key 'V' as Level1DocumentCategory,
//SalesOrder
SalesOrder,
SalesOrderType,
SalesOrderCategory,
//Order relevant for Project e.g Professional Service
'' as SalesOrderIsProjectBased,
//Organization
SalesOrganization,
DistributionChannel,
OrganizationDivision,
'' as BillingDocumentIsRequired
}