首页 > 其他分享 >CDS标准视图:总计应收款 I_TotalAccountsReceivables

CDS标准视图:总计应收款 I_TotalAccountsReceivables

时间:2025-01-10 09:44:04浏览次数:1  
标签:Customer projection ObjectModel foreignKey 视图 CDS DisplayCurrency TotalAccountsR

视图名称:总计应收款 I_TotalAccountsReceivables

视图类型:参数

视图代码:

点击查看代码
@AbapCatalog.sqlViewName: 'IFITOTALACCTRBLS'
@AbapCatalog.compiler.compareFilter:true
@AbapCatalog.preserveKey:true
@VDM.viewType: #COMPOSITE
@EndUserText.label: 'Total Accounts Receivables'
@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
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.supportedCapabilities: [ #ANALYTICAL_PROVIDER, #CDS_MODELING_DATA_SOURCE ]
@AccessControl.personalData.blocking: #REQUIRED
@AbapCatalog.viewEnhancementCategory: [ #PROJECTION_LIST , #GROUP_BY ]

define view I_TotalAccountsReceivables
  with parameters
    @Environment.systemField: #SYSTEM_DATE
    P_TodayDate             : sydate,    // this is rather a key date, we refrain from renaming it to be compatible
    P_NetDueInterval1InDays : farp_net_due_interval1,
    P_NetDueInterval2InDays : farp_net_due_interval2,
    P_NetDueInterval3InDays : farp_net_due_interval3,
    P_DisplayCurrency       : vdm_v_display_currency,
    P_ExchangeRateType      : kurst

  as select from P_TotalAccountsReceivables12(P_TodayDate:             :P_TodayDate,
                                              P_NetDueInterval1InDays: :P_NetDueInterval1InDays,
                                              P_NetDueInterval2InDays: :P_NetDueInterval2InDays,
                                              P_NetDueInterval3InDays: :P_NetDueInterval3InDays,
                                              P_DisplayCurrency:       :P_DisplayCurrency,
                                              P_ExchangeRateType:      :P_ExchangeRateType)
  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_CustomerCompany            as _CustomerCompany            on  _CustomerCompany.CompanyCode = $projection.CompanyCode
                                                                                    and _CustomerCompany.Customer    = $projection.Customer
  association [0..1] to I_FinancialAccountType       as _FinancialAccountType       on  _FinancialAccountType.FinancialAccountType = $projection.FinancialAccountType
  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_Currency                   as _DisplayCurrency            on  _DisplayCurrency.Currency = $projection.DisplayCurrency
  association [0..1] to I_Currency                   as _CompanyCodeCurrency        on  _CompanyCodeCurrency.Currency = $projection.CompanyCodeCurrency
  association [0..1] to I_SpecialGLCode              as _SpecialGLCode              on  _SpecialGLCode.SpecialGLCode        = $projection.SpecialGLCode
                                                                                    and _SpecialGLCode.FinancialAccountType = 'D'
  association [0..1] to I_ChartOfAccounts            as _ChartOfAccounts            on  _ChartOfAccounts.ChartOfAccounts = $projection.ChartOfAccounts
  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_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,
      // switch to association to make it unique (dependent from key field company) and keep it out of key; can't be removed as query exposes CompanyCodeCurrency already
      // and odata (i.e. query) changes shall be compatible
      @ObjectModel.foreignKey.association: '_CompanyCodeCurrency'
      _Company.Currency                                                               as CompanyCodeCurrency,
      //  @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,
      @ObjectModel.foreignKey.association: '_ChartOfAccounts'
      cast( _Company.ChartOfAccounts as fis_ktopl )                                   as ChartOfAccounts,
      @ObjectModel.foreignKey.association: '_ReconciliationAccount'
      cast( _CustomerCompany.ReconciliationAccount as farp_akont )                    as ReconciliationAccount,

      // 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
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast( sum( TotalAmountInDisplayCrcy ) as farp_total_amount_display_crcy )       as TotalAmountInDisplayCrcy,

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

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

      @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,

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

事务代码:参数

净额到期间隔1:第一个间隔距离关键日期最大天数的
全额付款到期间隔2:第二个间隔距离关键日期最大天数的
净额到期间隔3:第三个间隔距离关键日期最大天数的
汇率类型:汇率类型
CDATE:当前日期
显示货币:显示的货币类型

视图结构:

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

标签:Customer,projection,ObjectModel,foreignKey,视图,CDS,DisplayCurrency,TotalAccountsR
From: https://www.cnblogs.com/guanxing/p/18663338

相关文章

  • CDS标准视图:预期应收 I_FutureAccountsReceivables
    视图名称:预期应收视图类型:参数视图代码:点击查看代码//Documentationaboutannotationscanbefoundathttp://help.sap.comsearchingforCDSannotations//InsertedbyVDMCDSSuitePlugin@ObjectModel.usageType.sizeCategory:#XXL//InsertedbyVDMCDSSuiteP......
  • CDS标准视图:催款级别分配 I_DunningLevelDistribution
    视图名称:催款级别分配I_DunningLevelDistribution视图类型:基础视图视图代码:点击查看代码@AbapCatalog.sqlViewName:'IFIDUNLVLDISTR'@VDM.viewType:#COMPOSITE@EndUserText.label:'DunningLevelDistribution'@Analytics:{dataCategory:#CUBE}@Analytics.intern......
  • CDS标准视图:催款冻结 I_DunningBlockingReasonCode
    视图名称:催款冻结I_DunningBlockingReasonCode视图类型:基础视图视图代码:点击查看代码@EndUserText.label:'DunningBlockingReasonCode'@Analytics:{dataCategory:#DIMENSION}@VDM.viewType:#BASIC@AbapCatalog.sqlViewName:'IFIDUNBLOCKREAS'@AbapCatalog.co......
  • CDS标准视图:催款冻结描述 I_DunningBlockingReasonText
    视图名称:催款冻结描述I_DunningBlockingReasonText视图类型:基础视图视图代码:点击查看代码@EndUserText.label:'DunningBlockingReason-Text'@Analytics.dataExtraction.enabled:true@VDM.viewType:#BASIC@AbapCatalog.sqlViewName:'IFIDUNBLREASONT'@AbapCatalo......
  • CDS标准视图:催款范围描述 I_DunningAreaText
    视图名称:催款范围描述I_DunningAreaText视图类型:视图代码:点击查看代码@EndUserText.label:'DunningArea-Text'@Analytics.dataExtraction.enabled:true@VDM.viewType:#BASIC@AbapCatalog.sqlViewName:'IFIDUNAREATEXT'@AbapCatalog.preserveKey:true@AbapCat......
  • CDS标准视图:催款范围 I_DunningArea
    视图名称:催款范围I_DunningArea视图类型:基础视图代码:点击查看代码@AccessControl.authorizationCheck:#CHECK//authoritycheckiswrong,forcompatibilityreasonsDCLremainsbutisalwaystrue@EndUserText.label:'DunningArea'@Analytics:{dataCategory:#......
  • CDS标准视图:银行对账单行项目 I_BankStatementItem
    视图名称:银行对账单行项目I_BankStatementItem视图类型:基础视图视图代码:点击查看代码@AbapCatalog.sqlViewName:'IBANKSTATMENTITM'@AbapCatalog.compiler.compareFilter:true@AbapCatalog.preserveKey:true@AccessControl.authorizationCheck:#CHECK@EndUserText.l......
  • CDS标准视图:银行对账单抬头 I_BankStatement
    视图名称:银行对账单抬头I_BankStatement视图类型:基础视图代码:点击查看代码事务代码:FF67/视图结构:字段名称技术名称短代码BANKSTATEMENTSHORTID公司代码COMPANYCODE开户行HOUSEBANK开户行账户标识HOUSEBANKACCOUNT银行对账单编号BANKSTATEMEN......
  • CDS标准视图:会计员 I_AccountingClerk
    视图名称:会计员I_AccountingClerk视图类型:基础视图代码:点击查看代码@AbapCatalog:{sqlViewName:'IFIACCCLERK',//compiler.compareFilter:true,preserveKey:true}@AccessControl.authorizationCheck:#CHECK@Analytics:{dataCa......
  • Eclipse 透视图
    透视图是一个包含一系列视图和内容编辑器的可视容器。默认的透视图叫java。Eclipse窗口可以打开多个透视图,但在同一时间只能有一个透视图处于激活状态。用户可以在两个透视图之间切换。操作透视图通过"Window"菜单并选择"OpenPerspective>Other"来打开透视图对话框。......