I_AccountingDocument

DDL: I_ACCOUNTINGDOCUMENT SQL: IFIACCDOC Type: view BASIC

Accounting Document

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.

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
KEY FiscalYear
KEY AccountingDocument
AccountingDocumentType
DocumentDate
PostingDate
FiscalPeriod
FiscalPeriod
AccountingDocumentCreationDate
CreationTime
LastChangeDate
ExchangeRateDate
AccountingDocCreatedByUser
TransactionCode tcode
IntercompanyTransaction
DocumentReferenceID xblnr
RecurringAccountingDocument
ReverseDocument stblg
ReverseDocumentFiscalYear stjah
AccountingDocumentHeaderText bktxt
ExchangeRate
GroupCurrency kzwrs
AccountingDocumentCategory
BusinessTransactionType
BatchInputSession
ReferenceDocumentType
OriginalReferenceDocument
FinancialManagementArea fikrs
ReferenceDocumentLogicalSystem
Branch brnch
IsDiscountDocument adisc
Reference1InDocumentHeader
Reference2InDocumentHeader
InvoiceReceiptDate reindat
Ledger
LedgerGroup ldgrp
AlternativeReferenceDocument
IsReversal
IsReversed
TaxReportingDate vatdate
ReversalReason stgrd
ParkingDate ppdat
ParkingTime pptme
Currency
CompanyCodeCurrency
AdditionalCurrency1
AdditionalCurrency2
TaxIsCalculatedAutomatically xmwst
NmbrOfPages numpg
_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
@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Accounting Document'
//@Analytics: { dataCategory: #DIMENSION, dataExtraction.enabled: true }

@Analytics.dataCategory: #DIMENSION
@VDM.viewType: #BASIC
@AbapCatalog.sqlViewName: 'IFIACCDOC'
@AccessControl.authorizationCheck: #CHECK
@ObjectModel.representativeKey: 'AccountingDocument'
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass:  #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #A
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.buffering.status: #NOT_ALLOWED
@AbapCatalog.preserveKey:true
@Metadata.ignorePropagatedAnnotations: true 
@Metadata.allowExtensions:true
//--[ GENERATED:012:29JlHNUf7jY4ioM8lnJMdG

@AccessControl.privilegedAssociations: ['_AccountingDocumentTypeText','_BusinessTransactionTypeText','_LedgerText']
// ]--GENERATED


