R_FinTransSecurityQuantityFlow

DDL: R_FINTRANSSECURITYQUANTITYFLOW SQL: RFINTRANSQTYFLOW Type: view BASIC

Fin Trans Security Quantity Flow

R_FinTransSecurityQuantityFlow is a Basic CDS View that provides data about "Fin Trans Security Quantity Flow" in SAP S/4HANA. It reads from 4 data sources (I_CompanyCode, I_FinancialTransaction, vtbfhapo, I_SecurityClass) and exposes 33 fields with key fields CompanyCode, FinancialTransaction, FinancialInstrumentActivity, FinTransFlowCreationDate, FinTransFlowCreationTime.

Data Sources (4)

SourceAliasJoin Type
I_CompanyCode CompanyCode inner
I_FinancialTransaction Deal inner
vtbfhapo Flow from
I_SecurityClass SecurityClass inner

Annotations (14)

NameValueLevelField
AbapCatalog.sqlViewName RFINTRANSQTYFLOW view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AbapCatalog.buffering.status #NOT_ALLOWED view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
EndUserText.label Fin Trans Security Quantity Flow view
AccessControl.personalData.blocking #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
Metadata.allowExtensions false view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
VDM.viewType #BASIC view

Fields (33)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode vtbfhapo bukrs
KEY FinancialTransaction vtbfhapo rfha
KEY FinancialInstrumentActivity vtbfhapo rfhazu
KEY FinTransFlowCreationDate vtbfhapo dcrdat
KEY FinTransFlowCreationTime
KEY FinTransFlowNumber vtbfhapo rfhazb
FinTransTradedNomAmt
FinTransFlowNomAmtCrcy
FinTransTradedOriglNomAmt vtbfhapo nominal_org_amt
FinTransTradedNumberOfUnits
FinTransTradedPricePercent
FinTransTrdPriceCrcyUnitRate
FinTransTradedPriceCrcyUnit
MarketValueInQtanCurrency vtbfhapo bebetr
QuotationCurrency vtbfhapo webetr
MarketValInPaytCurrency vtbfhapo bzbetr
PaymentCurrency vtbfhapo wzbetr
FinTransPaymentCrcyCnvrsnRate
MarketValueInPositionCurrency vtbfhapo bbbetr
PositionCurrency vtbfhapo wbbetr
FinTransPositionCrcyCnvrsnRate
MarketValueInLocalCurrency
LocalCurrency I_CompanyCode Currency
FinTransLoclCrcyCnvrsnRate
FinTransForwardPriceCostRate
FinTransFwdPrcIntrstCompRate
FinTransFwdPrcDividendPercent vtbfhapo div_pctc_otc
SecurityExchange vtbfhapo rhandpl
SecurityClass vtbfhapo ranl
SecurityAccount vtbfhapo rldepo
FinTransPositionValueDate vtbfhapo dbestand
FinTransFlowPaymentDate
CalculationDate vtbfhapo dvalut
@AbapCatalog.sqlViewName: 'RFINTRANSQTYFLOW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AbapCatalog.buffering.status: #NOT_ALLOWED
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@EndUserText.label: 'Fin Trans Security Quantity Flow'
@AccessControl.personalData.blocking: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #L
@Metadata.allowExtensions:false
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@VDM.viewType: #BASIC
define view R_FinTransSecurityQuantityFlow
  as select from vtbfhapo               as Flow
  //deal data are needed for restriction in where-condition

    inner join   I_FinancialTransaction as Deal          on  Flow.bukrs = Deal.CompanyCode
                                                         and Flow.rfha  = Deal.FinancialTransaction
  //security class data needed to determine quotation

    inner join   I_SecurityClass        as SecurityClass on Deal.SecurityClass = SecurityClass.SecurityClass
  //local currency

    inner join   I_CompanyCode          as CompanyCode   on Flow.bukrs = CompanyCode.CompanyCode
{
      //exposed fields

  key Flow.bukrs                                                      as CompanyCode,
  key Flow.rfha                                                       as FinancialTransaction,
  key Flow.rfhazu                                                     as FinancialInstrumentActivity,
  key Flow.dcrdat                                                     as FinTransFlowCreationDate,
  key cast( Flow.tcrtim as ftr_flow_creation_time preserving type )
                                                                      as FinTransFlowCreationTime,
  key Flow.rfhazb                                                     as FinTransFlowNumber,

      @Semantics.amount.currencyCode: 'FinTransFlowNomAmtCrcy'
      cast( Flow.bnwhr as ftr_traded_norminal_amount preserving type )
                                                                      as FinTransTradedNomAmt,
      cast( Flow.wprice as ftr_flow_norminal_amount_crcy preserving type )
                                                                      as FinTransFlowNomAmtCrcy,
      @Semantics.amount.currencyCode: 'FinTransFlowNomAmtCrcy'
      Flow.nominal_org_amt                                            as FinTransTradedOriglNomAmt,
      cast(Flow.astueck as ftr_fintrans_units_l )                     as FinTransTradedNumberOfUnits,
      cast ( Flow.bpprc as ftr_price_percent preserving type )        as FinTransTradedPricePercent,
      cast ( Flow.buprc as ftr_price preserving type )                as FinTransTrdPriceCrcyUnitRate,
      cast ( Flow.srunit as ftr_traded_price_currency_unit preserving type ) as FinTransTradedPriceCrcyUnit,
      @Semantics.amount.currencyCode: 'QuotationCurrency'
      Flow.bebetr                                                     as MarketValueInQtanCurrency,
      Flow.webetr                                                     as QuotationCurrency,
      @Semantics.amount.currencyCode: 'PaymentCurrency'
      Flow.bzbetr                                                     as MarketValInPaytCurrency,
      Flow.wzbetr                                                     as PaymentCurrency,
      cast(Flow.kzwkurs as ftr_payment_crcy_cnvrsn_rate preserving type)     
                                                                      as FinTransPaymentCrcyCnvrsnRate,
      @Semantics.amount.currencyCode: 'PositionCurrency'
      Flow.bbbetr                                                     as MarketValueInPositionCurrency,
      Flow.wbbetr                                                     as PositionCurrency,
      cast(Flow.kbwkurs as ftr_position_crcy_cnvrsn_rate preserving type)     
                                                                      as FinTransPositionCrcyCnvrsnRate,
      @Semantics.amount.currencyCode: 'LocalCurrency'
      cast(Flow.bhwbetr as market_value_in_local_currency preserving type )
                                                                      as MarketValueInLocalCurrency,
      CompanyCode.Currency                                            as LocalCurrency,
      cast(Flow.khwkurs as ftr_cnvrsn_rate_in_locl_crcy preserving type)
                                                                      as FinTransLoclCrcyCnvrsnRate,
      cast( case when SecurityClass.SecurityClassQuotation = '1'
           then Flow.bprc_spot1
      //else value should be initial/null

           end as ftr_spot_price_percentage preserving type )         as FinTransSpotPricePercent,
      cast( case when SecurityClass.SecurityClassQuotation = '2'
           then Flow.bprc_spot1
      //else value should be initial/null

           end as ftr_spot_price_crcy_unit_rate preserving type )     as FinTransSpotPriceCrcyUnitRate,
      cast( case when SecurityClass.SecurityClassQuotation = '1'
           then Flow.bprc_spot2
      //else value should be initial/null

           end as ftr_maturity_spot_price_pct preserving type )       as FinTransMaturitySpotPricePct,
      cast( case when SecurityClass.SecurityClassQuotation = '2'
           then Flow.bprc_spot2
      //else value should be initial/null

           end as ftr_mat_spot_crcy_unit_rate preserving type )       as FinTransMatSpotPrcCrcyUnitRate,
      cast(Flow.cost_fwd as ftr_price)                                as FinTransForwardPriceCostRate,
      cast(Flow.interest_fwd as ftr_price)                            as FinTransFwdPrcIntrstCompRate,
      Flow.div_pctc_otc                                               as FinTransFwdPrcDividendPercent,
      Flow.rhandpl                                                    as SecurityExchange,
      Flow.ranl                                                       as SecurityClass,
      Flow.rldepo                                                     as SecurityAccount,
      Flow.dbestand                                                   as FinTransPositionValueDate,
      cast(Flow.dzterm as ftr_flow_payment_date preserving type )     as FinTransFlowPaymentDate,
      Flow.dvalut                                                     as CalculationDate
}
//restrict to main flow

where
  (
       Flow.sherkunft                     = 'HPT'
    or Flow.sherkunft                     = 'BS'
  )
  //restrict to relevant product categories

  and(
       Deal.TreasuryContractType          = '2'
    or Deal.FinancialInstrProductCategory = '640'
    or Deal.FinancialInstrProductCategory = '700'
    or Deal.FinancialInstrProductCategory = '740'
    or Deal.FinancialInstrProductCategory = '750'
  )