P_AR_StRpJournalEntryLogDetail

DDL: P_AR_STRPJOURNALENTRYLOGDETAIL SQL: PARJRNLENTRDET Type: view CONSUMPTION Package: GLO_FIN_IS_AR_JOURNAL_LEDGER

Selected Journal Entries for Reporting with Details

P_AR_StRpJournalEntryLogDetail is a Consumption CDS View that provides data about "Selected Journal Entries for Reporting with Details" in SAP S/4HANA. It reads from 3 data sources (I_CompanyCode, P_AR_JournalEntry, I_StRpJournalEntryLog) and exposes 17 fields with key fields CompanyCode, FiscalYear, AccountingDocument, StatryRptgEntity, StatryRptCategory. Part of development package GLO_FIN_IS_AR_JOURNAL_LEDGER.

Data Sources (3)

SourceAliasJoin Type
I_CompanyCode CompanyCode inner
P_AR_JournalEntry JournalEntry from
I_StRpJournalEntryLog StRpJournalEntryLog inner

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PARJRNLENTRDET view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #MIXED view
VDM.viewType #CONSUMPTION view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (17)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode P_AR_JournalEntry CompanyCode
KEY FiscalYear P_AR_JournalEntry FiscalYear
KEY AccountingDocument P_AR_JournalEntry AccountingDocument
KEY StatryRptgEntity I_StRpJournalEntryLog StatryRptgEntity
KEY StatryRptCategory I_StRpJournalEntryLog StatryRptCategory
KEY StatryRptRunID I_StRpJournalEntryLog StatryRptRunID
PostingDate P_AR_JournalEntry PostingDate
ReportingDate P_AR_JournalEntry ReportingDate
DocumentReferenceID P_AR_JournalEntry DocumentReferenceID
AR_Branch P_AR_JournalEntry AR_Branch
AR_OfficialDocumentNumber P_AR_JournalEntry AR_OfficialDocumentNumber
ReversalReferenceDocument P_AR_JournalEntry ReversalReferenceDocument
AccountingDocumentType P_AR_JournalEntry AccountingDocumentType
AR_PrintCharacter P_AR_JournalEntry AR_PrintCharacter
ReferenceDocumentType P_AR_JournalEntry ReferenceDocumentType
CompanyCodeCurrency P_AR_JournalEntry CompanyCodeCurrency
TransactionCurrency P_AR_JournalEntry TransactionCurrency
@AbapCatalog.sqlViewName: 'PARJRNLENTRDET'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.dataClass: #MIXED
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_AR_StRpJournalEntryLogDetail
  as select from           P_AR_JournalEntry            as JournalEntry
  
    inner join             I_CompanyCode                 as CompanyCode                 on JournalEntry.CompanyCode = CompanyCode.CompanyCode
    
    inner join             I_StRpJournalEntryLog         as StRpJournalEntryLog         on  StRpJournalEntryLog.CompanyCode        = JournalEntry.CompanyCode
                                                                                        and StRpJournalEntryLog.FiscalYear         = JournalEntry.FiscalYear
                                                                                        and StRpJournalEntryLog.AccountingDocument = JournalEntry.AccountingDocument

    left outer to one join I_CountrySpecificDocumentType as CountrySpecificDocumentType on  CountrySpecificDocumentType.Country                = CompanyCode.Country
                                                                                        and CountrySpecificDocumentType.AccountingDocumentType = JournalEntry.AccountingDocumentType

    left outer to one join I_AR_OfficialDocumentTypeDetn as AR_OfficialDocumentTypeDetn on  AR_OfficialDocumentTypeDetn.AR_OfficialDocumentClass = CountrySpecificDocumentType.AR_OfficialDocumentClass
                                                                                        and AR_OfficialDocumentTypeDetn.Country                  = CompanyCode.Country
                                                                                        and AR_OfficialDocumentTypeDetn.AR_PrintCharacter        = JournalEntry.AR_PrintCharacter
                                                                                        and AR_OfficialDocumentTypeDetn.AR_Report                = 'J_1AF004'

{
  key JournalEntry.CompanyCode,
  key JournalEntry.FiscalYear,
  key JournalEntry.AccountingDocument,
  key StRpJournalEntryLog.StatryRptgEntity,
  key StRpJournalEntryLog.StatryRptCategory,
  key StRpJournalEntryLog.StatryRptRunID,
      JournalEntry.PostingDate,
      JournalEntry.ReportingDate,
      JournalEntry.DocumentReferenceID,
      JournalEntry.AR_Branch,
      JournalEntry.AR_OfficialDocumentNumber,
      JournalEntry.ReversalReferenceDocument,
      JournalEntry.AccountingDocumentType,
      JournalEntry.AR_PrintCharacter,
      JournalEntry.ReferenceDocumentType,
      cast(
        case
          when AR_OfficialDocumentTypeDetn._AR_OfficialDocumentTypeText[1: Language = $session.system_language].AR_OfficialDocTypeLongDesc is not null
            then AR_OfficialDocumentTypeDetn._AR_OfficialDocumentTypeText[1: Language = $session.system_language].AR_OfficialDocTypeLongDesc
          else JournalEntry._AccountingDocumentTypeText[1: Language = $session.system_language].AccountingDocumentTypeName
        end as logar_officialdoctypelongdesc
      ) as AR_OfficialDocTypeLongDesc,
      cast(
        case
          when JournalEntry.ExchangeRate = 0
            then 1
          else JournalEntry.ExchangeRate
        end as fis_exchange_rate
      ) as ExchangeRate,
      
      @Semantics.currencyCode:true
      JournalEntry.CompanyCodeCurrency,
      @Semantics.currencyCode:true
      JournalEntry.TransactionCurrency
}