P_RU_InvoiceClearing

DDL: P_RU_INVOICECLEARING SQL: PRUINVOICECLR Type: view CONSUMPTION Package: GLO_FIN_IS_VAT_RU

Invoice Clearing

P_RU_InvoiceClearing is a Consumption CDS View that provides data about "Invoice Clearing" in SAP S/4HANA. It reads from 4 data sources (P_RU_AdvancePaymentDocument, P_RU_InvoiceClearing7, I_OperationalAcctgDocItem, I_OperationalAcctgDocItem) and exposes 5 fields. Part of development package GLO_FIN_IS_VAT_RU.

Data Sources (4)

SourceAliasJoin Type
P_RU_AdvancePaymentDocument AdvanceDocument left_outer
P_RU_InvoiceClearing7 InvoiceClearing from
I_OperationalAcctgDocItem PaymentDocumentGLItem left_outer
I_OperationalAcctgDocItem PaymentDocumentPTItem left_outer

Annotations (6)

NameValueLevelField
VDM.private true view
VDM.viewType #CONSUMPTION view
AbapCatalog.sqlViewName PRUINVOICECLR view
AbapCatalog.compiler.compareFilter true view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (5)

KeyFieldSource TableSource FieldDescription
CompanyCode P_RU_InvoiceClearing7 CompanyCode
Invoice P_RU_InvoiceClearing7 Invoice
InvoiceFiscalYear P_RU_InvoiceClearing7 InvoiceFiscalYear
Payment P_RU_InvoiceClearing7 ChildDocument
PaymentFiscalYear P_RU_InvoiceClearing7 ChildDocumentFiscalYear
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@AbapCatalog.sqlViewName: 'PRUINVOICECLR'
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #NOT_REQUIRED
-- Invoice Clearing
define view P_RU_InvoiceClearing
  as select from    P_RU_InvoiceClearing7       as InvoiceClearing

    left outer join P_RU_AdvancePaymentDocument as AdvanceDocument       on  AdvanceDocument.CompanyCode        = InvoiceClearing.CompanyCode
                                                                         and AdvanceDocument.AccountingDocument = InvoiceClearing.ChildDocument
                                                                         and AdvanceDocument.FiscalYear         = InvoiceClearing.ChildDocumentFiscalYear

    left outer join I_OperationalAcctgDocItem   as PaymentDocumentGLItem on  PaymentDocumentGLItem.CompanyCode                  = InvoiceClearing.CompanyCode
                                                                         and PaymentDocumentGLItem.AccountingDocument           = InvoiceClearing.ChildDocument
                                                                         and PaymentDocumentGLItem.FiscalYear                   = InvoiceClearing.ChildDocumentFiscalYear
                                                                         and PaymentDocumentGLItem.FinancialAccountType         = 'S'
                                                                         and PaymentDocumentGLItem.TransactionTypeDetermination = ''

    left outer join I_OperationalAcctgDocItem   as PaymentDocumentPTItem on  PaymentDocumentPTItem.CompanyCode                = InvoiceClearing.CompanyCode
                                                                         and PaymentDocumentPTItem.AccountingDocument         = InvoiceClearing.ChildDocument
                                                                         and PaymentDocumentPTItem.FiscalYear                 = InvoiceClearing.ChildDocumentFiscalYear
                                                                         and PaymentDocumentPTItem.IsUsedInPaymentTransaction = 'X'

{
  InvoiceClearing.CompanyCode,
  InvoiceClearing.Invoice,
  InvoiceClearing.InvoiceFiscalYear,
  //InvoiceClearing.ExternalInvoice,

  //InvoiceClearing.InvoiceDate,


  InvoiceClearing.ChildDocument           as Payment,
  InvoiceClearing.ChildDocumentFiscalYear as PaymentFiscalYear,
  case when AdvanceDocument.CompanyCode is not null
    then 'X'
    else ''
  end                                     as IsDownPayment

}
where
      AdvanceDocument.CompanyCode       is not null
  or  PaymentDocumentGLItem.CompanyCode is not null
  and PaymentDocumentPTItem.CompanyCode is not null