P_AR_JournalEntry

DDL: P_AR_JOURNALENTRY SQL: PARJOURNALENTRY Type: view CONSUMPTION Package: GLO_FIN_IS_VAT_AR

Argentina Journal Entry Calculated Fields

P_AR_JournalEntry is a Consumption CDS View that provides data about "Argentina Journal Entry Calculated Fields" in SAP S/4HANA. It reads from 1 data source (I_JournalEntry) and exposes 32 fields with key fields CompanyCode, FiscalYear, AccountingDocument. It has 2 associations to related views. Part of development package GLO_FIN_IS_VAT_AR.

Data Sources (1)

SourceAliasJoin Type
I_JournalEntry JournalEntry from

Associations (2)

CardinalityTargetAliasCondition
[0..1] P_AR_ConversionFactors _ConversionFactor _ConversionFactor.ExchangeRateType = $projection.ExchangeRateType and _ConversionFactor.SourceCurrency = $projection.TransactionCurrency and _ConversionFactor.TargetCurrency = $projection.CompanyCodeCurrency and _ConversionFactor.ValidityStartDate <= $projection.PostingDate and _ConversionFactor.ValidityEndDate >= $projection.PostingDate
[0..*] I_OneTimeAccountBP _OneTimeAccountBP JournalEntry.CompanyCode = _OneTimeAccountBP.CompanyCode and JournalEntry.FiscalYear = _OneTimeAccountBP.FiscalYear and JournalEntry.AccountingDocument = _OneTimeAccountBP.AccountingDocument

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PARJOURNALENTRY 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 #TRANSACTIONAL view
VDM.viewType #CONSUMPTION view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (32)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_JournalEntry CompanyCode
KEY FiscalYear I_JournalEntry FiscalYear
KEY AccountingDocument I_JournalEntry AccountingDocument
FiscalPeriod I_JournalEntry FiscalPeriod
PostingDate I_JournalEntry PostingDate
ExchangeRateType I_JournalEntry ExchangeRateType
DocumentDate I_JournalEntry DocumentDate
TaxReportingDate I_JournalEntry TaxReportingDate
AccountingDocumentType I_JournalEntry AccountingDocumentType
AccountingDocumentCategory I_JournalEntry AccountingDocumentCategory
DocumentReferenceID I_JournalEntry DocumentReferenceID
Branch I_JournalEntry Branch
NmbrOfPagesendasj_1anopgasNmbrOfPages
AccountingDocumentHeaderText I_JournalEntry AccountingDocumentHeaderText
IsReversal I_JournalEntry IsReversal
IsReversed I_JournalEntry IsReversed
ReverseDocument I_JournalEntry ReverseDocument
ReverseDocumentFiscalYear I_JournalEntry ReverseDocumentFiscalYear
ReversalReferenceDocument I_JournalEntry ReversalReferenceDocument
OriginalReferenceDocument I_JournalEntry OriginalReferenceDocument
ReferenceDocumentType I_JournalEntry ReferenceDocumentType
ReferenceDocumentLogicalSystem I_JournalEntry ReferenceDocumentLogicalSystem
ExchangeRateDate I_JournalEntry ExchangeRateDate
LogicalSystem I_JournalEntry LogicalSystem
CompanyCodeCurrency I_JournalEntry CompanyCodeCurrency
TransactionCurrency
AdditionalCurrency1 I_JournalEntry AdditionalCurrency1
AdditionalCurrency2 I_JournalEntry AdditionalCurrency2
_CompanyCode _CompanyCode
_OneTimeAccountBP _OneTimeAccountBP
_AccountingDocumentTypeText _AccountingDocumentTypeText
_ConversionFactor _ConversionFactor
@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_VARIABLE

define view P_AR_JournalEntry
  as select from I_JournalEntry as JournalEntry

  association [0..1] to P_AR_ConversionFactors as _ConversionFactor on  _ConversionFactor.ExchangeRateType  = $projection.ExchangeRateType
                                                                    and _ConversionFactor.SourceCurrency    = $projection.TransactionCurrency
                                                                    and _ConversionFactor.TargetCurrency    = $projection.CompanyCodeCurrency
                                                                    and _ConversionFactor.ValidityStartDate <= $projection.PostingDate
                                                                    and _ConversionFactor.ValidityEndDate   >= $projection.PostingDate

  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.ExchangeRateType,
      JournalEntry.DocumentDate,
      JournalEntry.TaxReportingDate,

      cast(
        case
          when JournalEntry.TaxReportingDate = '00000000' then JournalEntry.PostingDate
          when JournalEntry.TaxReportingDate <> '00000000' then JournalEntry.TaxReportingDate
        end
      as glo_reporting_date preserving type )                                as ReportingDate,

      JournalEntry.AccountingDocumentType,
      JournalEntry.AccountingDocumentCategory,
      JournalEntry.DocumentReferenceID,
      JournalEntry.Branch,

      cast(
        case length( JournalEntry.DocumentReferenceID )
          when 13
            then substring( JournalEntry.DocumentReferenceID,1,4 )
          when 14
            then substring( JournalEntry.DocumentReferenceID,1,5 )
        end as 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 )
      end                                                                    as AR_Branch4Digits,

      cast(
        case length( JournalEntry.DocumentReferenceID )
          when 13
            then substring( JournalEntry.DocumentReferenceID,5,1 )
          when 14
            then substring( JournalEntry.DocumentReferenceID,6,1 )
          else ''
        end as 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 )
        end as fiar_odn
      )                                                                      as AR_OfficialDocumentNumber,

      cast(
        case
          when JournalEntry.NmbrOfPages = '000' or JournalEntry.NmbrOfPages = ''
            then '001'
          else JournalEntry.NmbrOfPages
        end as j_1anopg
      )                                                                      as NmbrOfPages,

      JournalEntry.AccountingDocumentHeaderText,
      JournalEntry.IsReversal,
      JournalEntry.IsReversed,
      JournalEntry.ReverseDocument,
      JournalEntry.ReverseDocumentFiscalYear,
      JournalEntry.ReversalReferenceDocument,
      JournalEntry.OriginalReferenceDocument,
      JournalEntry.ReferenceDocumentType,

      cast(
        case
          when JournalEntry.ReferenceDocumentType = 'VBRK' or JournalEntry.ReferenceDocumentType = 'CF3PS'
            then 'X'
          else ''
        end as flag
      )                                                                      as IsDocumentFromSD,

      JournalEntry.ReferenceDocumentLogicalSystem,
      JournalEntry.ExchangeRateDate,

      cast(
        case
          when JournalEntry.TransactionCurrency <> JournalEntry.CompanyCodeCurrency
             then JournalEntry.AbsoluteExchangeRate * _ConversionFactor.NumberOfTargetCurrencyUnits
          else JournalEntry.AbsoluteExchangeRate
        end as fis_exchange_rate
      )                                                                      as ExchangeRate,

      JournalEntry.LogicalSystem,
      JournalEntry.CompanyCodeCurrency,
      cast( JournalEntry.TransactionCurrency  as fis_rwcur preserving type ) as TransactionCurrency,
      JournalEntry.AdditionalCurrency1,
      JournalEntry.AdditionalCurrency2,

      _CompanyCode,
      _OneTimeAccountBP,
      _AccountingDocumentTypeText,
      _ConversionFactor
}