P_NL_SAFTJournalLineItem

DDL: P_NL_SAFTJOURNALLINEITEM SQL: PNLSAFTJITEM Type: view COMPOSITE

P_NL_SAFTJournalLineItem is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_GLAccountInCompanyCode, I_JournalEntryItem) and exposes 57 fields with key fields SourceLedger, CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem.

Data Sources (2)

SourceAliasJoin Type
I_GLAccountInCompanyCode GLAccount inner
I_JournalEntryItem JournalEntryItem from

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PNLSAFTJITEM view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
VDM.private true view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (57)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger I_JournalEntryItem SourceLedger
KEY CompanyCode I_JournalEntryItem CompanyCode
KEY FiscalYear I_JournalEntryItem FiscalYear
KEY AccountingDocument I_JournalEntryItem AccountingDocument
KEY LedgerGLLineItem I_JournalEntryItem LedgerGLLineItem
KEY Ledger I_JournalEntryItem Ledger
CompanyCodeCurrency I_JournalEntryItem CompanyCodeCurrency
GLAccount I_JournalEntryItem GLAccount
AlternativeGLAccount I_JournalEntryItem AlternativeGLAccount
ChartOfAccounts I_JournalEntryItem ChartOfAccounts
CountryChartOfAccounts I_JournalEntryItem CountryChartOfAccounts
ReferenceDocument I_JournalEntryItem ReferenceDocument
PostingDate I_JournalEntryItem PostingDate
Customer I_JournalEntryItem Customer
Supplier I_JournalEntryItem Supplier
TaxCode I_JournalEntryItem TaxCode
ReferenceDocumentType I_JournalEntryItem ReferenceDocumentType
ReversalReferenceDocument I_JournalEntryItem ReversalReferenceDocument
IsReversed I_JournalEntryItem IsReversed
CostCenter I_JournalEntryItem CostCenter
ControllingArea I_JournalEntryItem ControllingArea
Quantity I_JournalEntryItem Quantity
LogicalSystem I_JournalEntryItem LogicalSystem
TransactionTypeDetermination I_JournalEntryItem TransactionTypeDetermination
FinancialAccountType I_JournalEntryItem FinancialAccountType
TaxCalculationProcedure
OrderID I_JournalEntryItem OrderID
AmountInTransactionCurrency I_JournalEntryItem AmountInTransactionCurrency
TransactionCurrency I_JournalEntryItem TransactionCurrency
ValueDate I_JournalEntryItem ValueDate
AccountingDocumentItem I_JournalEntryItem AccountingDocumentItem
IsReversal I_JournalEntryItem IsReversal
SalesDocument I_JournalEntryItem SalesDocument
SalesDocumentItem I_JournalEntryItem SalesDocumentItem
InvoiceReference I_JournalEntryItem InvoiceReference
InvoiceItemReference I_JournalEntryItem InvoiceItemReference
DocumentReferenceID
ReferenceDocumentContext I_JournalEntryItem ReferenceDocumentContext
AccountingDocumentItemType AcctgDocItem AccountingDocumentItemType
ReconciliationAccountType I_GLAccountInCompanyCode ReconciliationAccountType
_SourceLedger _SourceLedger
_CompanyCode I_JournalEntryItem _CompanyCode
_FiscalYear _FiscalYear
_JournalEntry _JournalEntry
_Ledger _Ledger
_CompanyCodeCurrency _CompanyCodeCurrency
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_AlternativeGLAccount _AlternativeGLAccount
_ChartOfAccounts _ChartOfAccounts
_CountryChartOfAccounts _CountryChartOfAccounts
_Customer _Customer
_Supplier _Supplier
_CostCenter _CostCenter
_ControllingArea _ControllingArea
_LogicalSystem _LogicalSystem
_ReferenceDocumentType _ReferenceDocumentType
_Order _Order
@AbapCatalog.sqlViewName: 'PNLSAFTJITEM'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MIXED
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_NL_SAFTJournalLineItem
  as select from           I_JournalEntryItem        as JournalEntryItem

    inner join             I_GLAccountInCompanyCode  as GLAccount    on  GLAccount.GLAccount   = JournalEntryItem.GLAccount
                                                                     and GLAccount.CompanyCode = JournalEntryItem.CompanyCode

    left outer to one join I_OperationalAcctgDocItem as AcctgDocItem on  AcctgDocItem.CompanyCode            = JournalEntryItem.CompanyCode
                                                                     and AcctgDocItem.FiscalYear             = JournalEntryItem.FiscalYear
                                                                     and AcctgDocItem.AccountingDocument     = JournalEntryItem.AccountingDocument
                                                                     and AcctgDocItem.AccountingDocumentItem = JournalEntryItem.AccountingDocumentItem

