P_SOFAProcFlow20

DDL: P_SOFAPROCFLOW20 SQL: PSOFAPROCF20 Type: view COMPOSITE Package: ODATA_SD_SOFA

SOFA Process Flow:: Level +2 Sales & Distribution

P_SOFAProcFlow20 is a Composite CDS View that provides data about "SOFA Process Flow:: Level +2 Sales & Distribution" in SAP S/4HANA. It reads from 2 data sources (P_SOFAProcFlow10, I_SDDocumentProcessFlow) and exposes 22 fields with key fields SalesDocument, SDDocumentCategory, Level1Document, Level1DocumentItem, Level1DocumentCategory. Part of development package ODATA_SD_SOFA.

Data Sources (2)

SourceAliasJoin Type
P_SOFAProcFlow10 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 #COMPOSITE view
AbapCatalog.sqlViewName PSOFAPROCF20 view

Fields (22)

KeyFieldSource TableSource FieldDescription
KEY SalesDocument SalesDocument
KEY SDDocumentCategory P_SOFAProcFlow10 SDDocumentCategory
KEY Level1Document Level1Document
KEY Level1DocumentItem Level1DocumentItem
KEY Level1DocumentCategory Level1DocumentCategory
KEY Level2Document I_SDDocumentProcessFlow SubsequentDocument
KEY Level2DocumentItem I_SDDocumentProcessFlow SubsequentDocumentItem
KEY Level2DocumentCategory I_SDDocumentProcessFlow SubsequentDocumentCategory
SalesDocumentType P_SOFAProcFlow10 SalesDocumentType
SalesOrganization P_SOFAProcFlow10 SalesOrganization
DistributionChannel P_SOFAProcFlow10 DistributionChannel
OrganizationDivision P_SOFAProcFlow10 OrganizationDivision
OverallSDProcessStatus P_SOFAProcFlow10 OverallSDProcessStatus
OverallTotalDeliveryStatus P_SOFAProcFlow10 OverallTotalDeliveryStatus
OverallOrdReltdBillgStatus P_SOFAProcFlow10 OverallOrdReltdBillgStatus
RequestedDeliveryDate P_SOFAProcFlow10 RequestedDeliveryDate
OverallSDProcessStatus
SalesDocumentDate P_SOFAProcFlow10 SalesDocumentDate
SalesGroup P_SOFAProcFlow10 SalesGroup
SalesOffice P_SOFAProcFlow10 SalesOffice
SoldToParty P_SOFAProcFlow10 SoldToParty
PurchaseOrderByCustomer P_SOFAProcFlow10 PurchaseOrderByCustomer
@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: #COMPOSITE
@AbapCatalog.sqlViewName: 'PSOFAPROCF20'

define view P_SOFAProcFlow20 
 as select from   P_SOFAProcFlow10        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 = 'M' or   --> Invoice
      Level2.SubsequentDocumentCategory = 'U' or   --> Pro Forma Invoice      
      Level2.SubsequentDocumentCategory = 'P' )    --> Debit Memo 
left outer to one join 
I_BillingDocument as BillingDocument
  on Level2.SubsequentDocument         = BillingDocument.BillingDocument  and
     Level2.SubsequentDocumentCategory = BillingDocument.SDDocumentCategory                   
{
   //SalesOrder

   key SalesDocument,
   key Level1.SDDocumentCategory,
   
   key Level1Document,
   key Level1DocumentItem,
   key Level1DocumentCategory,
   
   key Level2.SubsequentDocument         as Level2Document,
   key Level2.SubsequentDocumentItem     as Level2DocumentItem,
   key Level2.SubsequentDocumentCategory as Level2DocumentCategory,
   
   Level1.SalesDocumentType,

    //Organization

   Level1.SalesOrganization,
   Level1.DistributionChannel,
   Level1.OrganizationDivision,   
   
   Level1.OverallSDProcessStatus,
   Level1.OverallTotalDeliveryStatus,
   Level1.OverallOrdReltdBillgStatus,
   
   //Misc

    Level1.RequestedDeliveryDate,
    --OverallSDProcessStatus,
    Level1.SalesDocumentDate,
    Level1.SalesGroup,
    Level1.SalesOffice,
    Level1.SoldToParty,
    Level1.PurchaseOrderByCustomer,
   
                
   case 
     when
      BillingDocument.BillingDocumentIsCancelled = 'X'
     then 'X' 
     else ''
    end as BillingDocumentIsCancelled   
 }