@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Journal Entry'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #XXL,
dataClass: #MIXED
}
@VDM: {
viewType: #COMPOSITE,
private: true
}
define view entity P_ManageJournalEntry
as select from I_JournalEntry as _JournalEntry
{
key _JournalEntry.CompanyCode,
key _JournalEntry.FiscalYear,
key _JournalEntry.AccountingDocument,
_JournalEntry.AccountingDocumentCategory,
_JournalEntry.AccountingDocumentHeaderText,
_JournalEntry.SenderAccountingDocument,
_JournalEntry.AccountingDocumentType,
// _JournalEntry.acc_principle as AccountingPrinciple,
_JournalEntry.AdditionalCurrency1,
// _JournalEntry.kurs2 as AdditionalCrcy1ExchangeRate,
_JournalEntry.AdditionalCurrency1Role,
_JournalEntry.AdditionalCurrency2,
// _JournalEntry.kurs3 as AdditionalCrcy2ExchangeRate,
_JournalEntry.AdditionalCurrency2Role,
_JournalEntry.AlternativeReferenceDocument,
// _JournalEntry.rldnr_auth as AuthorizationCheckLedger,
// _JournalEntry.blart_brgru as AuthorizationGroupDocumentType,
_JournalEntry.Branch,
_JournalEntry.BusinessTransactionType,
_JournalEntry.CompanyCodeCurrency,
_JournalEntry.SenderCompanyCode,
// _JournalEntry.co_belnr_sender as ControllingDocumentSender,
_JournalEntry.AccountingDocCreatedByUser,
_JournalEntry.AccountingDocumentCreationDate,
_JournalEntry.CreationTime,
cast( dats_tims_to_tstmp( _JournalEntry.AccountingDocumentCreationDate, _JournalEntry.CreationTime,
abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' )
as vdm_creationdatetime) as CreationDateTime,
// _JournalEntry.locpudt as LocalCreationDate,
_JournalEntry.DocumentDate,
_JournalEntry.DocumentReferenceID,
_JournalEntry.AbsoluteExchangeRate,
cast(_JournalEntry.ExchangeRateDate as fin_currconvdat preserving type ) as ExchangeRateDate,
_JournalEntry.TaxAbsoluteExchangeRate,
_JournalEntry.CtryCrcyTxAbsoluteExchangeRate,
_JournalEntry.MarketDataAbsoluteExchangeRate,
_JournalEntry.TaxCountry,
_JournalEntry.ExchangeRateType,
_JournalEntry.FiscalPeriod,
_JournalEntry.SenderFiscalYear,
_JournalEntry.JrnlEntryCntrySpecificRef1,
_JournalEntry.JrnlEntryCntrySpecificDate1,
_JournalEntry.JrnlEntryCntrySpecificRef2,
_JournalEntry.JrnlEntryCntrySpecificDate2,
_JournalEntry.JrnlEntryCntrySpecificRef3,
_JournalEntry.JrnlEntryCntrySpecificDate3,
_JournalEntry.JrnlEntryCntrySpecificRef4,
_JournalEntry.JrnlEntryCntrySpecificDate4,
_JournalEntry.JrnlEntryCntrySpecificRef5,
_JournalEntry.JrnlEntryCntrySpecificDate5,
_JournalEntry.JrnlEntryCntrySpecificBP1,
_JournalEntry.JrnlEntryCntrySpecificBP2,
// _JournalEntry.kzwrs as GroupCurrency
cast(_JournalEntry.IntercompanyTransaction as fac_mje_bvorg preserving type ) as IntercompanyTransaction,
_JournalEntry.InvoiceReceiptDate,
_JournalEntry.LastManualChangeDate,
_JournalEntry.LastAutomaticChangeDate,
_JournalEntry.Ledger,
_JournalEntry.LedgerGroup,
_JournalEntry.SenderLogicalSystem,
// _JournalEntry.kursx as MarketDataExchangeRate,
_JournalEntry.NmbrOfPages,
cast(_JournalEntry.OriginalReferenceDocument as fis_awkey) as OriginalReferenceDocument,
_JournalEntry.ParkingTime,
_JournalEntry.ParkedByUser,
// _JournalEntry.ppnam_txt as ParkedByUserName,
_JournalEntry.ParkingDate,
cast( dats_tims_to_tstmp( _JournalEntry.ParkingDate, _JournalEntry.ParkingTime,
abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' )
as timestamp) as ParkingDateTime,
// _JournalEntry.loppdat as LocalParkedDate, calculated
// _JournalEntry.pptcod as ParkTransaction,
_JournalEntry.PostingDate,
// _JournalEntry.dbblg_bukrs as RecrrgAccDocTemplCompanyCode,
// _JournalEntry.dbblg_gjahr as RecurringAccDocTemplFiscalYear,
_JournalEntry.RecurringAccountingDocument,
_JournalEntry.Reference1InDocumentHeader,
_JournalEntry.Reference2InDocumentHeader,
_JournalEntry.ReferenceDocumentType,
// _JournalEntry.xreversal as ReversalFunction,
_JournalEntry.ReversalReason,
_JournalEntry.IsReversal,
_JournalEntry.IsReversed,
cast( case _JournalEntry.IsReversal
when '' then ''
else _JournalEntry.ReversalReferenceDocument
end as reversedreferencedocument preserving type ) as ReversedReferenceDocument,
cast( case _JournalEntry.IsReversed
when '' then ''
else _JournalEntry.ReversalReferenceDocument
end as reversalreferencedocument preserving type ) as ReversalReferenceDocument,
cast( case _JournalEntry.IsReversal
when '' then ''
else _JournalEntry.ReverseDocument
end as stbln preserving type ) as ReversedDocument,
cast( case _JournalEntry.IsReversed
when '' then ''
else _JournalEntry.ReverseDocument
end as stblg preserving type ) as ReverseDocument,
//_JournalEntry.,
_JournalEntry.ReverseDocumentFiscalYear,
_JournalEntry.PlannedReversalDate,
_JournalEntry.TaxBaseAmountIsNetAmount,
cast( case _JournalEntry.TaxBaseAmountIsNetAmount
when 'X' then 'N'
else 'G'
end as taxbaseamountorigin ) as TaxBaseAmountOrigin,
cast(_JournalEntry.TaxFulfillmentDate as txrg_fulfilldate_lbl preserving type ) as TaxFulfillmentDate,
_JournalEntry.TaxIsCalculatedAutomatically,
cast( case _JournalEntry.TaxIsCalculatedAutomatically
when 'X' then 'A'
else 'M'
end as taxcalculationtype ) as TaxCalculationType,
_JournalEntry.TaxReportingDate,
cast(_JournalEntry.WithholdingTaxReportingDate as fac_mje_whtdate preserving type ) as WithholdingTaxReportingDate,
_JournalEntry.TransactionCode,
cast( _JournalEntry.TransactionCurrency as fis_rwcur ) as TransactionCurrency,
// Needed for Related Documents Tab
_JournalEntry.ReferenceDocumentLogicalSystem,
_JournalEntry.JournalEntryLastChangeDateTime,
replace(replace(concat( $session.client, concat( rpad(_JournalEntry.CompanyCode, 4, '|'),
concat( _JournalEntry.AccountingDocument, _JournalEntry.FiscalYear))), '|', '| |'), '|', '') as ChangeDocObject,
//DCL
_AccountingDocumentType
}
where
(
_JournalEntry.AccountingDocumentCategory = '' // Normal document
or _JournalEntry.AccountingDocumentCategory = 'A' // Clearing Document
or _JournalEntry.AccountingDocumentCategory = 'B' // Reset clearing document
or _JournalEntry.AccountingDocumentCategory = 'C' // Balance Carryforward and Balance Adjustments from Migration
or _JournalEntry.AccountingDocumentCategory = 'J' // Closing Operations (postings are not made to record type 0)
or _JournalEntry.AccountingDocumentCategory = 'L' // Posting Not in Leading Ledger
or _JournalEntry.AccountingDocumentCategory = 'O' // Financial Statements: Open Entry
or _JournalEntry.AccountingDocumentCategory = 'S' // Noted items
or _JournalEntry.AccountingDocumentCategory = 'U' // Posting in General Ledger Only
or _JournalEntry.AccountingDocumentCategory = 'V' // parked
or _JournalEntry.AccountingDocumentCategory = 'W' // changed parked
or _JournalEntry.AccountingDocumentCategory = 'Z' // deleted parked
)
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_JOURNALENTRY"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENTTYPE"
],
"BASE":
[
"I_JOURNALENTRY"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/