I_SalesOrderInInvcgNotTransfd

DDL: I_SALESORDERININVCGNOTTRANSFD SQL: ISOFISSUEIN01 Type: view COMPOSITE Package: VDM_SD_SOF

SOFM Not Transferred Sales Orders In Invoice

I_SalesOrderInInvcgNotTransfd is a Composite CDS View that provides data about "SOFM Not Transferred Sales Orders In Invoice" in SAP S/4HANA. It reads from 1 data source (I_SalesDocumentBasic) and exposes 16 fields with key fields SalesOrder, BillingDocument. Part of development package VDM_SD_SOF.

Data Sources (1)

SourceAliasJoin Type
I_SalesDocumentBasic SOH inner

Annotations (8)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #S view
EndUserText.label SOFM Not Transferred Sales Orders In Invoice view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #CHECK view
AbapCatalog.sqlViewName ISOFISSUEIN01 view

Fields (16)

KeyFieldSource TableSource FieldDescription
KEY SalesOrder
KEY BillingDocument bdi BillingDocument
SalesOrganization I_SalesDocumentBasic SalesOrganization
DistributionChannel I_SalesDocumentBasic DistributionChannel
OrganizationDivision I_SalesDocumentBasic OrganizationDivision
RequestedDeliveryDate I_SalesDocumentBasic RequestedDeliveryDate
OverallSDProcessStatus I_SalesDocumentBasic OverallSDProcessStatus
SalesDocumentDate I_SalesDocumentBasic SalesDocumentDate
SalesGroup I_SalesDocumentBasic SalesGroup
SalesOffice I_SalesDocumentBasic SalesOffice
SoldToParty I_SalesDocumentBasic SoldToParty
PurchaseOrderByCustomer
SalesOrderType I_SalesDocumentBasic SalesDocumentType
AccountingPostingStatus
Issue
IssueCategory
@ClientHandling.algorithm: #SESSION_VARIABLE 
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #S

@EndUserText.label:  'SOFM Not Transferred Sales Orders In Invoice'  
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@AbapCatalog.sqlViewName: 'ISOFISSUEIN01'

--COMMENTS
--CAVE: vkorg auf BDH can be different to to vkorg auf SOH - and we expose here the SOH-Vkorg
--Note (outdated): vbrk-buchk is not persisted on VBRP. However, VBRP can be prefiltered by gbstk_ana = A or B !   <-- Performance Optimization 28.6.2019
--Note: vbrk-buchk IS persisted on VBRP (vbrp-vf_status_ana=B). This allows to ignore VBRK !                       <-- Performance Optimization 16.8.2019

--Note for Performance especially in high volume setting: 
--          not too many vbrk (filter buchk)     <-OUTDATED 16.8.2019
--          not too many vbrp (filter gbstk_ana) <-NEW 28.6.2019
--          not too many vbak (filter push-down vkorg, ...) <-NEW 2017 ?
--          Update 16.8.2019 VBRK no longer needed - vbrp is filtered with vbrp.vf_status_ana=B

--AT11.08.2020 for all issues: VBKD-BSTKD (PurchaseOrderBYCustomer) no longer provided by issues (no true hdr attribute & too expensive)

define view I_SalesOrderInInvcgNotTransfd  
//with parameters

//  @Consumption.hidden: true

//  @Environment.systemField: #SYSTEM_DATE

//  P_ReferenceDate : sydate

as select distinct from  I_BillingDocumentItem as bdi      --AT16.8.2019 OP1911 ignore VBRK by using vbrp-vf_status_ana = B 

inner join  I_SalesDocumentBasic as SOH on  --I_SalesDocument
      bdi.SalesDocument = SOH.SalesDocument
      and  --AT29.06.2020 enforce underlying/preceding Sales Document is C,I,L     
       ( SOH.SDDocumentCategory = 'C' or
         SOH.SDDocumentCategory = 'I' or
         SOH.SDDocumentCategory = 'L'
       )

//left outer to one join P_SalesDocumentBusinessData as VBKD on  

//      SOH.SalesDocument = VBKD.SlsDocBusinessData

//      and  VBKD.SlsDocBusinessDataItem = '000000'

{
  //Key

  key cast(SOH.SalesDocument as vdm_sales_order) as SalesOrder,
  key bdi.BillingDocument as BillingDocument,

  //Organization

  SOH.SalesOrganization    as SalesOrganization,
  SOH.DistributionChannel  as DistributionChannel,
  SOH.OrganizationDivision as OrganizationDivision,
  
  //Misc

  SOH.RequestedDeliveryDate,
  SOH.OverallSDProcessStatus,
  SOH.SalesDocumentDate,
  SOH.SalesGroup,
  SOH.SalesOffice,
  SOH.SoldToParty,
  --VBKD.PurchaseOrderByCustomer,
  
  //Category

  SOH.SalesDocumentType    as SalesOrderType,

  --BDH.AccountingPostingStatus as AccountingPostingStatus,

  //Issue

  cast('IN01'as issue_sof)   as Issue,
  cast('30_IN' as issue_cat) as IssueCategory,
  @DefaultAggregation: #MIN
  case when bdi.BillingDocumentDate = '00000000'
       then 
            cast(dats_days_between( cast($session.system_date as dats), bdi.CreationDate )  as due_days)
       else 
            cast(dats_days_between( cast($session.system_date as dats), bdi.BillingDocumentDate )  as due_days) 
       end                    as DueDays
  
}

where 
      bdi.OverallBillingStatus = 'B'  --AT16.8.2019 OP1911 ignore VBRK by using vbrp-vf_status_ana = B 
      --( BDH.AccountingPostingStatus = 'A' or BDH.AccountingPostingStatus = 'B' ) 
      --BDH.BillingDocumentDate <= $session.system_date  Fix AT3.5.2017 
       /*$parameters.P_ReferenceDate  and
       -- all "sales order like" categories/vbtyps
       ( SOH.SDDocumentCategory = 'C' or
         SOH.SDDocumentCategory = 'I' or
         SOH.SDDocumentCategory = 'L'
       ) --*/