Deprecated PUBLIC_LOCAL_API
This CDS view is deprecated in S/4HANA. Use I_JournalEntry instead. View all deprecated CDS views →

I_AccountingDocument

DDL: I_ACCOUNTINGDOCUMENT SQL: IFIACCDOC Type: view BASIC

Accounting Document

I_AccountingDocument (Basic)

Package: Explore, extend and adapt the SAP S/4HANA Cloud Private Edition with built-in and side-by-side extension capabilities.

Accounting and Financial Close

I_AccountingDocument is a Basic CDS View (Dimension) that provides data about "Accounting Document" in SAP S/4HANA. It reads from 1 data source (bkpf) and exposes 67 fields with key fields CompanyCode, FiscalYear, AccountingDocument. It has 18 associations to related views.

SAP Help Documentation

CategoryCDS Views for Master Data
Data CategoryDimension
Purpose
This CDS view is designed to represent accounting documents within a system. It provides a structured way to access and analyze accounting document data, including various attributes and associations related to accounting documents, for example, company code, fiscal year, and document type. This CDS view provides the data to answer the following business questions: What are the details of accounting documents for a specific company code and fiscal year? How can I retrieve the document type and category for a given accounting document? What is the posting date and document date for specific accounting documents? Who created a particular accounting document, and when was it created? To help you decide which CDS view to use for your purposes, SAP has introduced the annotation ObjectModel.supportedCapabilities that indicates the most appropriate use cases for each CDS view. To find out what use cases are best supported by this CDS view, access the entry of the CDS view in the View Browser app and find the values for this annotation under the Annotation tab. For more information, see Supported Capabilities for CDS Views .

Prerequisites
Authorizations Users who want to use this CDS view must have the following authorization objects assigned: Authorization Object Authorization Object Description F_BKPF_BUK Accounting Document: Authorization for Company Codes

Structure
Important Fields For an up-to-date list of the important fields, please search for this CDS view in the View Browser app. To open this app, you need to have the authorizations included in the SAP_BR_ANALYTICS_SPECIALIST role template assigned to your user.

View on SAP Help Portal →

SAP API Hub

StateC1
Line of BusinessAccounting and Financial Close
Application ComponentFI-FIO-GL-IS
CapabilitiesAnalytical Dimension, Association Target for Defining CDS Entities, Data Source for Defining CDS Entities, Data Source in SQL Select
PackageAccounting and Financial Close for SAP S/4HANA Cloud Private Edition
Description <p>This CDS view is designed to represent accounting documents within a system. It provides a structured way to access and analyze accounting document data, including various attributes and associations related to accounting documents, for example, company code, fiscal year, and document type.</p> <p>This CDS view provides the data to answer the following business questions:</p> <ul> <li><p>What are the details of accounting documents for a specific company code and fiscal year?</p></li> <li><p>How can I retrieve the document type and category for a given accounting document?</p></li> <li><p>What is the posting date and document date for specific accounting documents?</p></li> <li><p>Who created a particular accounting document, and when was it created?</p></li> </ul> <p>To help you decide which CDS view to use for your purposes, SAP has introduced the annotation ObjectModel.supportedCapabilities that indicates the most appropriate use cases for each CDS view. To find out what use cases are best supported by this CDS view, access the entry of the CDS view in the View Browser app and find the values for this annotation under the Annotation tab. For more information, see Supported Capabilities for CDS Views.</p>

Documentation

Data Sources (1)

SourceAliasJoin Type
bkpf bkpf from

Associations (18)

