@AbapCatalog.sqlViewName: 'PARJOURNALENTRY'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@AccessControl.authorizationCheck: #NOT_REQUIRED@ObjectModel.usageType.sizeCategory: #XL@ObjectModel.usageType.serviceQuality: #C@ObjectModel.usageType.dataClass: #TRANSACTIONAL@VDM.viewType: #CONSUMPTION@VDM.private: true@ClientHandling.algorithm: #SESSION_VARIABLEdefineview P_AR_JournalEntry
asselectfrom I_JournalEntry as JournalEntry
association [0..*] to I_OneTimeAccountBP as _OneTimeAccountBP on JournalEntry.CompanyCode = _OneTimeAccountBP.CompanyCode
and JournalEntry.FiscalYear = _OneTimeAccountBP.FiscalYear
and JournalEntry.AccountingDocument = _OneTimeAccountBP.AccountingDocument
{
key JournalEntry.CompanyCode,
key JournalEntry.FiscalYear,
key JournalEntry.AccountingDocument,
JournalEntry.FiscalPeriod,
JournalEntry.PostingDate,
JournalEntry.DocumentDate,
JournalEntry.TaxReportingDate,
cast(
casewhen JournalEntry.TaxReportingDate = '00000000' then JournalEntry.PostingDate
when JournalEntry.TaxReportingDate <> '00000000' then JournalEntry.TaxReportingDate
endas glo_reporting_date preserving type ) as ReportingDate,
JournalEntry.AccountingDocumentType,
JournalEntry.AccountingDocumentCategory,
JournalEntry.DocumentReferenceID,
cast(
case length( JournalEntry.DocumentReferenceID )
when 13
then substring( JournalEntry.DocumentReferenceID,1,4 )
when 14
then substring( JournalEntry.DocumentReferenceID,1,5 )
endas fiar_branch preserving type
) as AR_Branch,
case length( JournalEntry.DocumentReferenceID )
when 13
then substring( JournalEntry.DocumentReferenceID,1,4 )
when 14
then substring( JournalEntry.DocumentReferenceID,2,4 )
endas AR_Branch4Digits,
cast(
case length( JournalEntry.DocumentReferenceID )
when 13
then substring( JournalEntry.DocumentReferenceID,5,1 )
when 14
then substring( JournalEntry.DocumentReferenceID,6,1 )
else ''
endas j_1apchar preserving type
) as AR_PrintCharacter,
cast(
case length( JournalEntry.DocumentReferenceID )
when 13
then substring( JournalEntry.DocumentReferenceID,6,8 )
when 14
then substring( JournalEntry.DocumentReferenceID,7,8 )
endas fiar_odn
) as AR_OfficialDocumentNumber,
cast(
casewhen JournalEntry.NmbrOfPages = '000' or JournalEntry.NmbrOfPages = ''
then '001'
else JournalEntry.NmbrOfPages
endas j_1anopg
) as NmbrOfPages,
JournalEntry.AccountingDocumentHeaderText,
JournalEntry.IsReversal,
JournalEntry.IsReversed,
JournalEntry.ReverseDocument,
JournalEntry.ReverseDocumentFiscalYear,
JournalEntry.ReversalReferenceDocument,
JournalEntry.OriginalReferenceDocument,
JournalEntry.ReferenceDocumentType,
cast(
casewhen JournalEntry.ReferenceDocumentType = 'VBRK' or JournalEntry.ReferenceDocumentType = 'CF3PS'
then 'X'
else ''
endas flag
) as IsDocumentFromSD,
JournalEntry.ReferenceDocumentLogicalSystem,
JournalEntry.ExchangeRateDate,
cast( JournalEntry.ExchangeRate as fis_exchange_rate preserving type ) as ExchangeRate,
JournalEntry.LogicalSystem,
JournalEntry.CompanyCodeCurrency,
cast( JournalEntry.TransactionCurrency as fis_rwcur preserving type ) as TransactionCurrency,
JournalEntry.AdditionalCurrency1,
JournalEntry.AdditionalCurrency2,
_CompanyCode,
_OneTimeAccountBP,
_AccountingDocumentTypeText
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_JOURNALENTRY"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENTTYPETEXT",
"I_COMPANYCODE",
"I_ONETIMEACCOUNTBP"
],
"BASE":
[
"I_JOURNALENTRY"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/