CDS标准视图:预期应收 I_FutureAccountsReceivables

视图名称:预期应收

视图类型:参数#

视图代码:#

点击查看代码
//Documentation about annotations can be found at http://help.sap.com searching for CDS annotations //Inserted by VDM CDS Suite Plugin
@ObjectModel.usageType.sizeCategory: #XXL //Inserted by VDM CDS Suite Plugin
@ObjectModel.usageType.serviceQuality: #X  //Inserted by VDM CDS Suite Plugin
@ObjectModel.usageType.dataClass: #MIXED //Inserted by VDM CDS Suite Plugin
@ObjectModel.supportedCapabilities: [ #ANALYTICAL_PROVIDER, #CDS_MODELING_DATA_SOURCE ]
@AbapCatalog.sqlViewName: 'IFUTUREACCTRBLS'
@EndUserText.label: 'Future Accounts Receivables'
@VDM.viewType: #COMPOSITE
@Analytics: { dataCategory: #CUBE }
@Analytics.internalName: #LOCAL   // released with Cloud 1808 and OP 1809 hence no design studio usage before
@Search.searchable: false // I_Region is annotated as true, hence this new must have an annotation for searchable
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions:true
@AccessControl.authorizationCheck:#CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #REQUIRED
@AbapCatalog.viewEnhancementCategory: [ #PROJECTION_LIST , #GROUP_BY ]
@AbapCatalog.compiler.compareFilter:true
@AbapCatalog.preserveKey:true

define view I_FutureAccountsReceivables

  with parameters
    @Environment.systemField: #SYSTEM_DATE
    P_KeyDate               : sydate,
    P_DisplayCurrency       : vdm_v_display_currency,
    P_ExchangeRateType      : kurst_curr,
    P_NetDueInterval1InDays : farp_net_due_interval1,
    P_NetDueInterval2InDays : farp_net_due_interval2,
    P_NetDueInterval3InDays : farp_net_due_interval3,
    P_NetDueInterval4InDays : farp_net_due_interval4
  as select from P_FutureAccountsReceivables5( P_KeyDate: :P_KeyDate,
                                                P_DisplayCurrency: :P_DisplayCurrency,
                                                P_ExchangeRateType: :P_ExchangeRateType,
                                                P_NetDueInterval1InDays: :P_NetDueInterval1InDays,
                                                P_NetDueInterval2InDays: :P_NetDueInterval2InDays,
                                                P_NetDueInterval3InDays: :P_NetDueInterval3InDays,
                                                P_NetDueInterval4InDays : :P_NetDueInterval4InDays )

  association [0..1] to I_Currency                   as _DisplayCurrency            on  _DisplayCurrency.Currency = $projection.DisplayCurrency
  association [0..1] to I_CompanyCode                as _Company                    on  _Company.CompanyCode = $projection.CompanyCode
  association [0..1] to I_Customer                   as _Customer                   on  _Customer.Customer = $projection.Customer
  association [0..1] to I_FinancialAccountType       as _FinancialAccountType       on  _FinancialAccountType.FinancialAccountType = $projection.FinancialAccountType
  association [0..1] to I_CustomerCompany            as _CustomerCompany            on  _CustomerCompany.CompanyCode = $projection.CompanyCode
                                                                                    and _CustomerCompany.Customer    = $projection.Customer
  association [0..1] to I_AccountingClerk            as _AccountingClerk            on  _AccountingClerk.CompanyCode     = $projection.CompanyCode
                                                                                    and _AccountingClerk.AccountingClerk = $projection.AccountingClerk
  association [0..1] to I_Country                    as _CustomerCountry            on  _CustomerCountry.Country = $projection.CustomerCountry
  association [0..1] to I_Region                     as _CustomerRegion             on  _CustomerRegion.Region  = $projection.CustomerRegion
                                                                                    and _CustomerRegion.Country = $projection.CustomerCountry
  association [0..1] to I_SpecialGLCode              as _SpecialGLCode              on  _SpecialGLCode.SpecialGLCode        = $projection.SpecialGLCode
                                                                                    and _SpecialGLCode.FinancialAccountType = 'D' //$projection.FinancialAccountType
  association [0..1] to I_GLAccountInChartOfAccounts as _GLAccountInChartOfAccounts on  _GLAccountInChartOfAccounts.ChartOfAccounts = $projection.ChartOfAccounts
                                                                                    and _GLAccountInChartOfAccounts.GLAccount       = $projection.GLAccount
  association [0..1] to I_GLAccountInChartOfAccounts as _ReconciliationAccount      on  _ReconciliationAccount.ChartOfAccounts = $projection.ChartOfAccounts
                                                                                    and _ReconciliationAccount.GLAccount       = $projection.ReconciliationAccount
  association [0..1] to I_ChartOfAccounts            as _ChartOfAccounts            on  _ChartOfAccounts.ChartOfAccounts = $projection.ChartOfAccounts
  association [0..1] to I_CustomerAccountGroup       as _CustomerAccountGroup       on  _CustomerAccountGroup.CustomerAccountGroup = $projection.CustomerAccountGroup
  association [0..1] to I_CustomerClassification     as _CustomerClassification     on  _CustomerClassification.CustomerClassification = $projection.CustomerClassification

  // associations are declared here in sum for better overview; in runtime the joins are exceuted on appropriate level
  // Foreign Key Associations declare the dimension cube (I-View) from which the property values are derived of by Analytical Engine (see report RSRTS_ODP_DIS)
{
      @ObjectModel.foreignKey.association: '_Company'
  key CompanyCode,

      @ObjectModel.foreignKey.association: '_Customer'
  key Customer,

      @ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
  key GLAccount,

      @ObjectModel.foreignKey.association: '_SpecialGLCode'
  key SpecialGLCode,

  key cast( NetDueIntervalText as farp_netdue_intvl_text )                             as NetDueIntervalText,

      @ObjectModel.foreignKey.association: '_FinancialAccountType'
      cast( 'D' as fis_koart )                                                        as FinancialAccountType,

      @ObjectModel.foreignKey.association: '_ReconciliationAccount'
      cast( _CustomerCompany.ReconciliationAccount as farp_akont )                     as ReconciliationAccount,

      @ObjectModel.foreignKey.association: '_ChartOfAccounts'
      cast( _Company.ChartOfAccounts as fis_ktopl )                                    as ChartOfAccounts,

      //@ObjectModel.foreignKey.association: '_ExchangeRate'
      ExchangeRateType,

      @ObjectModel.foreignKey.association: '_CustomerCountry'
      cast( _Customer._StandardAddress._Country.Country as farp_land1 )                as CustomerCountry,

      @ObjectModel.foreignKey.association: '_CustomerRegion'
      _Customer._StandardAddress._Region.Region                                        as CustomerRegion,

      @ObjectModel.foreignKey.association: '_AccountingClerk'
      cast( _CustomerCompany.AccountingClerk as farp_busab )                           as AccountingClerk,

      // fields for authorization checks via DCL
      cast( _Customer.AuthorizationGroup as fis_customer_basic_auth_grp )              as CustomerBasicAuthorizationGrp,
      _CustomerCompany.AuthorizationGroup                                              as CustomerFinsAuthorizationGrp,

      @ObjectModel.foreignKey.association: '_CustomerAccountGroup'
      _Customer.CustomerAccountGroup                                                   as CustomerAccountGroup,

      @ObjectModel.foreignKey.association: '_CustomerClassification'
      _Customer.CustomerClassification                                                 as CustomerClassification,

      @Semantics.currencyCode:true
      @ObjectModel.foreignKey.association: '_DisplayCurrency'
      DisplayCurrency,

      @DefaultAggregation: #SUM
      cast( sum( NumberOfOpenItems )        as farp_number_of_open_items )             as NumberOfOpenItems,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast( sum( AmountInDisplayCurrency ) as farp_amount_display_crcy )               as AmountInDisplayCurrency,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast( sum( TotalOverdueAmtInDspCrcy ) as farp_overdue_amount_dsp_crcy )          as TotalOverdueAmtInDspCrcy,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast( sum( TotalNotOvrdAmtInDspCrcy ) as farp_not_overdue_amt_dsp_crcy )         as TotalNotOvrdAmtInDspCrcy,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast( sum( NetDueIntvl1AmtInDspCrcy ) as farp_netdue_intvl1_amt_dspcrcy )        as NetDueIntvl1AmtInDspCrcy,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast( sum( NetDueIntvl2AmtInDspCrcy ) as farp_netdue_intvl2_amt_dspcrcy )        as NetDueIntvl2AmtInDspCrcy,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast( sum( NetDueIntvl3AmtInDspCrcy ) as farp_netdue_intvl3_amt_dspcrcy )        as NetDueIntvl3AmtInDspCrcy,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast( sum( NetDueIntvl4AmtInDspCrcy ) as farp_netdue_intvl4_amt_dspcrcy )        as NetDueIntvl4AmtInDspCrcy,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast( sum( NetDueLastIntvlAmtInDspCrcy ) as farp_netdue_lintvl_amt_dspcrcy )     as NetDueLastIntvlAmtInDspCrcy,

      // associations
      _DisplayCurrency,
      _Company,
      _Customer,
      _CustomerCompany,
      _CustomerCountry,
      _CustomerRegion,
      _FinancialAccountType,
      _AccountingClerk,
      _SpecialGLCode,
      _GLAccountInChartOfAccounts,
      _ReconciliationAccount,
      _ChartOfAccounts,
      _CustomerClassification,
      _CustomerAccountGroup
}
  group by
    CompanyCode,
    Customer,
    GLAccount,
    SpecialGLCode,
    NetDueIntervalText,
    _CustomerCompany.ReconciliationAccount,
    _Company.ChartOfAccounts,
    ExchangeRateType,
    _Customer._StandardAddress._Country.Country,
    _Customer._StandardAddress._Region.Region,
    _CustomerCompany.AccountingClerk,
    _Customer.AuthorizationGroup,
    _CustomerCompany.AuthorizationGroup,
    _Customer.CustomerAccountGroup,
    _Customer.CustomerClassification,
    DisplayCurrency

事务代码:带参数#

净额到期间隔1:距离关键日期最大天数的第一个间隔
全额付款到期间隔2:距离关键日期最大天数的第二个间隔
净额到期间隔3:距离关键日期最大天数的第三个间隔
净额到期间隔4:距离关键日期最大天数的第四个间隔
汇率类型:设置汇率种类
DATE4:关键日期
显示货币:显示的货币值

视图结构:#

字段名称 技术名称
公司代码 COMPANYCODE
客户 CUSTOMER
总账科目 GLACCOUNT
特殊总账 SPECIALGLCODE
全额付款到期日间隔 NETDUEINTERVALTEXT
财务科目类型 FINANCIALACCOUNTTYPE
对账科目 RECONCILIATIONACCOUNT
科目表 CHARTOFACCOUNTS
汇率类型 EXCHANGERATETYPE
国家/地区代码 CUSTOMERCOUNTRY
地区 CUSTOMERREGION
会计员 ACCOUNTINGCLERK
客户基本权限组 CUSTOMERBASICAUTHORIZATIONGRP
权限 CUSTOMERFINSAUTHORIZATIONGRP
客户科目组 CUSTOMERACCOUNTGROUP
客户分类 CUSTOMERCLASSIFICATION
显示货币 DISPLAYCURRENCY
未清项数 NUMBEROFOPENITEMS
以显示货币计的金额 AMOUNTINDISPLAYCURRENCY
逾期金额 TOTALOVERDUEAMTINDSPCRCY
未逾期金额 TOTALNOTOVRDAMTINDSPCRCY
1 期到期期间金额 NETDUEINTVL1AMTINDSPCRCY
2 期到期期间金额 NETDUEINTVL2AMTINDSPCRCY
3 期到期期间金额 NETDUEINTVL3AMTINDSPCRCY
4 期到期期间金额 NETDUEINTVL4AMTINDSPCRCY
上一到期期间金额 NETDUELASTINTVLAMTINDSPCRCY

作者:观兴

出处:https://www.cnblogs.com/guanxing/p/18663286

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

转载需本人同意,未经同意转载视同接受稿费2元/字

posted @   观兴  阅读(3)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)
more_horiz
keyboard_arrow_up dark_mode palette
选择主题
menu
点击右上角即可分享
微信分享提示