首页 > 其他分享 >CDS标准视图:销售变现天数 I_DaysSalesOutstanding

CDS标准视图:销售变现天数 I_DaysSalesOutstanding

时间:2025-01-10 10:57:02浏览次数:1  
标签:Customer projection .. ObjectModel foreignKey 视图 CDS association DaysSalesOutsta

视图名称:销售变现天数 I_DaysSalesOutstanding

视图类型:参数

视图代码:

点击查看代码
@AbapCatalog.sqlViewName: 'IFIDAYSSLSOUTSTG'
@AbapCatalog.compiler.compareFilter:true
@AbapCatalog.preserveKey:true
@VDM.viewType: #COMPOSITE
@EndUserText.label: 'Days Sales Outstanding'
@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
@AccessControl.authorizationCheck:#CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@DataAging.noAgingRestriction: true // cleared open items are selected (as "revenue")
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.supportedCapabilities: [ #ANALYTICAL_PROVIDER, #CDS_MODELING_DATA_SOURCE ]
@AccessControl.personalData.blocking: #REQUIRED
@Metadata.allowExtensions: true

define view I_DaysSalesOutstanding
  with parameters
    P_RblsRollingAverageMonths : fis_rbls_rolling_avg_months,
    P_RevnRollingAverageMonths : fis_revn_rolling_avg_months,
    @Environment.systemField: #SYSTEM_DATE
    P_TodayDate                : sydate,
    P_DisplayCurrency          : vdm_v_display_currency,
    P_ExchangeRateType         : kurst
  as select from P_DaysSalesOutstanding04( P_RblsRollingAverageMonths: :P_RblsRollingAverageMonths,
                                            P_RevnRollingAverageMonths: :P_RevnRollingAverageMonths,
                                            P_DisplayCurrency:          :P_DisplayCurrency,
                                            P_ExchangeRateType:         :P_ExchangeRateType,
                                            P_TodayDate:                :P_TodayDate )

  association [0..1] to I_UnitOfMeasure              as _UnitOfMeasure         on  _UnitOfMeasure.UnitOfMeasure = $projection.DurationUnit
  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_CalendarYear               as _CalendarYear          on  _CalendarYear.CalendarYear = $projection.CalendarYear
  association [0..1] to I_CalendarMonth              as _CalendarMonth         on  _CalendarMonth.CalendarMonth = $projection.CalendarMonth
  association [0..1] to I_ChartOfAccounts            as _ChartOfAccounts       on  _ChartOfAccounts.ChartOfAccounts = $projection.ChartOfAccounts
  association [0..1] to I_GLAccountInChartOfAccounts as _ReconciliationAccount on  _ReconciliationAccount.ChartOfAccounts = $projection.ChartOfAccounts
                                                                               and _ReconciliationAccount.GLAccount       = $projection.ReconciliationAccount
  association [0..1] to I_SpecialGLCode              as _SpecialGLCode              on  _SpecialGLCode.SpecialGLCode        = $projection.SpecialGLCode
                                                                                    and _SpecialGLCode.FinancialAccountType = 'D'
  association [0..1] to I_GLAccountInChartOfAccounts as _GLAccountInChartOfAccounts on  _GLAccountInChartOfAccounts.ChartOfAccounts = $projection.ChartOfAccounts
                                                                                    and _GLAccountInChartOfAccounts.GLAccount       = $projection.GLAccount
  association [0..1] to I_Currency                   as _DisplayCurrency       on  _DisplayCurrency.Currency = $projection.DisplayCurrency

  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: '_CalendarYear'
  key CalendarYear,
      @ObjectModel.foreignKey.association: '_CalendarMonth'
  key CalendarMonth,
      @ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
  key GLAccount,
      @ObjectModel.foreignKey.association: '_SpecialGLCode'
  key SpecialGLCode,
  // technically FinancialAccountType is independent of all other keys, hence it is a key itself
  // FinancialAccountType is restricted to 'D' but as we exposed it before let's keep it
      @ObjectModel.foreignKey.association: '_FinancialAccountType'
  key FinancialAccountType,

      cast( YearMonth as fis_yearmonth_c )                                              as YearMonth,

      //  @ObjectModel.foreignKey.association: '_ExchangeRate'
      cast(:P_ExchangeRateType as kurst)                                                as 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: '_UnitOfMeasure'
      cast( cast( 'TAG' as abap.unit(3) ) as msehi )                                    as DurationUnit,
      @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'
      cast( DisplayCurrency as vdm_v_display_currency )                                 as DisplayCurrency,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
  cast(DIVISION(DebitInDisplayCrcy, :P_RblsRollingAverageMonths, 6) as abap.curr( 27, 6 ))       as DebitAmtInDisplayCrcy,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
  cast(DIVISION(RevenueInDisplayCrcy, :P_RevnRollingAverageMonths, 6) as abap.curr( 27, 6 ))     as RevenueAmountInDisplayCrcy,

      _Company,
      _Customer,
      _FinancialAccountType,
      _CustomerCompany,
      _AccountingClerk,
      _CustomerCountry,
      _CustomerRegion,
      _CalendarYear,
      _CalendarMonth,
      _ReconciliationAccount,
      _SpecialGLCode,
      _GLAccountInChartOfAccounts,
      _ChartOfAccounts,
      _DisplayCurrency,
      _UnitOfMeasure,
      _CustomerClassification,
      _CustomerAccountGroup
}



















事务代码:参数

应收账款移动平均值:用于输入从当前月份开始的月数,未结应收账款
收入移动平均值:用于输入从当前月份开始的月数,了收入
汇率类型:显示的汇率类型
CDATE:当前日期,用于确认超期天数
显示货币:显示的货币类型

计算逻辑

视图结构:

字段名称 技术名称
公司代码 COMPANYCODE
客户 CUSTOMER
日历年 CALENDARYEAR
日历月 CALENDARMONTH
总账科目 GLACCOUNT
特殊总账 SPECIALGLCODE
科目类型 FINANCIALACCOUNTTYPE
月年 YEARMONTH
汇率类型 EXCHANGERATETYPE
国家/地区代码 CUSTOMERCOUNTRY
地区 CUSTOMERREGION
会计员 ACCOUNTINGCLERK
内部计量单位 DURATIONUNIT
科目表 CHARTOFACCOUNTS
对账科目 RECONCILIATIONACCOUNT
客户基本权限组 CUSTOMERBASICAUTHORIZATIONGRP
权限 CUSTOMERFINSAUTHORIZATIONGRP
客户科目组 CUSTOMERACCOUNTGROUP
客户分类 CUSTOMERCLASSIFICATION
显示货币 DISPLAYCURRENCY
DEBITAMTINDISPLAYCRCY
REVENUEAMOUNTINDISPLAYCRCY

标签:Customer,projection,..,ObjectModel,foreignKey,视图,CDS,association,DaysSalesOutsta
From: https://www.cnblogs.com/guanxing/p/18663579

相关文章

  • CDS标准视图:总计应收款 I_TotalAccountsReceivables
    视图名称:总计应收款I_TotalAccountsReceivables视图类型:参数视图代码:点击查看代码@AbapCatalog.sqlViewName:'IFITOTALACCTRBLS'@AbapCatalog.compiler.compareFilter:true@AbapCatalog.preserveKey:true@VDM.viewType:#COMPOSITE@EndUserText.label:'TotalAccounts......
  • 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......