P_Cashflow_Base

DDL: P_CASHFLOW_BASE SQL: PCASHFLOWBASE Type: view COMPOSITE

P_Cashflow_Base is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_CashFlow) and exposes 49 fields. It has 3 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_CashFlow flow from

Parameters (1)

NameTypeDefault
P_Language abap.lang

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_CalendarDate _Date $projection.CalendarDay = _Date.CalendarDate
[0..1] I_LiquidityItem _LiquidityItem $projection.LiquidityItem = _LiquidityItem.LiquidityItem
[0..1] I_GLAccount _GLAccount $projection.CompanyCode = _GLAccount.CompanyCode and $projection.GLAccount = _GLAccount.GLAccount

Annotations (6)

NameValueLevelField
VDM.private true view
VDM.viewType #COMPOSITE view
ClientDependent true view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.sqlViewName PCASHFLOWBASE view

Fields (49)

KeyFieldSource TableSource FieldDescription
CompanyCode I_CashFlow CompanyCode
ControllingArea _CompanyCode ControllingArea
Country _CompanyCode Country
LiquidityItem I_CashFlow LiquidityItem
BankAccountInternalID I_CashFlow BankAccountInternalID
BankAccountType _BankAccount BankAccountType
Bank _BankAccount Bank
BankAccount _BankAccount BankAccountNumber
BankAccountDescription
BankAccountStatus _BankAccount BankAccountStatus
CalendarDay I_CashFlow TransactionDate
CalendarYearWeek _Date YearWeek
CalendarYearMonth _Date YearMonth
CalendarYearQuarter _Date YearQuarter
CalendarYear _Date CalendarYear
FiscalYear I_CashFlow FiscalYear
FiscalYearVariant
AmountInTransactionCurrency I_CashFlow AmountInTransactionCurrency
PaymentMethod I_CashFlow PaymentMethod
OriginApplication I_CashFlow OriginApplication
CertaintyLevel I_CashFlow CertaintyLevel
GLAccount I_CashFlow GLAccount
DocumentItemText
Customer I_CashFlow Customer
Supplier I_CashFlow Supplier
BusinessPartner I_CashFlow BusinessPartner
Material I_CashFlow Material
BusinessArea I_CashFlow BusinessArea
ProfitCenter I_CashFlow ProfitCenter
WBSElementInternalID I_CashFlow WBSElementInternalID
WBSElement I_CashFlow WBSElement
PartnerCompany I_CashFlow PartnerCompany
CostCenter I_CashFlow CostCenter
Segment I_CashFlow Segment
CashPlanningGroup I_CashFlow CashPlanningGroup
PlanningLevel I_CashFlow PlanningLevel
ExpirationDate I_CashFlow ExpirationDate
HouseBank I_CashFlow HouseBank
HouseBankAccount I_CashFlow HouseBankAccount
SourceCompanyCode I_CashFlow SourceCompanyCode
ResponsibleCostCenter
Project
_CompanyCode _CompanyCode
_LiquidityItem _LiquidityItem
_BankAccount _BankAccount
_GLAccount _GLAccount
_WBSElement _WBSElement
_CashPlanningGroup _CashPlanningGroup
_PlanningLevel
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ClientDependent: true
//@Analytics: { dataCategory: #COMPOSITE, dataExtraction.enabled: true }

@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AbapCatalog.sqlViewName: 'PCASHFLOWBASE' //must start with "P"

define view P_Cashflow_Base //must start with "P_"; same as DDL source name in upper-camelcase notation


  with parameters
    @Environment.systemField: #SYSTEM_LANGUAGE
    P_Language : abap.lang

  as select from I_CashFlow as flow

  association [0..1] to I_CalendarDate  as _Date          on $projection.CalendarDay = _Date.CalendarDate
  //association [0..1] to I_PlanningUnit as _PlanningUnit on $projection.CompanyCode = _PlanningUnit.CompanyCode

  association [0..1] to I_LiquidityItem as _LiquidityItem on $projection.LiquidityItem = _LiquidityItem.LiquidityItem
  association [0..1] to I_GLAccount                as _GLAccount              on  $projection.CompanyCode = _GLAccount.CompanyCode
                                                                              and $projection.GLAccount   = _GLAccount.GLAccount

