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.
@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_VARIABLEdefineview P_AU_StRpTPARFullyPaidInvcDoc
withparameters
P_FromReportingDate : figen_rep_date_from,
P_ToReportingDate : figen_rep_date_to
asselectfrom I_JournalEntry as JournalEntry
innerjoin 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 isnot 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 isnot initial
and OperationalAcctgDocItem.IsUsedInPaymentTransaction is initial // for reversal documents , AUGDT and AUGBL gets filled in the payment document
groupby
OperationalAcctgDocItem.CompanyCode,
OperationalAcctgDocItem.AccountingDocument,
OperationalAcctgDocItem.FiscalYear,
OperationalAcctgDocItem.Supplier,
OperationalAcctgDocItem.ClearingDate,
OperationalAcctgDocItem.ClearingJournalEntry,
OperationalAcctgDocItem.DebitCreditCode