I_AccountingDocument

DDL: I_ACCOUNTINGDOCUMENT Type: view_entity BASIC Package: FINS_FIS_FICO

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. Part of development package FINS_FIS_FICO.

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 (16)

NameValueLevelField
AbapCatalog.entityBuffer.definitionAllowed false view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
EndUserText.label Accounting Document view
Analytics.dataCategory #DIMENSION view
Analytics.technicalName IFIACCDOC view
VDM.viewType #BASIC view
AccessControl.authorizationCheck #CHECK view
ObjectModel.representativeKey AccountingDocument view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #A 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 bkpf tcode
IntercompanyTransaction
DocumentReferenceID bkpf xblnr
RecurringAccountingDocument
ReverseDocument bkpf stblg
ReverseDocumentFiscalYear bkpf stjah
AccountingDocumentHeaderText bkpf bktxt
ExchangeRate
GroupCurrency bkpf kzwrs
AccountingDocumentCategory
BusinessTransactionType
BatchInputSession
ReferenceDocumentType
OriginalReferenceDocument
FinancialManagementArea bkpf fikrs
ReferenceDocumentLogicalSystem
Branch bkpf brnch
IsDiscountDocument bkpf adisc
Reference1InDocumentHeader
Reference2InDocumentHeader
InvoiceReceiptDate bkpf reindat
Ledger
LedgerGroup bkpf ldgrp
AlternativeReferenceDocument
IsReversal
IsReversed
TaxReportingDate bkpf vatdate
ReversalReason bkpf stgrd
ParkingDate bkpf ppdat
ParkingTime bkpf pptme
Currency
CompanyCodeCurrency
AdditionalCurrency1
AdditionalCurrency2
TaxIsCalculatedAutomatically bkpf xmwst
NmbrOfPages bkpf 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
 @AbapCatalog.entityBuffer.definitionAllowed: false
 @VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API
@EndUserText.label: 'Accounting Document'
//@Analytics: { dataCategory: #DIMENSION, dataExtraction.enabled: true }

@Analytics.dataCategory: #DIMENSION
@Analytics.technicalName: 'IFIACCDOC'
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #CHECK
@ObjectModel.representativeKey: 'AccountingDocument'
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass:  #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #A
@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 entity 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(bkpf.bukrs as fis_bukrs preserving type)                                   as CompanyCode, // FieldGroup: _BASIC

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

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

  key cast(bkpf.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(bkpf.blart as farp_blart preserving type)                                  as AccountingDocumentType, // FieldGroup: AccountingGroup

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

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

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

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

      cast(bkpf.cputm as ttet_dt_cr_time preserving type)                             as CreationTime,
      cast(bkpf.aedat as ttet_dt_chg_date preserving type)                            as LastChangeDate,
      cast(bkpf.wwert as vdm_v_exchange_rate_date preserving type)                    as ExchangeRateDate,
      //    @ObjectModel.foreignKey.association: '_User'

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

      cast(bkpf.dbblg as fac_rjet_id preserving type)                                                 as RecurringAccountingDocument,
      bkpf.stblg                                                                      as ReverseDocument,
      bkpf.stjah                                                                      as ReverseDocumentFiscalYear,
      bkpf.bktxt                                                                      as AccountingDocumentHeaderText,
      cast(bkpf.kursf as ukurs_curr preserving type)                                                  as ExchangeRate,
      bkpf.kzwrs                                                                      as GroupCurrency,
      @ObjectModel.foreignKey.association: '_AccountingDocumentCategory'
      cast(bkpf.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(bkpf.glvor as fins_bttype preserving type)                                 as BusinessTransactionType,
      cast(bkpf.grpid as fac_grpid preserving type)                                   as BatchInputSession,
      @ObjectModel.foreignKey.association: '_ReferenceDocumentType'
      cast(bkpf.awtyp as fis_awtyp)                                                   as ReferenceDocumentType,
      cast(bkpf.awkey as fac_awkey)                                                   as OriginalReferenceDocument,
      bkpf.fikrs                                                                      as FinancialManagementArea,
      cast(bkpf.awsys as fis_awsys)                                                   as ReferenceDocumentLogicalSystem, //?????????????I_LogicalSystem missing

      bkpf.brnch                                                                      as Branch,
//      @Semantics.booleanIndicator 

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

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

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

      cast(bkpf.xblnr_alt as fac_xblnr_alt preserving type)                           as AlternativeReferenceDocument,
      cast(bkpf.xreversing as fins_xreversing)                                        as IsReversal,
      cast(bkpf.xreversed as fins_xreversed)                                          as IsReversed,
      bkpf.vatdate                                                                    as TaxReportingDate,
      bkpf.stgrd                                                                      as ReversalReason,
      bkpf.ppdat                                                                      as ParkingDate,
      bkpf.pptme                                                                      as ParkingTime,

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

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

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

      
      
      bkpf.xmwst as TaxIsCalculatedAutomatically,
      bkpf.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


}