@ObjectModel.modelingPattern: #ANALYTICAL_DIMENSION
@ObjectModel.supportedCapabilities: [#ANALYTICAL_DIMENSION, 
                                     #CDS_MODELING_ASSOCIATION_TARGET, 
                                     #CDS_MODELING_DATA_SOURCE,
                                     #SQL_DATA_SOURCE]
                                     
@VDM.lifecycle.status: #DEPRECATED       
@VDM.lifecycle.successor: 'I_JournalEntry'                               
                                     
define view I_AccountingDocument
  as select from bkpf

  
  //--[ GENERATED:012:29JlHNUf7jY4ioM8lnJMdG

  association [0..*] to I_AccountingDocumentTypeText      as _AccountingDocumentTypeText on   $projection.AccountingDocumentType = _AccountingDocumentTypeText.AccountingDocumentType
  association [0..*] to I_BusTransactionTypeText      as _BusinessTransactionTypeText on   $projection.BusinessTransactionType = _BusinessTransactionTypeText.BusinessTransactionType
  association [0..*] to I_LedgerText      as _LedgerText on   $projection.Ledger = _LedgerText.Ledger
  // ]--GENERATED

  association [0..*] to I_OperationalAcctgDocItem    as _OperationalAcctgDocItem    on  $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
  association [1..1] to I_CompanyCode                as _CompanyCode                on  $projection.CompanyCode = _CompanyCode.CompanyCode
  association [0..1] to I_FiscalYearForCompanyCode   as _FiscalYear                 on  $projection.FiscalYear  = _FiscalYear.FiscalYear
                                                                                    and $projection.CompanyCode = _FiscalYear.CompanyCode
  //association [0..1] to I_FiscalYear                 as _FiscalYear                 on  $projection.FiscalYear  = _FiscalYear.FiscalYear

  //                                                                                  and $projection.fiscalyearvariant = _FiscalYear.FiscalYearVariant 

                                                                                      // FiscalYearVariant not in BKPF, would require join with I_CompanyCode to get FiscalYearVariant                                                                                   

  association [0..1] to I_AccountingDocumentType     as _AccountingDocumentType     on  $projection.AccountingDocumentType = _AccountingDocumentType.AccountingDocumentType
  association [0..1] to I_User                       as _User                       on  $projection.AccountingDocCreatedByUser = _User.UserID
  association [0..1] to I_AccountingDocumentCategory as _AccountingDocumentCategory on  $projection.AccountingDocumentCategory = _AccountingDocumentCategory.AccountingDocumentCategory
  association [0..1] to I_BusinessTransactionType    as _BusinessTransactionType    on  $projection.BusinessTransactionType = _BusinessTransactionType.BusinessTransactionType
  association [0..1] to I_ReferenceDocumentType      as _ReferenceDocumentType      on  $projection.ReferenceDocumentType = _ReferenceDocumentType.ReferenceDocumentType
  association [0..1] to I_Ledger                     as _Ledger                     on  $projection.Ledger = _Ledger.Ledger
  association [0..1] to I_LedgerGroup                as _LedgerGroup                on  $projection.LedgerGroup = _LedgerGroup.LedgerGroup
  association [0..1] to I_Currency                   as _Currency                   on  $projection.Currency = _Currency.Currency
  association [0..1] to I_Currency                   as _CompanyCodeCurrency        on  $projection.CompanyCodeCurrency = _CompanyCodeCurrency.Currency
  association [0..1] to I_Currency                   as _AdditionalCurrency1        on  $projection.AdditionalCurrency1 = _AdditionalCurrency1.Currency
  association [0..1] to I_Currency                   as _AdditionalCurrency2        on  $projection.AdditionalCurrency2 = _AdditionalCurrency2.Currency
  association [0..1] to I_LogicalSystem              as _LogicalSystem              on  $projection.ReferenceDocumentLogicalSystem = _LogicalSystem.LogicalSystem

{
      //--[ GENERATED:012:29JlHNUf7jY4ioM8lnJMdG

      @Consumption.valueHelpDefinition: [ 
        { entity:  { name:    'I_CompanyCodeStdVH',
                     element: 'CompanyCode' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_CompanyCode'
  key cast(bukrs as fis_bukrs preserving type)                                   as CompanyCode, // FieldGroup: _BASIC

      @ObjectModel.foreignKey.association: '_FiscalYear'
//      @Semantics.fiscal.year: true

  key cast(gjahr as fis_gjahr preserving type)                                   as FiscalYear, // FieldGroup: AccountingGroup

  key cast(belnr as farp_belnr_d preserving type)                                as AccountingDocument, // FieldGroup: AccountingGroup


      //--[ GENERATED:012:29JlHNUf7jY4ioM8lnJMdG

      @Consumption.valueHelpDefinition: [ 
        { entity:  { name:    'I_AccountingDocumentTypeStdVH',
                     element: 'AccountingDocumentType' }
        }]
      @ObjectModel.text.association: '_AccountingDocumentTypeText'
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_AccountingDocumentType'
      cast(blart as farp_blart preserving type)                                  as AccountingDocumentType, // FieldGroup: AccountingGroup

      cast(bldat as fis_bldat preserving type)                                   as DocumentDate, // FieldGroup: DocumentGroup

      cast(budat as fis_budat preserving type)                                   as PostingDate, // FieldGroup: BASIC                                    //  New DTEL  toDo

      @Semantics.fiscal.period: true
      cast( cast( concat( '0', monat ) as abap.numc( 3 ) ) as fins_fiscalperiod) as FiscalPeriod,
      --    monat as FiscalPeriod, // FieldGroup: AccountingGroup

      cast(cpudt as farp_cpudt preserving type)                                  as AccountingDocumentCreationDate, // FieldGroup: AccountingGroup

      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,
      //    @ObjectModel.foreignKey.association: '_User'

      cast(usnam as fis_usnam preserving type)                                   as AccountingDocCreatedByUser,
      tcode                                                                      as TransactionCode,
      cast(bvorg as fac_bvorg preserving type)                                                   as IntercompanyTransaction,
      xblnr                                                                      as DocumentReferenceID, //FieldGroup: DocumentGroup

      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,
      @ObjectModel.foreignKey.association: '_AccountingDocumentCategory'
      cast(bstat as farp_bstat_d preserving type)                                as AccountingDocumentCategory, //FieldGroup: AccountingGroup

      //--[ GENERATED:012:29JlHNUf7jY4ioM8lnJMdG

      @Consumption.valueHelpDefinition: [ 
        { entity:  { name:    'I_BusTransTypeStdVH',
                     element: 'BusinessTransactionType' }
        }]
      @ObjectModel.text.association: '_BusinessTransactionTypeText'
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_BusinessTransactionType'
      cast(glvor as fins_bttype preserving type)                                 as BusinessTransactionType,
      cast(grpid as fac_grpid preserving type)                                   as BatchInputSession,
      @ObjectModel.foreignKey.association: '_ReferenceDocumentType'
      cast(awtyp as fis_awtyp)                                                   as ReferenceDocumentType,
      cast(awkey as fac_awkey)                                                   as OriginalReferenceDocument,
      fikrs                                                                      as FinancialManagementArea,
      cast(awsys as fis_awsys)                                                   as ReferenceDocumentLogicalSystem, //?????????????I_LogicalSystem missing

      brnch                                                                      as Branch,
//      @Semantics.booleanIndicator 

      adisc                                                                      as IsDiscountDocument,
      cast(xref1_hd as fins_xref1_hd)                                            as Reference1InDocumentHeader,
      cast(xref2_hd as fins_xref2_hd)                                            as Reference2InDocumentHeader,
      reindat                                                                    as InvoiceReceiptDate,
      //--[ GENERATED:012:29JlHNUf7jY4ioM8lnJMdG

      @Consumption.valueHelpDefinition: [ 
        { entity:  { name:    'I_LedgerStdVH',
                     element: 'Ledger' }
        }]
      @ObjectModel.text.association: '_LedgerText'
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_Ledger'
      cast(rldnr as fis_rldnr preserving type)                                   as Ledger,
      @ObjectModel.foreignKey.association: '_LedgerGroup'
      ldgrp                                                                      as LedgerGroup,
//    cast(xblnr_alt as fis_xblnr_alt_wo_exit preserving type)                   as AlternativeReferenceDocument,

      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,

      @ObjectModel.foreignKey.association: '_Currency'
      @Semantics.currencyCode:true
      cast(waers as waers preserving type)                                       as Currency,
      @ObjectModel.foreignKey.association: '_CompanyCodeCurrency'
      @Semantics.currencyCode:true
      cast(hwaer as fis_hwaer preserving type)                                   as CompanyCodeCurrency, //FieldGroup: AccountingGroup

      @ObjectModel.foreignKey.association: '_AdditionalCurrency1'
      @Semantics.currencyCode:true
      cast(hwae2 as fis_hwae2 preserving type)                                   as AdditionalCurrency1, //FieldGroup: AccountingGroup                    //  New DTEL  toDo

      @ObjectModel.foreignKey.association: '_AdditionalCurrency2'
      @Semantics.currencyCode:true
      cast(hwae3 as fis_hwae3 preserving type)                                   as AdditionalCurrency2, //FieldGroup: AccountingGroup                    //  New Dtel  toDo

      
      
      xmwst as TaxIsCalculatedAutomatically,
      numpg as NmbrOfPages,

      _OperationalAcctgDocItem,
      _CompanyCode,
      _FiscalYear,
      _AccountingDocumentType,
      _AccountingDocumentCategory,
      _BusinessTransactionType,
      _ReferenceDocumentType,
      _Ledger,
      _LedgerGroup,
      _User,
      _Currency,
      _CompanyCodeCurrency,
      _AdditionalCurrency1,
      _AdditionalCurrency2,
      _LogicalSystem,
      //--[ GENERATED:012:29JlHNUf7jY4ioM8lnJMdG

      @Consumption.hidden: true
      _AccountingDocumentTypeText,
      @Consumption.hidden: true
      _BusinessTransactionTypeText,
      @Consumption.hidden: true
      _LedgerText
      // ]--GENERATED


}                          
  
 

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"BKPF"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENTCATEGORY",
"I_ACCOUNTINGDOCUMENTTYPE",
"I_ACCOUNTINGDOCUMENTTYPETEXT",
"I_BUSINESSTRANSACTIONTYPE",
"I_BUSTRANSACTIONTYPETEXT",
"I_COMPANYCODE",
"I_CURRENCY",
"I_FISCALYEARFORCOMPANYCODE",
"I_LEDGER",
"I_LEDGERGROUP",
"I_LEDGERTEXT",
"I_LOGICALSYSTEM",
"I_OPERATIONALACCTGDOCITEM",
"I_REFERENCEDOCUMENTTYPE",
"I_USER"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/