{
      @ObjectModel.foreignKey.association: '_SourceLedger'
  key JournalEntryItem.SourceLedger                                      as SourceLedger,
      @ObjectModel.foreignKey.association: '_CompanyCode'
  key JournalEntryItem.CompanyCode                                       as CompanyCode,
      @ObjectModel.foreignKey.association: '_FiscalYear'
  key JournalEntryItem.FiscalYear                                        as FiscalYear,
      @ObjectModel.foreignKey.association: '_JournalEntry'
  key JournalEntryItem.AccountingDocument                                as AccountingDocument,
  key JournalEntryItem.LedgerGLLineItem                                  as LedgerGLLineItem,
      @ObjectModel.foreignKey.association: '_Ledger'
  key JournalEntryItem.Ledger                                            as Ledger,

      @Semantics.currencyCode: true
      JournalEntryItem.CompanyCodeCurrency,
      @ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
      JournalEntryItem.GLAccount                                         as GLAccount,
      @ObjectModel.foreignKey.association: '_AlternativeGLAccount'
      JournalEntryItem.AlternativeGLAccount                              as AlternativeGLAccount,
      @ObjectModel.foreignKey.association: '_ChartOfAccounts'
      JournalEntryItem.ChartOfAccounts                                   as ChartOfAccounts,
      @ObjectModel.foreignKey.association: '_CountryChartOfAccounts'
      JournalEntryItem.CountryChartOfAccounts                            as CountryChartOfAccounts,
      JournalEntryItem.ReferenceDocument                                 as ReferenceDocument,
      JournalEntryItem.PostingDate                                       as PostingDate,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      case
        when JournalEntryItem.DebitCreditCode = 'S'
          then JournalEntryItem.AmountInCompanyCodeCurrency //If amount is negative, it represents a Negative Posting, it shall be reported as it is.


        when JournalEntryItem.DebitCreditCode = 'H' and JournalEntryItem.AmountInCompanyCodeCurrency < 0
          then abs(JournalEntryItem.AmountInCompanyCodeCurrency) //Normal credit postings have negative signs, shall be reported as positive


        when JournalEntryItem.DebitCreditCode = 'H' and JournalEntryItem.AmountInCompanyCodeCurrency > 0
          then JournalEntryItem.AmountInCompanyCodeCurrency * -1  //Negative postings with credit indicator have positive sign, shall be reported as negative


      end                                                                as AmountInCompanyCodeCurrency,

      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
      when JournalEntryItem.DebitCreditCode = 'S'
       then JournalEntryItem.AmountInCompanyCodeCurrency //If amount is negative, it represents a Negative Posting, it shall be reported as it is.

      end                                                                as DebitAmountInCoCodeCrcy,
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      case
       when JournalEntryItem.DebitCreditCode = 'H' and JournalEntryItem.AmountInCompanyCodeCurrency < 0
       then abs(JournalEntryItem.AmountInCompanyCodeCurrency) //Normal credit postings have negative signs, shall be reported as positive

       when JournalEntryItem.DebitCreditCode = 'H' and JournalEntryItem.AmountInCompanyCodeCurrency > 0
       then JournalEntryItem.AmountInCompanyCodeCurrency * -1 //Negative postings with credit indicator have positive sign, shall be reported as negative

      end                                                                as CreditAmountInCoCodeCrcy,

      case
        when JournalEntryItem.DebitCreditCode = 'H'
          then 'C'
        else 'D'
      end                                                            as DebitCreditCode,

      @ObjectModel.foreignKey.association: '_Customer'
      JournalEntryItem.Customer                                          as Customer,
      @ObjectModel.foreignKey.association: '_Supplier'
      JournalEntryItem.Supplier                                          as Supplier,
      JournalEntryItem.TaxCode                                           as TaxCode,

      @ObjectModel.foreignKey.association: '_ReferenceDocumentType'
      JournalEntryItem.ReferenceDocumentType,
      JournalEntryItem.ReversalReferenceDocument,
      JournalEntryItem.IsReversed,
      @ObjectModel.foreignKey.association: '_CostCenter'
      JournalEntryItem.CostCenter                                        as CostCenter,
      @ObjectModel.foreignKey.association: '_ControllingArea'
      JournalEntryItem.ControllingArea                                   as ControllingArea,
      JournalEntryItem.Quantity                                          as Quantity,

      @ObjectModel.foreignKey.association: '_LogicalSystem'
      JournalEntryItem.LogicalSystem                                     as LogicalSystem,
      JournalEntryItem.TransactionTypeDetermination                      as TransactionTypeDetermination,
      JournalEntryItem.FinancialAccountType                              as FinancialAccountType,

      JournalEntryItem._CompanyCode._Country.TaxCalculationProcedure,
      @ObjectModel.foreignKey.association: '_Order'
      JournalEntryItem.OrderID,
      JournalEntryItem.AmountInTransactionCurrency,
      JournalEntryItem.TransactionCurrency,
      JournalEntryItem.ValueDate,
      JournalEntryItem.AccountingDocumentItem,
      JournalEntryItem.IsReversal,
      JournalEntryItem.SalesDocument,
      JournalEntryItem.SalesDocumentItem,
      JournalEntryItem.InvoiceReference,
      JournalEntryItem.InvoiceItemReference,
      JournalEntryItem._JournalEntry.DocumentReferenceID,
      JournalEntryItem.ReferenceDocumentContext,

      AcctgDocItem.AccountingDocumentItemType,

      GLAccount.ReconciliationAccountType,

      //Associations

      _SourceLedger,
      JournalEntryItem._CompanyCode,
      _FiscalYear,
      _JournalEntry,
      _Ledger,
      _CompanyCodeCurrency,
      _GLAccountInChartOfAccounts,
      _AlternativeGLAccount,
      _ChartOfAccounts,
      _CountryChartOfAccounts,
      _Customer,
      _Supplier,
      _CostCenter,
      _ControllingArea,
      _LogicalSystem,
      _ReferenceDocumentType,
      _Order
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COMPANYCODE",
"I_COUNTRY",
"I_GLACCOUNTINCOMPANYCODE",
"I_JOURNALENTRY",
"I_JOURNALENTRYITEM",
"I_OPERATIONALACCTGDOCITEM"
],
"ASSOCIATED":
[
"I_CHARTOFACCOUNTS",
"I_COMPANYCODE",
"I_CONTROLLINGAREA",
"I_COSTCENTER",
"I_CURRENCY",
"I_CUSTOMER",
"I_FISCALYEARFORCOMPANYCODE",
"I_GLACCOUNTINCHARTOFACCOUNTS",
"I_JOURNALENTRY",
"I_LEDGER",
"I_LOGICALSYSTEM",
"I_ORDER",
"I_REFERENCEDOCUMENTTYPE",
"I_SUPPLIER"
],
"BASE":
[
"I_JOURNALENTRYITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/