C_StRpOplAcctgDocumentItemCube

DDL: C_STRPOPLACCTGDOCUMENTITEMCUBE SQL: CSROPACCTDOCITCU Type: view CONSUMPTION

Opl Acc.Doc.Item Cube for Stat.Reporting

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

Data Sources (1)

SourceAliasJoin Type
I_OperationalAcctgDocItem I_OperationalAcctgDocItem from

Associations (1)

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

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName CSROPACCTDOCITCU view
AbapCatalog.preserveKey true view
VDM.viewType #CONSUMPTION view
Analytics.dataCategory #CUBE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
EndUserText.label Opl Acc.Doc.Item Cube for Stat.Reporting view
Metadata.allowExtensions true view

Fields (58)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode CompanyCode
KEY AccountingDocument AccountingDocument
KEY FiscalYear FiscalYear
KEY AccountingDocumentItem AccountingDocumentItem
KEY StatryRptgEntity _ReportedItemsLog StatryRptgEntity
KEY StatryRptCategory _ReportedItemsLog StatryRptCategory
KEY StatryRptRunID _ReportedItemsLog StatryRptRunID
PostingDate PostingDate
DocumentDate DocumentDate
ChartOfAccounts ChartOfAccounts
GLAccount GLAccount
GLAccountLongName
Supplier Supplier
SupplierName _Supplier SupplierName
Customer Customer
CustomerName _Customer CustomerName
AccountingDocumentType AccountingDocumentType
PostingKey PostingKey
FinancialAccountType FinancialAccountType
SpecialGLCode SpecialGLCode
AccountingDocumentCategory AccountingDocumentCategory
DebitCreditCode DebitCreditCode
AssignmentReference AssignmentReference
DocumentItemText DocumentItemText
DocumentReferenceID _JournalEntry DocumentReferenceID
AccountingDocCreatedByUser _JournalEntry AccountingDocCreatedByUser
TransactionDate
TransactionCurrency TransactionCurrency
curr232endasDebitAmountInTransCrcy
curr232endasCreditAmountInTransCrcy
CompanyCodeCurrency CompanyCodeCurrency
curr232endasDebitAmountInCoCodeCrcy
curr232endasCreditAmountInCoCodeCrcy
ClearingDate ClearingDate
ClearingAccountingDocument ClearingAccountingDocument
ClearingDocFiscalYear ClearingDocFiscalYear
ClearingJournalEntry ClearingJournalEntry
ClearingJournalEntryFiscalYear ClearingJournalEntryFiscalYear
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_JournalEntry _JournalEntry
_ChartOfAccounts _ChartOfAccounts
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_GLAccountInCompanyCode _GLAccountInCompanyCode
_Supplier _Supplier
_Customer _Customer
_AccountingDocumentType _AccountingDocumentType
_PostingKey _PostingKey
_FinancialAccountType _FinancialAccountType
_SpecialGLCode _SpecialGLCode
_AccountingDocumentCategory _AccountingDocumentCategory
_DebitCreditCode _DebitCreditCode
_TransactionCurrency _TransactionCurrency
_CompanyCodeCurrency _CompanyCodeCurrency
_ClearingJrnlEntryFiscalYear _ClearingJrnlEntryFiscalYear
_ClearingJournalEntry _ClearingJournalEntry
_ClearingAccountingDocument _ClearingAccountingDocument
_ReportedItemsLog _ReportedItemsLog
@AbapCatalog.sqlViewName: 'CSROPACCTDOCITCU'
@AbapCatalog.preserveKey:true
@VDM.viewType: #CONSUMPTION
@Analytics: { dataCategory: #CUBE }
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass:  #MIXED
@AccessControl.personalData.blocking:#BLOCKED_DATA_EXCLUDED
@EndUserText.label: 'Opl Acc.Doc.Item Cube for Stat.Reporting'
@Metadata.allowExtensions:true
define view C_StRpOplAcctgDocumentItemCube as select from I_OperationalAcctgDocItem 
  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: '_JournalEntry'

//If annotation _JournalEntry is used the analytical query returns the AccountingDocument number into ABAP in format CCCCYYYYNNNNNNNNNN

//however in CHAR10 field (this is CCCCYYYYNN) and the original document number can't be retrieved from such field

key AccountingDocument,
@ObjectModel.foreignKey.association: '_FiscalYear'
key FiscalYear,
key AccountingDocumentItem,

key _ReportedItemsLog.StatryRptgEntity as StatryRptgEntity,
key _ReportedItemsLog.StatryRptCategory as StatryRptCategory,
key _ReportedItemsLog.StatryRptRunID as StatryRptRunID,

//Dates

PostingDate,
DocumentDate,
@ObjectModel.foreignKey.association: '_ChartOfAccounts' 
ChartOfAccounts,
//GLAccount, Supplier, Customer

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

@ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
GLAccount,
_GLAccountInChartOfAccounts._Text[1: Language = $session.system_language].GLAccountLongName as GLAccountLongName,
//_GLAccountInChartOfAccounts._Text[1: Language = $session.system_language].GLAccountLongName as GLAccountLongName,

@ObjectModel.foreignKey.association: '_Supplier'
Supplier,
_Supplier.SupplierName,

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

//Important fields

@ObjectModel.foreignKey.association: '_AccountingDocumentType'
AccountingDocumentType,
@ObjectModel.foreignKey.association: '_PostingKey'
PostingKey,                   //BSCHL

@ObjectModel.foreignKey.association: '_FinancialAccountType'
FinancialAccountType,         //KOART

@ObjectModel.foreignKey.association: '_SpecialGLCode'
SpecialGLCode,                //UMSKZ

@ObjectModel.foreignKey.association: '_AccountingDocumentCategory'
AccountingDocumentCategory,   //BSTAT

@ObjectModel.foreignKey.association: '_DebitCreditCode'
DebitCreditCode,              //SHKZG

AssignmentReference,          //ZUONR

DocumentItemText,             //SGTXT


//BKPF fields

_JournalEntry.DocumentReferenceID,
_JournalEntry.AccountingDocCreatedByUser,
cast( coalesce( _JournalEntry.JrnlEntryCntrySpecificDate1, '' ) as datum ) as TransactionDate,

//Amounts in Transaction currency 

@Semantics.currencyCode:true 
@ObjectModel.foreignKey.association: '_TransactionCurrency'
TransactionCurrency,

@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} } 
case DebitCreditCode
  when 'S' then AmountInTransactionCurrency
  else cast( '0' as abap.curr( 23,2))                        
