P_SlsQtanProcFlow20

DDL: P_SLSQTANPROCFLOW20 SQL: PSLSQTANPROCF20 Type: view CONSUMPTION Package: ODATA_SD_QUT_PROCESSFLOW

Sales Quotation Process Flow: Level +2 Sales & Distribution

P_SlsQtanProcFlow20 is a Consumption CDS View that provides data about "Sales Quotation Process Flow: Level +2 Sales & Distribution" in SAP S/4HANA. It reads from 2 data sources (P_SlsQtanProcFlow10, I_SDDocumentProcessFlow) and exposes 12 fields with key fields Level1Document, Level1DocumentItem, Level2Document, Level2DocumentItem, SalesQuotation. Part of development package ODATA_SD_QUT_PROCESSFLOW.

Data Sources (2)

SourceAliasJoin Type
P_SlsQtanProcFlow10 Level1 from
I_SDDocumentProcessFlow Level2 inner

Annotations (8)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
VDM.private true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #CONSUMPTION view
AbapCatalog.sqlViewName PSLSQTANPROCF20 view

Fields (12)

KeyFieldSource TableSource FieldDescription
KEY Level1Document P_SlsQtanProcFlow10 Level1Document
KEY Level1DocumentItem P_SlsQtanProcFlow10 Level1DocumentItem
KEY Level2Document I_SDDocumentProcessFlow SubsequentDocument
KEY Level2DocumentItem I_SDDocumentProcessFlow SubsequentDocumentItem
KEY SalesQuotation P_SlsQtanProcFlow10 SalesQuotation
SalesQuotationType P_SlsQtanProcFlow10 SalesQuotationType
Level1DocumentCategory P_SlsQtanProcFlow10 Level1DocumentCategory
Level2DocumentCategory I_SDDocumentProcessFlow SubsequentDocumentCategory
SalesOrganization P_SlsQtanProcFlow10 SalesOrganization
DistributionChannel P_SlsQtanProcFlow10 DistributionChannel
OrganizationDivision P_SlsQtanProcFlow10 OrganizationDivision
DeliveryDocumentIsRequired
@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: 'PSLSQTANPROCF20'
define view P_SlsQtanProcFlow20
  as select from P_SlsQtanProcFlow10                     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 = 'J' or  --> Delivery
          Level2.SubsequentDocumentCategory = 'M' or  --> Invoice
          Level2.SubsequentDocumentCategory = 'U'     --> Pro Forma Invoice
        )

    left outer to one join I_SalesDocumentBasic          as SalesDocument
      on Level2.SubsequentDocument = SalesDocument.SalesDocument


    left outer to one join I_DeliveryDocument            as DeliveryDocument
      on Level2.SubsequentDocument            = DeliveryDocument.DeliveryDocument
        and Level2.SubsequentDocumentCategory = DeliveryDocument.SDDocumentCategory

{
  
      //Key

  key Level1.Level1Document                              as Level1Document,
  key Level1.Level1DocumentItem                          as Level1DocumentItem,
  key Level2.SubsequentDocument                          as Level2Document,
  key Level2.SubsequentDocumentItem                      as Level2DocumentItem,
      
      //SalesQuotation

  key Level1.SalesQuotation,
      Level1.SalesQuotationType,
          
      //Category

      Level1.Level1DocumentCategory                      as Level1DocumentCategory,
      Level2.SubsequentDocumentCategory                  as Level2DocumentCategory,
        
       
      //Organization

      Level1.SalesOrganization,
      Level1.DistributionChannel,
      Level1.OrganizationDivision,
       
       
      //Status

      ''                                                 as DeliveryDocumentIsRequired,
  
      case when
        (
          ( DeliveryDocument.OverallDelivReltdBillgStatus = 'A' or
            DeliveryDocument.OverallDelivReltdBillgStatus = 'B' )
            or
          ( SalesDocument.OverallOrdReltdBillgStatus = 'A' or
            SalesDocument.OverallOrdReltdBillgStatus = 'B' )
        )
      then
        'X'
      else
        ''
      end                                                as BillingDocumentIsRequired
     
}  
where Level1.Level1DocumentCategory = 'C' --> Order
   or Level1.Level1DocumentCategory = 'I' --> Order w/o charge