P_PL_ExcessDelayInvcFinalAmt

DDL: P_PL_EXCESSDELAYINVCFINALAMT SQL: PEDINVFINAMT Type: view COMPOSITE

Calculate invoice final amount

P_PL_ExcessDelayInvcFinalAmt is a Composite CDS View that provides data about "Calculate invoice final amount" in SAP S/4HANA.

Parameters (2)

NameTypeDefault
P_KeyDate dats
P_CustomerSupplier char1

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PEDINVFINAMT view
AbapCatalog.compiler.compareFilter true view
VDM.private true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Calculate invoice final amount view

Fields (34)

KeyFieldSource TableSource FieldDescription
KEY StatryRptgEntity ExcessDelayAccountingItem StatryRptgEntity Reporting Entity
KEY StatryRptCategory ExcessDelayAccountingItem StatryRptCategory Report ID
KEY StatryRptRunID ExcessDelayAccountingItem StatryRptRunID Report Run ID
KEY CompanyCode ExcessDelayAccountingItem CompanyCode Receiver Company Code
KEY FiscalYear ExcessDelayAccountingItem FiscalYear G/L Fiscal Year
KEY AccountingDocument ExcessDelayAccountingItem AccountingDocument Journal Entry
KEY AccountingDocumentItem ExcessDelayAccountingItem AccountingDocumentItem Posting View Item
ClearingJournalEntry ExcessDelayAccountingItem ClearingJournalEntry Clrng doc.
AccountingDocumentType ExcessDelayAccountingItem AccountingDocumentType Journal Entry Type
DebitCreditCode ExcessDelayAccountingItem DebitCreditCode Single-Character Flag
CompanyCodeCurrency ExcessDelayAccountingItem CompanyCodeCurrency Local Currency
Supplier ExcessDelayAccountingItem Supplier Supplier
Customer ExcessDelayAccountingItem Customer Sold-to Party
DocumentDate ExcessDelayAccountingItem DocumentDate Journal Entry Date
PostingDate ExcessDelayAccountingItem PostingDate Posting Date for GR
DueCalculationBaseDate ExcessDelayAccountingItem DueCalculationBaseDate Due Calculation Base Date
NetDueDate ExcessDelayAccountingItem NetDueDate Net Due Date
ClearingDate ExcessDelayAccountingItem ClearingDate Clearing Date
InvoiceReceiptDate ExcessDelayAccountingItem InvoiceReceiptDate Invoice Receipt Date
DocumentReferenceID ExcessDelayAccountingItem DocumentReferenceID Reference
DocumentItemText ExcessDelayAccountingItem DocumentItemText Text
InvoiceReference ExcessDelayAccountingItem InvoiceReference Invoice Reference
InvoiceItemReference ExcessDelayAccountingItem InvoiceItemReference Item
InvoiceReferenceFiscalYear ExcessDelayAccountingItem InvoiceReferenceFiscalYear Invoice Reference Fiscal Year
FollowOnDocumentType ExcessDelayAccountingItem FollowOnDocumentType Follow-On Document Type
PaymentTerms ExcessDelayAccountingItem PaymentTerms Pyt Terms
CashDiscount1Days ExcessDelayAccountingItem CashDiscount1Days Days from Baseline Date for Payment
CashDiscount2Days ExcessDelayAccountingItem CashDiscount2Days Days from Baseline Date for Payment
NetPaymentDays ExcessDelayAccountingItem NetPaymentDays Net Pmt Terms Period
CashDiscount1Percent ExcessDelayAccountingItem CashDiscount1Percent Disc. Percent 1
CashDiscount2Percent ExcessDelayAccountingItem CashDiscount2Percent Disc. Percent 2
AssignmentReference ExcessDelayAccountingItem AssignmentReference Assignment Reference
CustomerSupplier ExcessDelayAccountingItem CustomerSupplier
NetDueDateP_KeyDate1endasNumberOfDays

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_PL_ExcessDelayInvcFinalAmt.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PEDINVFINAMT
-- Parameters: P_KeyDate : dats, P_CustomerSupplier : char1