end as DebitAmountInTransCrcy,                //Debit amount


@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} } 
case DebitCreditCode
  when 'H' then -AmountInTransactionCurrency
  else cast( '0' as abap.curr( 23,2))               
end as CreditAmountInTransCrcy,               //Credit transactions


//Amounts in Company code currency

@Semantics.currencyCode:true 
@ObjectModel.foreignKey.association: '_CompanyCodeCurrency'
CompanyCodeCurrency,

@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} } 
case DebitCreditCode
  when 'S' then AmountInCompanyCodeCurrency
  else cast( '0' as abap.curr( 23,2))                        
end as DebitAmountInCoCodeCrcy,                //Debit amount


@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} } 
case DebitCreditCode
  when 'H' then -AmountInCompanyCodeCurrency
  else cast( '0' as abap.curr( 23,2))               
end as CreditAmountInCoCodeCrcy,                //Credit transactions


//Clearing

ClearingDate,
@API.element.releaseState: #DEPRECATED
@API.element.successor:    'ClearingJournalEntry'
@VDM.lifecycle.status:    #DEPRECATED
@VDM.lifecycle.successor: 'ClearingJournalEntry'
@ObjectModel.foreignKey.association: '_ClearingAccountingDocument'
ClearingAccountingDocument,
@API.element.releaseState: #DEPRECATED
@API.element.successor:    'ClearingJournalEntryFiscalYear'
@VDM.lifecycle.status:    #DEPRECATED
@VDM.lifecycle.successor: 'ClearingJournalEntryFiscalYear'
@Semantics.fiscal.year: true
ClearingDocFiscalYear,
@Analytics.internalName: #LOCAL
@ObjectModel.foreignKey.association: '_ClearingJournalEntry'
ClearingJournalEntry,
@Analytics.internalName: #LOCAL
@ObjectModel.foreignKey.association: '_ClearingJrnlEntryFiscalYear'
ClearingJournalEntryFiscalYear,

/*_ReportedItemsLog.StatryRptgEntity as StatryRptgEntity,
_ReportedItemsLog.StatryRptCategory as StatryRptCategory,
_ReportedItemsLog.StatryRptRunID as StatryRptRunID,
*/

//Associations

_CompanyCode,
_FiscalYear,
_JournalEntry,
_ChartOfAccounts,
_GLAccountInChartOfAccounts,
_GLAccountInCompanyCode,
_Supplier,
_Customer,
_AccountingDocumentType,
_PostingKey,
_FinancialAccountType,
_SpecialGLCode,
_AccountingDocumentCategory,
_DebitCreditCode,
_TransactionCurrency,
_CompanyCodeCurrency,
_ClearingJrnlEntryFiscalYear,
_ClearingJournalEntry,
@API.element.releaseState: #DEPRECATED
@API.element.successor:    '_ClearingJournalEntry'
@VDM.lifecycle.status:    #DEPRECATED
@VDM.lifecycle.successor: '_ClearingJournalEntry'
_ClearingAccountingDocument,
_ReportedItemsLog

}
  
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CUSTOMER",
"I_GLACCOUNTINCHARTOFACCOUNTS",
"I_GLACCOUNTTEXT",
"I_JOURNALENTRY",
"I_OPERATIONALACCTGDOCITEM",
"I_STRPJOURNALENTRYLOG",
"I_SUPPLIER"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENT",
"I_ACCOUNTINGDOCUMENTCATEGORY",
"I_ACCOUNTINGDOCUMENTTYPE",
"I_CHARTOFACCOUNTS",
"I_COMPANYCODE",
"I_CURRENCY",
"I_CUSTOMER",
"I_DEBITCREDITCODE",
"I_FINANCIALACCOUNTTYPE",
"I_FISCALYEARFORCOMPANYCODE",
"I_GLACCOUNTINCHARTOFACCOUNTS",
"I_GLACCOUNTINCOMPANYCODE",
"I_JOURNALENTRY",
"I_POSTINGKEY",
"I_SPECIALGLCODE",
"I_STRPJOURNALENTRYLOG",
"I_SUPPLIER"
],
"BASE":
[
"I_OPERATIONALACCTGDOCITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/