P_ADDLLEDGERACCTDOCITEMHISTORY

CDS View

Change History Line Item non-leading Ledger

P_ADDLLEDGERACCTDOCITEMHISTORY is a CDS View in S/4HANA. Change History Line Item non-leading Ledger. It contains 3 fields. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
P_JournalEntryHistory view inner COMPOSITE Journal Entry History Export as CDS Service

Fields (3)

KeyField CDS FieldsUsed in Views
KEY AccountingDocumentItem AccountingDocumentItem 1
AccountingDocumentType AccountingDocumentType 1
CreationTime CreationTime 1
@AbapCatalog.sqlViewName: 'PADLEDITEMTRKDOC'
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.representativeKey: 'AccountingDocument'
@VDM.private:true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.buffering.status: #NOT_ALLOWED
@Metadata.ignorePropagatedAnnotations: true

define view P_AddlLedgerAcctDocItemHistory
  as select from    I_AddlLedgerOplAcctgDocItem as bsegadd
    left outer join I_JournalEntry              as bkpf on  bsegadd.CompanyCode        = bkpf.CompanyCode
                                                        and bsegadd.FiscalYear         = bkpf.FiscalYear
                                                        and bsegadd.AccountingDocument = bkpf.AccountingDocument
{
  key    bsegadd.CompanyCode,
  key    bsegadd.AccountingDocument,
  key    bsegadd.FiscalYear,
         bsegadd.AccountingDocumentItem,
         bkpf.Ledger,
         bkpf.PostingDate,
         bkpf.DocumentDate,
         CreationTime                                                                                                                                                               as timestamp,
         CreationTime,
         AccountingDocumentCreationDate,
         replace(replace(concat( bsegadd.mandt, concat( rpad(bsegadd.CompanyCode, 4, '|'), concat( bsegadd.AccountingDocument, bsegadd.FiscalYear))), '|', '| |'), '|', '')                                                             as objectid,
         replace(replace(concat( bsegadd.mandt, concat( bkpf.LedgerGroup, concat( rpad(bsegadd.CompanyCode, 4, '|'), concat( bsegadd.FiscalYear, concat( bsegadd.AccountingDocument , AccountingDocumentItem))))), '|', '| |'), '|', '') as bsegadd_tabkey,
         bsegadd.FinancialAccountType,
         bsegadd.GLAccount,
         bkpf.AccountingDocumentType,
         bkpf.AccountingDocumentCategory
}
where
      bkpf.AccountingDocumentCategory <> 'C'
  and bkpf.AccountingDocumentCategory <> 'L'

union select from I_AddlLedgerOplAcctgDocItem as bsegadd
  left outer join I_JournalEntry              as bkpf on  bsegadd.CompanyCode        = bkpf.CompanyCode
                                                      and bsegadd.FiscalYear         = bkpf.FiscalYear
                                                      and bsegadd.AccountingDocument = bkpf.AccountingDocument
{
  key    bsegadd.CompanyCode,
  key    bsegadd.AccountingDocument,
  key    bsegadd.FiscalYear,
         bsegadd.AccountingDocumentItem,
         bkpf.Ledger,
         bkpf.PostingDate,
         bkpf.DocumentDate,
         CreationTime                                                                                                                                                         as timestamp,
         CreationTime,
         AccountingDocumentCreationDate,
         replace(replace(concat( bsegadd.mandt, concat( rpad(bsegadd.CompanyCode, 4, '|'), concat( bsegadd.AccountingDocument, bsegadd.FiscalYear))), '|', '| |'), '|', '')                                                     as objectid,
         replace(replace(concat( bsegadd.mandt,  concat( rpad(bsegadd.CompanyCode, 4, '|'), concat( bsegadd.AccountingDocument, concat( bsegadd.FiscalYear , AccountingDocumentItem)))), '|', '| |'), '|', '')                     as bsegadd_tabkey,
         bsegadd.FinancialAccountType,
         bsegadd.GLAccount,
         bkpf.AccountingDocumentType,
         bkpf.AccountingDocumentCategory
}
where
  bkpf.AccountingDocumentCategory = 'L'

union select from I_JournalEntryItem         as acdoca
  left outer join I_JournalEntry as bkpf on  acdoca.CompanyCode = bkpf.CompanyCode
                                         and acdoca.FiscalYear  = bkpf.FiscalYear
                                         and acdoca.AccountingDocument  = bkpf.AccountingDocument
{
  key    acdoca.CompanyCode,                                                                                                                                 
  key    acdoca.AccountingDocument,                                                                                                                                  
  key    acdoca.FiscalYear,                                                                                                                                  
         acdoca.LedgerGLLineItem     as AccountingDocumentItem,                                                                                                                            
         acdoca.SourceLedger as Ledger,                                                                                                                                  
         bkpf.PostingDate,
         bkpf.DocumentDate,
         CreationTime                                                                                                                                  as timestamp,
         CreationTime,
         AccountingDocumentCreationDate,
         replace(replace(concat( bkpf.mandt, concat( rpad(acdoca.CompanyCode, 4, '|'), concat( acdoca.AccountingDocument, acdoca.FiscalYear))), '|', '| |'), '|', '')                                                            as objectid,
         replace(replace(concat( bkpf.mandt, concat(acdoca.SourceLedger, concat( rpad(acdoca.CompanyCode, 4, '|'), concat( acdoca.FiscalYear, concat( acdoca.AccountingDocument , acdoca.LedgerGLLineItem ))))), '|', '| |'), '|', '')             as bsegadd_tabkey,
         acdoca.FinancialAccountType                                                                                                                 ,
         acdoca.GLAccount                                                                                                                                  ,
         bkpf.AccountingDocumentType,
         bkpf.AccountingDocumentCategory
}
where
  bkpf.AccountingDocumentCategory = 'L'