P_AU_StRpTPARFullyPaidInvcDoc

DDL: P_AU_STRPTPARFULLYPAIDINVCDOC SQL: PAUSRTPARFPINVCD Type: view COMPOSITE

P_AU_StRpTPARFullyPaidInvcDoc is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_JournalEntry, I_OperationalAcctgDocItem) and exposes 8 fields with key fields CompanyCode, AccountingDocument, FiscalYear.

Data Sources (2)

SourceAliasJoin Type
I_JournalEntry JournalEntry from
I_OperationalAcctgDocItem OperationalAcctgDocItem inner

Parameters (2)

NameTypeDefault
P_FromReportingDate figen_rep_date_from
P_ToReportingDate figen_rep_date_to

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PAUSRTPARFPINVCD view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
VDM.viewType #COMPOSITE view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (8)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_OperationalAcctgDocItem CompanyCode
KEY AccountingDocument I_OperationalAcctgDocItem AccountingDocument
KEY FiscalYear I_OperationalAcctgDocItem FiscalYear
Supplier I_OperationalAcctgDocItem Supplier
ReportingDate I_OperationalAcctgDocItem ClearingDate
ClearingJournalEntry I_OperationalAcctgDocItem ClearingJournalEntry
DebitCreditCode I_OperationalAcctgDocItem DebitCreditCode
TotalGrossAmountInCoCodeCrcy
@AbapCatalog.sqlViewName: 'PAUSRTPARFPINVCD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_AU_StRpTPARFullyPaidInvcDoc
  with parameters

    P_FromReportingDate : figen_rep_date_from,
    P_ToReportingDate   : figen_rep_date_to

  as select from I_JournalEntry            as JournalEntry
    inner join   I_OperationalAcctgDocItem as OperationalAcctgDocItem on  JournalEntry.CompanyCode        = OperationalAcctgDocItem.CompanyCode
                                                                      and JournalEntry.AccountingDocument = OperationalAcctgDocItem.ClearingJournalEntry
                                                                      and JournalEntry.FiscalYear         = OperationalAcctgDocItem.ClearingJournalEntryFiscalYear



{
  key OperationalAcctgDocItem.CompanyCode,
  key OperationalAcctgDocItem.AccountingDocument,
  key OperationalAcctgDocItem.FiscalYear,
      OperationalAcctgDocItem.Supplier,
      OperationalAcctgDocItem.ClearingDate                     as ReportingDate,
      OperationalAcctgDocItem.ClearingJournalEntry,
      OperationalAcctgDocItem.DebitCreditCode,
      //Summation of amount of all vendor lines (for the same clearing document on the same clearing date)

      sum(OperationalAcctgDocItem.AmountInCompanyCodeCurrency) as TotalGrossAmountInCoCodeCrcy
}

where
      JournalEntry.PostingDate                           between $parameters.P_FromReportingDate and $parameters.P_ToReportingDate
  and JournalEntry.ReverseDocument                       is initial // Reversed documents are not considered

  and OperationalAcctgDocItem.ClearingDate               between :P_FromReportingDate and :P_ToReportingDate //selection parameter

  and OperationalAcctgDocItem.ClearingJournalEntry       is not initial
  and OperationalAcctgDocItem.ClearingJournalEntry       <>      OperationalAcctgDocItem.AccountingDocument
  and OperationalAcctgDocItem.FinancialAccountType       =       'K' // koart = K for vendors

  and OperationalAcctgDocItem.SpecialGLCode              is initial //UMSKZ - special GL indicator should be blank to remove the down payment documents

  and OperationalAcctgDocItem.TaxCode                    is not initial
  and OperationalAcctgDocItem.IsUsedInPaymentTransaction is initial // for reversal documents , AUGDT and AUGBL gets filled in the payment document


group by
  OperationalAcctgDocItem.CompanyCode,
  OperationalAcctgDocItem.AccountingDocument,
  OperationalAcctgDocItem.FiscalYear,
  OperationalAcctgDocItem.Supplier,
  OperationalAcctgDocItem.ClearingDate,
  OperationalAcctgDocItem.ClearingJournalEntry,
  OperationalAcctgDocItem.DebitCreditCode