C_StRpOverdueInvoicesCube

DDL: C_STRPOVERDUEINVOICESCUBE SQL: CSROVRDUEINVC Type: view CONSUMPTION

Overdue Invoices Cube for Stat.Reporting

C_StRpOverdueInvoicesCube is a Consumption CDS View (Cube) that provides data about "Overdue Invoices Cube for Stat.Reporting" in SAP S/4HANA. It reads from 1 data source (I_OperationalAcctgDocItem) and exposes 47 fields with key fields CompanyCode, FiscalYear, AccountingDocument, AccountingDocumentItem, StatryRptgEntity. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_OperationalAcctgDocItem I_OperationalAcctgDocItem from

Parameters (1)

NameTypeDefault
P_KeyDate fipl_keydate

Associations (1)

CardinalityTargetAliasCondition
[0..*] I_StRpJournalEntryLog _ReportedItemsLog _ReportedItemsLog.CompanyCode = $projection.CompanyCode and _ReportedItemsLog.AccountingDocument = $projection.AccountingDocument and _ReportedItemsLog.FiscalYear = $projection.FiscalYear

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName CSROVRDUEINVC view
AbapCatalog.preserveKey true view
VDM.viewType #CONSUMPTION view
Analytics.dataCategory #CUBE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Overdue Invoices Cube for Stat.Reporting view
Metadata.allowExtensions true view