CardinalityTargetAliasCondition
[0..*] I_AccountingDocumentTypeText _AccountingDocumentTypeText $projection.AccountingDocumentType = _AccountingDocumentTypeText.AccountingDocumentType
[0..*] I_BusTransactionTypeText _BusinessTransactionTypeText $projection.BusinessTransactionType = _BusinessTransactionTypeText.BusinessTransactionType
[0..*] I_LedgerText _LedgerText $projection.Ledger = _LedgerText.Ledger
[0..*] I_OperationalAcctgDocItem _OperationalAcctgDocItem $projection.CompanyCode = _OperationalAcctgDocItem.CompanyCode and $projection.AccountingDocument = _OperationalAcctgDocItem.AccountingDocument and $projection.FiscalYear = _OperationalAcctgDocItem.FiscalYear and $projection.FiscalPeriod = _OperationalAcctgDocItem.FiscalPeriod and $projection.AccountingDocumentCategory = _OperationalAcctgDocItem.AccountingDocumentCategory and $projection.PostingDate = _OperationalAcctgDocItem.PostingDate and $projection.DocumentDate = _OperationalAcctgDocItem.DocumentDate and $projection.AccountingDocumentType = _OperationalAcctgDocItem.AccountingDocumentType
[1..1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode
[0..1] I_FiscalYearForCompanyCode _FiscalYear $projection.FiscalYear = _FiscalYear.FiscalYear and $projection.CompanyCode = _FiscalYear.CompanyCode
[0..1] I_AccountingDocumentType _AccountingDocumentType $projection.AccountingDocumentType = _AccountingDocumentType.AccountingDocumentType
[0..1] I_User _User $projection.AccountingDocCreatedByUser = _User.UserID
[0..1] I_AccountingDocumentCategory _AccountingDocumentCategory $projection.AccountingDocumentCategory = _AccountingDocumentCategory.AccountingDocumentCategory
[0..1] I_BusinessTransactionType _BusinessTransactionType $projection.BusinessTransactionType = _BusinessTransactionType.BusinessTransactionType
[0..1] I_ReferenceDocumentType _ReferenceDocumentType $projection.ReferenceDocumentType = _ReferenceDocumentType.ReferenceDocumentType
[0..1] I_Ledger _Ledger $projection.Ledger = _Ledger.Ledger
[0..1] I_LedgerGroup _LedgerGroup $projection.LedgerGroup = _LedgerGroup.LedgerGroup
[0..1] I_Currency _Currency $projection.Currency = _Currency.Currency
[0..1] I_Currency _CompanyCodeCurrency $projection.CompanyCodeCurrency = _CompanyCodeCurrency.Currency
[0..1] I_Currency _AdditionalCurrency1 $projection.AdditionalCurrency1 = _AdditionalCurrency1.Currency
[0..1] I_Currency _AdditionalCurrency2 $projection.AdditionalCurrency2 = _AdditionalCurrency2.Currency
[0..1] I_LogicalSystem _LogicalSystem $projection.ReferenceDocumentLogicalSystem = _LogicalSystem.LogicalSystem

Annotations (19)

NameValueLevelField
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Accounting Document view
Analytics.dataCategory #DIMENSION view
VDM.viewType #BASIC view
AbapCatalog.sqlViewName IFIACCDOC view
AccessControl.authorizationCheck #CHECK view
ObjectModel.representativeKey AccountingDocument view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #A view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.buffering.status #NOT_ALLOWED view
AbapCatalog.preserveKey true view
Metadata.ignorePropagatedAnnotations true view
Metadata.allowExtensions true view
ObjectModel.modelingPattern #ANALYTICAL_DIMENSION view
VDM.lifecycle.status #DEPRECATED view
VDM.lifecycle.successor I_JournalEntry view

Fields (67)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode Company Code
KEY FiscalYear Settlement Year
KEY AccountingDocument Journal Entry
AccountingDocumentType Rep. rec. doc. type
DocumentDate Journal Entry Date
PostingDate Posting Date
FiscalPeriod Fiscal Period
FiscalPeriod Fiscal Period
AccountingDocumentCreationDate Accounting Document Entry Date
CreationTime Creation Time
LastChangeDate Last Change Date
ExchangeRateDate Exchange Rate Date
AccountingDocCreatedByUser User that created the journal entry
TransactionCode tcode Undefined range (can be used for patch levels)
IntercompanyTransaction Intercompany Transaction Number
DocumentReferenceID xblnr Reference Document Number
RecurringAccountingDocument Recurring Journal Entry
ReverseDocument stblg Reverse Document Number
ReverseDocumentFiscalYear stjah Fiscal Year of Reversal Document
AccountingDocumentHeaderText bktxt Document Header Text
ExchangeRate Exchange Rate
GroupCurrency kzwrs Currency Key for the Group Currency
AccountingDocumentCategory Document Status
BusinessTransactionType Business Transaction Category
BatchInputSession Batch Input Session Name
ReferenceDocumentType Reference Document Type
OriginalReferenceDocument RefKey GJE
FinancialManagementArea fikrs Financial Management Area
ReferenceDocumentLogicalSystem Logical System of Reference Document
Branch brnch Business Place
IsDiscountDocument adisc Indicator: entry represents a discount document
Reference1InDocumentHeader Internal ID of Reference Key 1 in Document Header
Reference2InDocumentHeader Internal ID of Reference Key 2 in Document Header
InvoiceReceiptDate reindat Invoice Receipt Date
Ledger Ledger (Compat.)
LedgerGroup ldgrp Target Ledger Group
AlternativeReferenceDocument Alternative Reference Document
IsReversal Indicator: Item is Reversing Another Item
IsReversed Indicator: Item is Reversed
TaxReportingDate vatdate Tax Reporting Date
ReversalReason stgrd Reason for Reversal or Inverse Posting
ParkingDate ppdat Day of Parking of Accounting Document
ParkingTime pptme Time of Parking
Currency Transaction Currency
CompanyCodeCurrency Company Code Currency
AdditionalCurrency1 Additional Currency 1
AdditionalCurrency2 Additional Currency 2
TaxIsCalculatedAutomatically xmwst Calculate Tax Automatically
NmbrOfPages numpg Number of pages of invoice
_OperationalAcctgDocItem _OperationalAcctgDocItem
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_AccountingDocumentType _AccountingDocumentType
_AccountingDocumentCategory _AccountingDocumentCategory
_BusinessTransactionType _BusinessTransactionType
_ReferenceDocumentType _ReferenceDocumentType
_Ledger _Ledger
_LedgerGroup _LedgerGroup
_User _User
_Currency _Currency
_CompanyCodeCurrency _CompanyCodeCurrency
_AdditionalCurrency1 _AdditionalCurrency1
_AdditionalCurrency2 _AdditionalCurrency2
_LogicalSystem _LogicalSystem
_AccountingDocumentTypeText _AccountingDocumentTypeText
_BusinessTransactionTypeText _BusinessTransactionTypeText
_LedgerText _LedgerText

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view I_AccountingDocument.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: IFIACCDOC

CREATE VIEW I_AccountingDocument AS
SELECT
  cast(bukrs as fis_bukrs preserving type) AS CompanyCode,
  cast(gjahr as fis_gjahr preserving type) AS FiscalYear,
  cast(belnr as farp_belnr_d preserving type) AS AccountingDocument,
  cast(blart as farp_blart preserving type) AS AccountingDocumentType,
  cast(bldat as fis_bldat preserving type) AS DocumentDate,
  cast(budat as fis_budat preserving type) AS PostingDate,
  cast( cast( concat( '0', monat ) as abap.numc( 3 ) ) as fins_fiscalperiod) AS FiscalPeriod,
  cast(cpudt as farp_cpudt preserving type) AS AccountingDocumentCreationDate,
  cast(cputm as ttet_dt_cr_time preserving type) AS CreationTime,
  cast(aedat as ttet_dt_chg_date preserving type) AS LastChangeDate,
  cast(wwert as vdm_v_exchange_rate_date preserving type) AS ExchangeRateDate,
  cast(usnam as fis_usnam preserving type) AS AccountingDocCreatedByUser,
  tcode AS TransactionCode,
  cast(bvorg as fac_bvorg preserving type) AS IntercompanyTransaction,
  xblnr AS DocumentReferenceID,
  cast(dbblg as fac_rjet_id preserving type) AS RecurringAccountingDocument,
  stblg AS ReverseDocument,
  stjah AS ReverseDocumentFiscalYear,
  bktxt AS AccountingDocumentHeaderText,
  cast(kursf as ukurs_curr preserving type) AS ExchangeRate,
  kzwrs AS GroupCurrency,
  cast(bstat as farp_bstat_d preserving type) AS AccountingDocumentCategory,
  cast(glvor as fins_bttype preserving type) AS BusinessTransactionType,
  cast(grpid as fac_grpid preserving type) AS BatchInputSession,
  cast(awtyp as fis_awtyp) AS ReferenceDocumentType,
  cast(awkey as fac_awkey) AS OriginalReferenceDocument,
  fikrs AS FinancialManagementArea,
  cast(awsys as fis_awsys) AS ReferenceDocumentLogicalSystem,
  brnch AS Branch,
  adisc AS IsDiscountDocument,
  cast(xref1_hd as fins_xref1_hd) AS Reference1InDocumentHeader,
  cast(xref2_hd as fins_xref2_hd) AS Reference2InDocumentHeader,
  reindat AS InvoiceReceiptDate,
  cast(rldnr as fis_rldnr preserving type) AS Ledger,
  ldgrp AS LedgerGroup,
  cast(xblnr_alt as fac_xblnr_alt preserving type) AS AlternativeReferenceDocument,
  cast(xreversing as fins_xreversing) AS IsReversal,
  cast(xreversed as fins_xreversed) AS IsReversed,
  vatdate AS TaxReportingDate,
  stgrd AS ReversalReason,
  ppdat AS ParkingDate,
  pptme AS ParkingTime,
  cast(waers as waers preserving type) AS Currency,
  cast(hwaer as fis_hwaer preserving type) AS CompanyCodeCurrency,
  cast(hwae2 as fis_hwae2 preserving type) AS AdditionalCurrency1,
  cast(hwae3 as fis_hwae3 preserving type) AS AdditionalCurrency2,
  xmwst AS TaxIsCalculatedAutomatically,
  numpg AS NmbrOfPages
FROM bkpf
LEFT OUTER JOIN I_AccountingDocumentTypeText AS _AccountingDocumentTypeText ON AccountingDocumentType = _AccountingDocumentTypeText.AccountingDocumentType  -- association [0..*]
LEFT OUTER JOIN I_BusTransactionTypeText AS _BusinessTransactionTypeText ON BusinessTransactionType = _BusinessTransactionTypeText.BusinessTransactionType  -- association [0..*]
LEFT OUTER JOIN I_LedgerText AS _LedgerText ON Ledger = _LedgerText.Ledger  -- association [0..*]
LEFT OUTER JOIN I_OperationalAcctgDocItem AS _OperationalAcctgDocItem ON CompanyCode = _OperationalAcctgDocItem.CompanyCode AND AccountingDocument = _OperationalAcctgDocItem.AccountingDocument AND FiscalYear = _OperationalAcctgDocItem.FiscalYear AND FiscalPeriod = _OperationalAcctgDocItem.FiscalPeriod AND AccountingDocumentCategory = _OperationalAcctgDocItem.AccountingDocumentCategory AND PostingDate = _OperationalAcctgDocItem.PostingDate AND DocumentDate = _OperationalAcctgDocItem.DocumentDate AND AccountingDocumentType = _OperationalAcctgDocItem.AccountingDocumentType  -- association [0..*]
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode  -- association [1..1]
LEFT OUTER JOIN I_FiscalYearForCompanyCode AS _FiscalYear ON FiscalYear = _FiscalYear.FiscalYear AND CompanyCode = _FiscalYear.CompanyCode  -- association [0..1]
LEFT OUTER JOIN I_AccountingDocumentType AS _AccountingDocumentType ON AccountingDocumentType = _AccountingDocumentType.AccountingDocumentType  -- association [0..1]
LEFT OUTER JOIN I_User AS _User ON AccountingDocCreatedByUser = _User.UserID  -- association [0..1]
LEFT OUTER JOIN I_AccountingDocumentCategory AS _AccountingDocumentCategory ON AccountingDocumentCategory = _AccountingDocumentCategory.AccountingDocumentCategory  -- association [0..1]
LEFT OUTER JOIN I_BusinessTransactionType AS _BusinessTransactionType ON BusinessTransactionType = _BusinessTransactionType.BusinessTransactionType  -- association [0..1]
LEFT OUTER JOIN I_ReferenceDocumentType AS _ReferenceDocumentType ON ReferenceDocumentType = _ReferenceDocumentType.ReferenceDocumentType  -- association [0..1]
LEFT OUTER JOIN I_Ledger AS _Ledger ON Ledger = _Ledger.Ledger  -- association [0..1]
LEFT OUTER JOIN I_LedgerGroup AS _LedgerGroup ON LedgerGroup = _LedgerGroup.LedgerGroup  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _Currency ON Currency = _Currency.Currency  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _CompanyCodeCurrency ON CompanyCodeCurrency = _CompanyCodeCurrency.Currency  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _AdditionalCurrency1 ON AdditionalCurrency1 = _AdditionalCurrency1.Currency  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _AdditionalCurrency2 ON AdditionalCurrency2 = _AdditionalCurrency2.Currency  -- association [0..1]
LEFT OUTER JOIN I_LogicalSystem AS _LogicalSystem ON ReferenceDocumentLogicalSystem = _LogicalSystem.LogicalSystem  -- association [0..1]
;