FINS_REV_REC_CH_FLOW

DDL: FINS_REV_REC_CH_FLOW SQL: FINSRR_CHFLOW Type: view

Flow of documents for contract header

FINS_REV_REC_CH_FLOW is a CDS View that provides data about "Flow of documents for contract header" in SAP S/4HANA. It reads from 1 data source (bkpf).

Data Sources (1)

SourceAliasJoin Type
bkpf k left_outer

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName FINSRR_CHFLOW view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Flow of documents for contract header view
ClientDependent true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
@AbapCatalog.sqlViewName: 'FINSRR_CHFLOW'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Flow of documents for contract header'
@ClientDependent: true

@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MIXED

//List from acdoca with

//- Number of (other) Business Transactions

//- Number of real time event based revenue recognition transactions

//- Number of target rev. event based revenue recognition transactions

//- Number of closing event based revenue recognition transactions

//- Number of excluded Business Transactions

//- Number partial real time event based revenue recognition transactions

//The numbers are documented per reference document, journal entry document, business transaction type, ledger and account assignment

//Each document item counts with the number 1

//Selects from ACDOCA and BKPF


define view FINS_REV_REC_CH_FLOW as 

select distinct 
a.awtyp,
a.awsys,
aworg,
awref,
awitem,
a.awtyp_rev,
a.aworg_rev,
a.awref_rev,
a.rldnr,
rbukrs,
a.gjahr as docyear,
a.belnr,
a.bttype,

cast( case accasty when 'PD' then ps_pspid else ' ' end as ps_pspid ) as ps_pspid,
cast( case accasty when 'VK' then kdauf else ' ' end as vbeln_va ) as kdauf,
cast( case accasty when 'PQ' then vtkey else ' ' end as vtkey_kk ) as vtkey,
cast( case accasty when 'SZ' then solution_order_id else ' ' end as fco_solution_order_id ) as solution_order_id,

accasty,

cast( case a.vrgng when '' then a.vorgn when 'COIE' then a.vorgn when 'COIN' then a.vorgn else a.vrgng end as fins_trr_bttype ) as bttype_tec,

/*
// Number of (other) Business Transactions:

cast( case bttype when 'RFCV' then 0 else ( case vorgn when 'TBRR' then 0 when 'TBCS' then 0 when 'GLYC' then 0 when 'OCCP' then 0 when 'OCTP' then 0 else 1 end ) end as fins_trr_no_of_ot ) as no_of_ot,
// Number of real time event based revenue recogn. transactions:

cast( case a.awtyp when 'TBRR' then 0 else (case vorgn when 'TBRR' then (case slalittype when '08202' then 0 else 1 end) else 0 end ) end as fins_trr_no_of_rr) as no_of_rr,
// Number of target rev. event based rev. recogn. transactions:

cast( case vorgn when 'TBRR' then (case slalittype when '08202' then 1 else 0 end) else 0 end as fins_trr_no_of_rrtr ) as no_of_rrtr,  -- mostly realtime
*/
// Number of closing event based revenue recogn. transactions: 

cast( case a.awtyp when 'TBRR' then 1 else 0 end as fins_trr_no_of_rrev ) as no_of_rrev,
/*
// Number of excluded Business Transactions:

cast( case bttype when 'RFCV' then 1 else ( case vorgn when 'TBCS' then 1  when 'GLYC' then 1 when 'OCCP' then 1 when 'OCTP' then 1 else 0 end ) end as fins_trr_no_of_ex ) as no_of_ex, -- excluded stuff, consider class CL_FINS_TRR_CONTROL
// Number partial real time event based revenue recogn. trans.:

cast( case coalesce( k.trr_partial_ind , ' ' ) when ' ' then 0 else 1 end as fins_trr_no_of_pa ) as no_of_pa,
*/

fiscyearper,
a.budat,
a.bldat,
timestamp,
k.cpudt,
k.cputm,
k.usnam,
a.kokrs

from acdoca as a
left outer join bkpf as k on k.mandt = a.rclnt
                          and k.bukrs = a.rbukrs
                          and k.belnr = a.belnr
                          and k.gjahr = a.gjahr
where accasty = 'PD' or
      accasty = 'VK' or
      accasty = 'PQ' or
      accasty = 'SZ' 
      
;