Fields (47)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode CompanyCode
KEY FiscalYear FiscalYear
KEY AccountingDocument AccountingDocument
KEY AccountingDocumentItem AccountingDocumentItem
KEY StatryRptgEntity _ReportedItemsLog StatryRptgEntity
KEY StatryRptCategory _ReportedItemsLog StatryRptCategory
KEY StatryRptRunID _ReportedItemsLog StatryRptRunID
DocumentReferenceID _JournalEntry DocumentReferenceID
AccountingDocumentType AccountingDocumentType
DocumentDate DocumentDate
PostingDate PostingDate
TaxReportingDate _JournalEntry TaxReportingDate
Customer Customer
CustomerName _Customer CustomerName
Supplier Supplier
SupplierName _Supplier SupplierName
DueCalculationBaseDate DueCalculationBaseDate
NetDueDate NetDueDate
PaymentTerms PaymentTerms
CashDiscount1Days CashDiscount1Days
CashDiscount2Days CashDiscount2Days
NetPaymentDays NetPaymentDays
CashDiscount1Percent CashDiscount1Percent
CashDiscount2Percent CashDiscount2Percent
GLAccount GLAccount
AmountInTransactionCurrency AmountInTransactionCurrency
AmountInCompanyCodeCurrency AmountInCompanyCodeCurrency
TransactionCurrency TransactionCurrency
CompanyCodeCurrency CompanyCodeCurrency
DebitCreditCode DebitCreditCode
TaxCode TaxCode
DocumentItemText DocumentItemText
ClearingDate ClearingDate
IsCleared
NetDueDays
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_AccountingDocumentType _AccountingDocumentType
_ReportedItemsLog _ReportedItemsLog
_DebitCreditCode _DebitCreditCode
_Customer _Customer
_Supplier _Supplier
_JournalEntry _JournalEntry
_TransactionCurrency _TransactionCurrency
_CompanyCodeCurrency _CompanyCodeCurrency
ChartOfAccounts I_OperationalAcctgDocItem ChartOfAccounts
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
@AbapCatalog.sqlViewName: 'CSROVRDUEINVC'
@AbapCatalog.preserveKey:true
@VDM.viewType: #CONSUMPTION 
@Analytics: { dataCategory: #CUBE }
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #NOT_REQUIRED
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass:  #MIXED
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Overdue Invoices Cube for Stat.Reporting'
@Metadata.allowExtensions:true
define view C_StRpOverdueInvoicesCube with parameters
  P_KeyDate    : fipl_keydate 
  
as select from I_OperationalAcctgDocItem  // I_OperationalAcctgDocCube


association [0..*] to I_StRpJournalEntryLog as _ReportedItemsLog
                      on  _ReportedItemsLog.CompanyCode        = $projection.CompanyCode
                      and _ReportedItemsLog.AccountingDocument = $projection.AccountingDocument
                      and _ReportedItemsLog.FiscalYear         = $projection.FiscalYear     
{
@ObjectModel.foreignKey.association: '_CompanyCode'
key CompanyCode,
@ObjectModel.foreignKey.association: '_FiscalYear'
key FiscalYear,
key AccountingDocument,     
key AccountingDocumentItem,  // buzei


// ACR Part

key _ReportedItemsLog.StatryRptgEntity as StatryRptgEntity,
key _ReportedItemsLog.StatryRptCategory as StatryRptCategory,
key _ReportedItemsLog.StatryRptRunID as StatryRptRunID,
  
_JournalEntry.DocumentReferenceID,
@ObjectModel.foreignKey.association: '_AccountingDocumentType'
AccountingDocumentType,  
DocumentDate,            
PostingDate,             
_JournalEntry.TaxReportingDate as TaxReportingDate,
@ObjectModel.foreignKey.association: '_Customer'
Customer,
_Customer.CustomerName,
@ObjectModel.foreignKey.association: '_Supplier'
Supplier, 
_Supplier.SupplierName,
DueCalculationBaseDate,
NetDueDate,
PaymentTerms,
CashDiscount1Days,
CashDiscount2Days,
NetPaymentDays,
@DefaultAggregation: #MAX
CashDiscount1Percent,
@DefaultAggregation: #MAX
CashDiscount2Percent,

@ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
GLAccount,
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
AmountInTransactionCurrency,
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
AmountInCompanyCodeCurrency,
@ObjectModel.foreignKey.association: '_TransactionCurrency'
TransactionCurrency,
@ObjectModel.foreignKey.association: '_CompanyCodeCurrency'
CompanyCodeCurrency,
@ObjectModel.foreignKey.association: '_DebitCreditCode'
DebitCreditCode,              //SHKZG

TaxCode,
DocumentItemText,

//@todo

//@AnalyticsDetails.query.axis: #ROWS

//_JournalEntry.SettlementFiscalYearPeriod,


ClearingDate,

// Computed fields

// If the invoice is cleared: ClearingDate - NetDueDate. 

// If the invoice is not cleared: KeyDate - NetDueDate.

dats_is_valid( ClearingDate ) as IsCleared, 
  
case ClearingDate
  when '00000000' then dats_days_between( NetDueDate, :P_KeyDate ) 
  else dats_days_between( NetDueDate, ClearingDate )  
end as NetDueArrearsDays,


dats_days_between( DueCalculationBaseDate, NetDueDate ) as NetDueDays,

// Associations

_CompanyCode,
_FiscalYear,
_AccountingDocumentType,
_ReportedItemsLog,
_DebitCreditCode,
_Customer,
_Supplier,
_JournalEntry,
_TransactionCurrency,
_CompanyCodeCurrency,
I_OperationalAcctgDocItem.ChartOfAccounts,
_GLAccountInChartOfAccounts
}
// Where ..

where (  FinancialAccountType = 'K' or FinancialAccountType = 'D' ) and
      AccountingDocumentCategory <> 'D' and  //BSTAT 'D' - recurring entry

      AccountingDocumentCategory <> 'M' and  //BSTAT 'M' - sample

      AccountingDocumentCategory <> 'S'       //BSTAT 'S' - noted

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CUSTOMER",
"I_JOURNALENTRY",
"I_OPERATIONALACCTGDOCITEM",
"I_STRPJOURNALENTRYLOG",
"I_SUPPLIER"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENTTYPE",
"I_COMPANYCODE",
"I_CURRENCY",
"I_CUSTOMER",
"I_DEBITCREDITCODE",
"I_FISCALYEARFORCOMPANYCODE",
"I_GLACCOUNTINCHARTOFACCOUNTS",
"I_JOURNALENTRY",
"I_STRPJOURNALENTRYLOG",
"I_SUPPLIER"
],
"BASE":
[
"I_OPERATIONALACCTGDOCITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/