I_StRpAccountingDocumentItmC

DDL: I_STRPACCOUNTINGDOCUMENTITMC SQL: ISRACCDOCITMC Type: view COMPOSITE Package: GLO_FIN_VAT_MENA

Accounting Document Item Cube for Statutory Reporting

I_StRpAccountingDocumentItmC is a Composite CDS View (Cube) that provides data about "Accounting Document Item Cube for Statutory Reporting" in SAP S/4HANA. It reads from 2 data sources (I_OperationalAcctgDocItem, I_StRpJournalEntryLog) and exposes 19 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem. Part of development package GLO_FIN_VAT_MENA.

Data Sources (2)

SourceAliasJoin Type
I_OperationalAcctgDocItem acctdocitm from
I_StRpJournalEntryLog ReportedItemsLog inner

Parameters (3)

NameTypeDefault
P_StatryRptgEntity srf_reporting_entity
P_StatryRptCategory srf_rep_cat_id
P_StatryRptRunID srf_report_run_id

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName ISRACCDOCITMC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Accounting Document Item Cube for Statutory Reporting view
VDM.viewType #COMPOSITE view
Analytics.dataCategory #CUBE view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
Metadata.allowExtensions true view

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_StRpJournalEntryLog CompanyCode
KEY AccountingDocument I_StRpJournalEntryLog AccountingDocument
KEY FiscalYear I_StRpJournalEntryLog FiscalYear
KEY AccountingDocumentItem I_OperationalAcctgDocItem AccountingDocumentItem
OriginRefDocBusObjTypeName
PostingDate I_OperationalAcctgDocItem PostingDate
DocumentDate I_OperationalAcctgDocItem DocumentDate
GLAccount I_OperationalAcctgDocItem GLAccount
GLAccountName
BPSupplierNameendasBusinessPartnerName1
OriginalReferenceDocument I_OperationalAcctgDocItem OriginalReferenceDocument
FinancialAccountType I_OperationalAcctgDocItem FinancialAccountType
TransactionCurrency I_OperationalAcctgDocItem TransactionCurrency
CompanyCodeCurrency I_OperationalAcctgDocItem CompanyCodeCurrency
AdditionalCurrency1 I_OperationalAcctgDocItem AdditionalCurrency1
AdditionalCurrency2 I_OperationalAcctgDocItem AdditionalCurrency2
DebitCreditCode I_OperationalAcctgDocItem DebitCreditCode
AccountingDocumentTypeName
DocumentItemText I_OperationalAcctgDocItem DocumentItemText
@AbapCatalog.sqlViewName: 'ISRACCDOCITMC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Accounting Document Item Cube for Statutory Reporting'
@VDM.viewType: #COMPOSITE
@Analytics: { dataCategory: #CUBE }
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED
@Metadata.allowExtensions: true
define view I_StRpAccountingDocumentItmC
  with parameters

    P_StatryRptgEntity  : srf_reporting_entity,
    P_StatryRptCategory : srf_rep_cat_id,
    P_StatryRptRunID    : srf_report_run_id

  as select from I_OperationalAcctgDocItem as acctdocitm
    inner join   I_StRpJournalEntryLog     as ReportedItemsLog on  ReportedItemsLog.mandt              = acctdocitm.mandt
                                                               and ReportedItemsLog.CompanyCode        = acctdocitm.CompanyCode
                                                               and ReportedItemsLog.AccountingDocument = acctdocitm.AccountingDocument
                                                               and ReportedItemsLog.FiscalYear         = acctdocitm.FiscalYear

{
  key ReportedItemsLog.CompanyCode,
  key ReportedItemsLog.AccountingDocument,
  key ReportedItemsLog.FiscalYear,
  key acctdocitm.AccountingDocumentItem,
      concat(concat(ReportedItemsLog.CompanyCode, ReportedItemsLog.AccountingDocument),ReportedItemsLog.FiscalYear) as OriginRefDocBusObjTypeName,
      acctdocitm.PostingDate,
      acctdocitm.DocumentDate,
      acctdocitm.GLAccount,
      _GLAccountInChartOfAccounts._Text[1: Language = $session.system_language ].GLAccountName,
      case FinancialAccountType
      when 'D' then _Customer.BPCustomerName
      when 'K' then _Supplier.BPSupplierName
      end                                                                                                           as BusinessPartnerName1,
      acctdocitm.OriginalReferenceDocument,
      acctdocitm.FinancialAccountType,
      @Semantics.currencyCode: true
      acctdocitm.TransactionCurrency,
      @Semantics.currencyCode:true
      acctdocitm.CompanyCodeCurrency,
      acctdocitm.AdditionalCurrency1,
      acctdocitm.AdditionalCurrency2,
      acctdocitm.DebitCreditCode,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case acctdocitm.DebitCreditCode
      when 'S' then acctdocitm.AmountInCompanyCodeCurrency
       end                                                                                                          as DebitAmountInCoCodeCrcy,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case acctdocitm.DebitCreditCode
       when 'H' then acctdocitm.AmountInCompanyCodeCurrency
      end                                                                                                           as CreditAmountInCoCodeCrcy,
      -----
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      case acctdocitm.DebitCreditCode
      when 'S' then acctdocitm.AmountInAdditionalCurrency1
       end                                                                                                          as DebitAmountInAddlCrcy1,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency1'
      case acctdocitm.DebitCreditCode
       when 'H' then acctdocitm.AmountInAdditionalCurrency1
      end                                                                                                           as CreditAmountInAddlCrcy1,
      --------
      -----
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      case acctdocitm.DebitCreditCode
      when 'S' then acctdocitm.AmountInAdditionalCurrency2
       end                                                                                                          as DebitAmountInAddlCrcy2,
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'AdditionalCurrency2'
      case acctdocitm.DebitCreditCode
       when 'H' then acctdocitm.AmountInAdditionalCurrency2
      end                                                                                                           as CreditAmountInAddlCrcy2,
      --------
      @DefaultAggregation:#SUM
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case acctdocitm.DebitCreditCode
      when 'S' then acctdocitm.AmountInCompanyCodeCurrency
      when 'H' then acctdocitm.AmountInCompanyCodeCurrency
      end                                                                                                           as GLAcctBalanceAmt,
      case acctdocitm.ReferenceDocumentType
      when   'VBRK' then concat(acctdocitm.CompanyCode, acctdocitm.OriginalReferenceDocument)
      when   'RMRP' then concat(acctdocitm.CompanyCode, acctdocitm.OriginalReferenceDocument)
      else
      ''
      end                                                                                                           as SourceDocumentText,
      // deriving Reporting Date (Country specific logic must be done in country specific views on top of I_StRpBPTaxItem)

      cast (
        case dats_is_valid(_JournalEntry.TaxReportingDate)
            when 1 then
              _JournalEntry.TaxReportingDate
            else
              _JournalEntry.PostingDate
        end
      as glo_reporting_date preserving type)                                                                        as ReportingDate,
      acctdocitm._AccountingDocumentType._Text[1: Language = $session.system_language ].AccountingDocumentTypeName,
      acctdocitm.DocumentItemText
}
where
      ReportedItemsLog.StatryRptgEntity  = :P_StatryRptgEntity
  and ReportedItemsLog.StatryRptCategory = :P_StatryRptCategory
  and ReportedItemsLog.StatryRptRunID    = :P_StatryRptRunID