CREATE VIEW P_PL_ExcessDelayInvcFinalAmt AS
SELECT
  ExcessDelayAccountingItem.StatryRptgEntity AS StatryRptgEntity,
  ExcessDelayAccountingItem.StatryRptCategory AS StatryRptCategory,
  ExcessDelayAccountingItem.StatryRptRunID AS StatryRptRunID,
  ExcessDelayAccountingItem.CompanyCode AS CompanyCode,
  ExcessDelayAccountingItem.FiscalYear AS FiscalYear,
  ExcessDelayAccountingItem.AccountingDocument AS AccountingDocument,
  ExcessDelayAccountingItem.AccountingDocumentItem AS AccountingDocumentItem,
  ExcessDelayAccountingItem.ClearingJournalEntry AS ClearingJournalEntry,
  ExcessDelayAccountingItem.AccountingDocumentType AS AccountingDocumentType,
  ExcessDelayAccountingItem.DebitCreditCode AS DebitCreditCode,
  ExcessDelayAccountingItem.CompanyCodeCurrency AS CompanyCodeCurrency,
  ExcessDelayAccountingItem.Supplier AS Supplier,
  ExcessDelayAccountingItem.Customer AS Customer,
  ExcessDelayAccountingItem.DocumentDate AS DocumentDate,
  ExcessDelayAccountingItem.PostingDate AS PostingDate,
  ExcessDelayAccountingItem.DueCalculationBaseDate AS DueCalculationBaseDate,
  ExcessDelayAccountingItem.NetDueDate AS NetDueDate,
  ExcessDelayAccountingItem.ClearingDate AS ClearingDate,
  ExcessDelayAccountingItem.InvoiceReceiptDate AS InvoiceReceiptDate,
  ExcessDelayAccountingItem.DocumentReferenceID AS DocumentReferenceID,
  ExcessDelayAccountingItem.DocumentItemText AS DocumentItemText,
  ExcessDelayAccountingItem.InvoiceReference AS InvoiceReference,
  ExcessDelayAccountingItem.InvoiceItemReference AS InvoiceItemReference,
  ExcessDelayAccountingItem.InvoiceReferenceFiscalYear AS InvoiceReferenceFiscalYear,
  ExcessDelayAccountingItem.FollowOnDocumentType AS FollowOnDocumentType,
  ExcessDelayAccountingItem.PaymentTerms AS PaymentTerms,
  ExcessDelayAccountingItem.CashDiscount1Days AS CashDiscount1Days,
  ExcessDelayAccountingItem.CashDiscount2Days AS CashDiscount2Days,
  ExcessDelayAccountingItem.NetPaymentDays AS NetPaymentDays,
  ExcessDelayAccountingItem.CashDiscount1Percent AS CashDiscount1Percent,
  ExcessDelayAccountingItem.CashDiscount2Percent AS CashDiscount2Percent,
  ExcessDelayAccountingItem.AssignmentReference AS AssignmentReference,
  ExcessDelayAccountingItem.CustomerSupplier AS CustomerSupplier,
  case when ( ExcessDelayAccountingItem.ClearingJournalEntry is not initial and ExcessDelayAccountingItem.ClearingJournalEntry is not null and ExcessDelayAccountingItem.ClearingJournalEntry <> '' ) and ( ExcessDelayAccountingItem.ClearingDate is not initial and ExcessDelayAccountingItem.ClearingDate is not null and ExcessDelayAccountingItem.ClearingDate <> '00000000' ) then case when ExcessDelayAccountingItem.ClearingDate <= ExcessDelayAccountingItem.NetDueDate then 0 else dats_days_between(ExcessDelayAccountingItem.NetDueDate, ExcessDelayAccountingItem.ClearingDate) end else dats_days_between(ExcessDelayAccountingItem.NetDueDate, :P_KeyDate) + 1 end as NumberOfDays AS NetDueDateP_KeyDate1endasNumberOfDays
;