{
  //    key flow.CashFlow,


  @ObjectModel.foreignKey.association: '_CompanyCode'
  flow.CompanyCode,
  _CompanyCode.ControllingArea,
  _CompanyCode.Country,

  //    @ObjectModel.foreignKey.association: '_DemoMasterData'

  //    flow.LiquidityItem,

  //    _LiquidityMasterData,


  @ObjectModel.foreignKey.association: '_LiquidityItem'
  flow.LiquidityItem,

  @ObjectModel.foreignKey.association: '_BankAccount'
  flow.BankAccountInternalID,
  @Semantics.currencyCode: true
  case when (flow._BankAccount._BankAccountCurrency.BankAccountCurrency is null or flow._BankAccount._BankAccountCurrency.BankAccountCurrency = '')
       then flow.TransactionCurrency
       else flow._BankAccount._BankAccountCurrency.BankAccountCurrency
       end               as TransactionCurrency,
  @Semantics.currencyCode: true
  case when (flow.TransactionCurrency is null or flow.TransactionCurrency = '')
       then flow._BankAccount._BankAccountCurrency.BankAccountCurrency
       else flow.TransactionCurrency
       end               as OriginalTransactionCurrency,
  _BankAccount.BankAccountType,
  _BankAccount.Bank,
  _BankAccount.BankAccountNumber as BankAccount,
  _BankAccount._Text[1: Language = $parameters.P_Language].BankAccountDescription,
  _BankAccount.BankAccountStatus,

  //Time dimensions

  flow.TransactionDate   as CalendarDay,
  _Date.YearWeek         as CalendarYearWeek,
  _Date.YearMonth        as CalendarYearMonth,
  _Date.YearQuarter      as CalendarYearQuarter,
  _Date.CalendarYear     as CalendarYear,
  flow.FiscalYear,
  flow._CompanyCode.FiscalYearVariant,

  @Semantics.amount.currencyCode: 'TransactionCurrency'
  @DefaultAggregation: #SUM
  case when AmountInTransactionCurrency < 0 
     then flow.AmountInTransactionCurrency
  else 0 end             as CashOut,


  @Semantics.amount.currencyCode: 'TransactionCurrency'
  @DefaultAggregation: #SUM
  case when AmountInTransactionCurrency >= 0 
    then flow.AmountInTransactionCurrency
  else 0 end             as CashIn,

  @Semantics.amount.currencyCode: 'TransactionCurrency'
  @DefaultAggregation: #SUM
  flow.AmountInTransactionCurrency,
  flow.PaymentMethod,
  flow.OriginApplication,
  flow.CertaintyLevel,
  @ObjectModel.foreignKey.association: '_GLAccount' //Inserted by VDM CDS Suite Plugin

  flow.GLAccount,

  --flow.DocumentItemText,
  flow.Customer,
  flow.Supplier,
  //    flow.Supplier as Vendor,

  flow.BusinessPartner,
  flow.Material,
  flow.BusinessArea,
  flow.ProfitCenter,
  @ObjectModel.foreignKey.association: '_WBSElement'
  flow.WBSElementInternalID,
  flow.WBSElement,

  flow.PartnerCompany,
  //    flow.PartnerCompany as TradingPartner,

  flow.CostCenter,
  flow.Segment,
  @ObjectModel.foreignKey.association: '_CashPlanningGroup'
  flow.CashPlanningGroup,

  @ObjectModel.foreignKey.association: '_PlanningLevel' //Inserted by VDM CDS Suite Plugin

  flow.PlanningLevel,

  flow.ExpirationDate,
  flow.HouseBank,
  flow.HouseBankAccount,

  flow.SourceCompanyCode,
  flow._WBSElement.ResponsibleCostCenter,
  flow._WBSElement._Project.Project,

  //    @ObjectModel.foreignKey.association: '_PlanningUnit'

  //    _PlanningUnit.PlanningUnit,

  //    _PlanningUnit.PlanningUnitText,

  //    _PlanningUnit.Reviewer,

  //    _PlanningUnit


  // association

  _CompanyCode,
  _LiquidityItem,
  _BankAccount,
  _GLAccount,
  _WBSElement,
  _CashPlanningGroup,
  _PlanningLevel --,

}
where
  CertaintyLevel <> 'ACTUAL'                                                                                             
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 /*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BANKACCOUNT",
"I_BANKACCOUNTCURRENCY",
"I_BANKACCOUNTTEXT",
"I_CALENDARDATE",
"I_CASHFLOW",
"I_COMPANYCODE",
"I_PROJECTBYINTERNALKEY",
"I_WBSELEMENTBYINTERNALKEY"
],
"ASSOCIATED":
[
"I_BANKACCOUNT",
"I_CALENDARDATE",
"I_CASHPLANNINGGROUP",
"I_COMPANYCODE",
"I_GLACCOUNT",
"I_LIQUIDITYITEM",
"I_PLANNINGLEVEL",
"I_WBSELEMENTBYINTERNALKEY"
],
"BASE":
[
"I_CASHFLOW"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/