P_SLSQTANPROCFLOW20

CDS View

P_SLSQTANPROCFLOW20 is a CDS View in S/4HANA. It contains 8 fields. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
P_SlsQtanProcFlow30 view from CONSUMPTION

Fields (8)

KeyField CDS FieldsUsed in Views
KEY Level2Document Level2Document 1
KEY Level2DocumentItem Level2DocumentItem 1
KEY SalesQuotation SalesQuotation 1
DistributionChannel DistributionChannel 1
Level2DocumentCategory Level2DocumentCategory 1
OrganizationDivision OrganizationDivision 1
SalesOrganization SalesOrganization 1
SalesQuotationType SalesQuotationType 1
@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