P_FinTransFlowWithOneDirection

DDL: P_FINTRANSFLOWWITHONEDIRECTION SQL: PFINTRSFLOWONED Type: view COMPOSITE Package: FTTR_CORE

Flow with One Direction

P_FinTransFlowWithOneDirection is a Composite CDS View that provides data about "Flow with One Direction" in SAP S/4HANA. It reads from 4 data sources (R_FinTransFlow, R_FinTransUnfixedFlow, R_FinTransCashFlowActivity, R_FinTransCashFlowActivity) and exposes 15 fields with key fields CompanyCode, FinancialTransaction, FinancialTransaction. Part of development package FTTR_CORE.

Data Sources (4)

SourceAliasJoin Type
R_FinTransFlow Flow inner
R_FinTransUnfixedFlow Flow inner
R_FinTransCashFlowActivity Main from
R_FinTransCashFlowActivity Main union_all

Parameters (1)

NameTypeDefault
P_KeyDate vdm_v_key_date

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PFINTRSFLOWONED view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.preserveKey true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #XL view
VDM.viewType #COMPOSITE view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (15)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode R_FinTransUnfixedFlow CompanyCode
KEY FinancialTransaction R_FinTransUnfixedFlow FinancialTransaction
FinancialInstrProductCategory R_FinTransCashFlowActivity FinancialInstrProductCategory
FinTransFlowNomAmt R_FinTransUnfixedFlow FinTransFlowNomAmt
FinTransFlowNomAmtCrcy R_FinTransUnfixedFlow FinTransFlowNomAmtCrcy
FinTransFlowPaytAmtDirection R_FinTransUnfixedFlow FinTransFlowPaytAmtDirection
FinTransFlowPaytAmt R_FinTransUnfixedFlow FinTransFlowPaytAmt
CompanyCode
KEY FinancialTransaction R_FinTransUnfixedFlow FinancialTransaction
FinancialInstrProductCategory R_FinTransCashFlowActivity FinancialInstrProductCategory
FinTransFlowNomAmt R_FinTransUnfixedFlow FinTransFlowNomAmt
FinTransFlowNomAmtCrcy R_FinTransUnfixedFlow FinTransFlowNomAmtCrcy
FinTransFlowPaytAmtDirection R_FinTransUnfixedFlow FinTransFlowPaytAmtDirection
FinTransFlowPaytAmt R_FinTransUnfixedFlow FinTransFlowPaytAmt
FinTransFlowPaytAmtCrcy R_FinTransUnfixedFlow FinTransFlowPaytAmtCrcy
@AbapCatalog.sqlViewName: 'PFINTRSFLOWONED'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AbapCatalog.preserveKey: true
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.sizeCategory: #XL
@VDM.viewType: #COMPOSITE
@VDM.private:true
@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_FinTransFlowWithOneDirection
  with parameters
    //parameter needed to get nominal flows valid on key date

    @Environment.systemField: #SYSTEM_DATE
    P_KeyDate : vdm_v_key_date
  as select from R_FinTransCashFlowActivity as Main
    inner join   R_FinTransFlow             as Flow on  Main.CompanyCode                            =  Flow.CompanyCode
                                                    and Main.FinancialTransaction                   =  Flow.FinancialTransaction
                                                    and Main.FinancialInstrumentActivity            =  Flow.FinancialInstrumentActivity
                                                    and (
                                                       (
                                                         (
                                                           Main.FinancialInstrProductCategory       =  '510'
                                                           or Main.FinancialInstrProductCategory    =  '520'
                                                           or Main.FinancialInstrProductCategory    =  '530'
                                                           or Main.FinancialInstrProductCategory    =  '540'
                                                           or Main.FinancialInstrProductCategory    =  '550'
                                                           or Main.FinancialInstrProductCategory    =  '580'
                                                           or Main.FinancialInstrProductCategory    =  '610'
                                                           or Main.FinancialInstrProductCategory    =  '630'
                                                           or Main.FinancialInstrProductCategory    =  '850'
                                                           or Main.FinancialInstrProductCategory    =  '860'
                                                         )
                                                         and(
                                                           Flow.FinTransFlowCategory                =  '10'
                                                           or Flow.FinTransFlowCategory             =  '11'
                                                           or(
                                                             Flow.FinTransFlowCategory              =  '12'
                                                             and Main.FinancialInstrProductCategory <> '850'
                                                             and Main.FinancialInstrProductCategory <> '860'
                                                           ) // repayment

                                                           or Flow.FinTransFlowCategory             =  '13' // Installment Repayment

                                                           or Flow.FinTransFlowCategory             =  '14' // annuity repayment

                                                           or Flow.FinTransFlowCategory             =  '15' // Capitalization

                                                           or Flow.FinTransFlowCategory             =  '16' // Capitalized Payment

                                                         )
                                                       )
                                                       or(
                                                         (
                                                           Main.FinancialInstrProductCategory       =  '850'
                                                           or Main.FinancialInstrProductCategory    =  '860'
                                                         )
                                                         and Flow.FinTransFlowCategory              =  '12'
                                                         and Flow.FinancialInstrumentActivity       =  Main.FinInstrLastActiveActivity
                                                       )
                                                     )
{
  key Flow.CompanyCode,
  key Flow.FinancialTransaction,
      Main.FinancialInstrProductCategory,
      Flow.FinTransFlowNomAmt,
      Flow.FinTransFlowNomAmtCrcy,
      Flow.FinTransFlowPaytAmtDirection,
      Flow.FinTransFlowPaytAmt,
      Flow.FinTransFlowPaytAmtCrcy
}

