P_TFTRANSCASHFLOW

DDL: P_TFTRANSCASHFLOW SQL: PTFTRANSCF Type: view COMPOSITE

P_TFTRANSCASHFLOW is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_FinancialTransaction, vtbfhazu, I_FinancialTransacCashFlow) and exposes 11 fields with key fields CompanyCode, FinancialTransaction.

Data Sources (3)

SourceAliasJoin Type
I_FinancialTransaction FinancialTransaction from
vtbfhazu TransactionActivity left_outer
I_FinancialTransacCashFlow TransactionCashFlow left_outer

Parameters (1)

NameTypeDefault
P_KeyDate vdm_v_key_date

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PTFTRANSCF view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view
AbapCatalog.preserveKey true view

Fields (11)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_FinancialTransacCashFlow CompanyCode
KEY FinancialTransaction I_FinancialTransacCashFlow FinancialTransaction
FinancialInstrProductCategory I_FinancialTransacCashFlow FinancialInstrProductCategory
FinancialInstrumentProductType I_FinancialTransacCashFlow FinancialInstrumentProductType
FinInstrTransactionCategory I_FinancialTransacCashFlow FinInstrTransactionCategory
FinancialInstrTransactionType I_FinancialTransacCashFlow FinancialInstrTransactionType
Counterparty I_FinancialTransacCashFlow Counterparty
CashFlowCalculationCategory I_FinancialTransacCashFlow CashFlowCalculationCategory
TransactionCurrency I_FinancialTransaction TransactionCurrency
NominalCurrency I_FinancialTransacCashFlow NominalCurrency
DifferentiationPortfolio I_FinancialTransacCashFlow DifferentiationPortfolio
@AbapCatalog.sqlViewName: 'PTFTRANSCF'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@VDM.private:true
@AbapCatalog.preserveKey:true
 
define view P_TFTRANSCASHFLOW 
  with parameters
    @Environment.systemField: #SYSTEM_DATE
    P_KeyDate          : vdm_v_key_date
    as select from I_FinancialTransaction as FinancialTransaction    
        left outer join  vtbfhazu as TransactionActivity       on FinancialTransaction.CompanyCode                = TransactionActivity.bukrs
                                                              and FinancialTransaction.FinancialTransaction       = TransactionActivity.rfha
                                                              and FinancialTransaction.FinInstrLastActiveActivity = TransactionActivity.rfhazu
        left outer join  I_FinancialTransacCashFlow as TransactionCashFlow 
                                                               on TransactionCashFlow.CompanyCode                 = FinancialTransaction.CompanyCode
                                                              and TransactionCashFlow.FinancialTransaction        = FinancialTransaction.FinancialTransaction                                                                     
                                                                                                                                                                                                                                           
{
     key TransactionCashFlow.CompanyCode,
     key TransactionCashFlow.FinancialTransaction, 
         
         TransactionCashFlow.FinancialInstrProductCategory,
         TransactionCashFlow.FinancialInstrumentProductType,
         TransactionCashFlow.FinInstrTransactionCategory,
         TransactionCashFlow.FinancialInstrTransactionType,
         TransactionCashFlow.Counterparty,
         TransactionCashFlow.CashFlowCalculationCategory,
         FinancialTransaction.TransactionCurrency,
                  
         case TransactionCashFlow.CashFlowDirection
               when '+' then -1 * TransactionCashFlow.NominalAmountInNominalCurrency
               else TransactionCashFlow.NominalAmountInNominalCurrency  
               end as NominalAmountInNominalCurrency,
               
         TransactionCashFlow.NominalCurrency,
         TransactionCashFlow.DifferentiationPortfolio
} where 
      FinancialTransaction.FinancialInstrumentStatus = '0' and //active transaction

      TransactionActivity.dblfz <= $parameters.P_KeyDate and 
    ( TransactionActivity.delfz > $parameters.P_KeyDate or TransactionActivity.notice_date > $parameters.P_KeyDate ) and //key date is before end date of transaction or terminate

    ( FinancialTransaction.FinancialInstrProductCategory = '860' or FinancialTransaction.FinancialInstrProductCategory = '850') and
     //2. norminal or capitalized interest or install repaymentflow counted

  ( (( TransactionCashFlow.CashFlowCalculationCategory = 'AA'   or TransactionCashFlow.CashFlowCalculationCategory = 'SS' ) and TransactionCashFlow.CalculationDate <= $parameters.P_KeyDate ) or
     TransactionCashFlow.CashFlowCalculationCategory = 'TB' )

  

        
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_FINANCIALTRANSACCASHFLOW",
"I_FINANCIALTRANSACTION",
"VTBFHAZU"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/