where
           Flow.FinTransFlowPostingBlkgReason <> '2'
  and      Flow.FinTransFlowPostingBlkgReason <> '4'
  and      Flow.FinTransFlowPostingBlkgReason <> '5'
  and      Flow.FinTransFlowPostingBlkgReason <> '6'
  and      Flow.FinTransFlowPostingStatus <> '3'
  and      Flow.FinTransFlowPostingStatus <> '4'
  and(
    (
           Flow.FinTransFlowPaymentDate       <= $parameters.P_KeyDate
      and(
           Main.FinancialInstrProductCategory =  '510'
        or Main.FinancialInstrProductCategory =  '520'
        or Main.FinancialInstrProductCategory =  '530'
        or Main.FinancialInstrProductCategory =  '540'
        or Main.FinancialInstrProductCategory =  '550'
        or Main.FinancialInstrProductCategory =  '580'
        or Main.FinancialInstrProductCategory =  '610'
        or Main.FinancialInstrProductCategory =  '850'
        or Main.FinancialInstrProductCategory =  '860'
      )
    )
    or(
           Main.FinancialInstrProductCategory =  '630'
      and  Flow.FinTransFlowCategory          =  '10'
    )
  )
  union all select from R_FinTransCashFlowActivity as Main
    inner join   R_FinTransUnfixedFlow             as Flow on  Main.CompanyCode                            =  Flow.CompanyCode
                                                    and Main.FinancialTransaction                   =  Flow.FinancialTransaction
                                                    and Main.FinancialInstrumentActivity            =  Flow.FinancialInstrumentActivity
                                                    and (
                                                       (
                                                         Main.FinancialInstrProductCategory    =  '550'
                                                         and(
                                                           Flow.FinTransFlowCategory                =  '10'
                                                           or Flow.FinTransFlowCategory             =  '11'
                                                           or Flow.FinTransFlowCategory              =  '12'
                                                              // repayment

                                                           or Flow.FinTransFlowCategory             =  '13' // Installment Repayment

                                                           or Flow.FinTransFlowCategory             =  '14' // annuity repayment

                                                           or Flow.FinTransFlowCategory             =  '15' // Capitalization

                                                           or Flow.FinTransFlowCategory             =  '16' // Capitalized Payment

                                                         )
                                                       )
                                                     )
{
  key Flow.CompanyCode,
  key Flow.FinancialTransaction,
      Main.FinancialInstrProductCategory,
      Flow.FinTransFlowNomAmt,
      Flow.FinTransFlowNomAmtCrcy,
      Flow.FinTransFlowPaytAmtDirection,
      Flow.FinTransFlowPaytAmt,
      Flow.FinTransFlowPaytAmtCrcy
}
where
           Flow.FinTransFlowPostingBlkgReason <> '2'
  and      Flow.FinTransFlowPostingBlkgReason <> '4'
  and      Flow.FinTransFlowPostingBlkgReason <> '5'
  and      Flow.FinTransFlowPostingBlkgReason <> '6'
  and      Flow.FinTransFlowPostingStatus <> '3'
  and      Flow.FinTransFlowPostingStatus <> '4'
  and(
    (
           Flow.FinTransFlowPaymentDate       <= $parameters.P_KeyDate
      and Main.FinancialInstrProductCategory =  '550'
      
    )
  )