P_AU_StRpPaytTmesRptgDoc1

DDL: P_AU_STRPPAYTTMESRPTGDOC1 Type: view_entity COMPOSITE Package: GLO_FIN_IS_AU

AU PTR Documents

P_AU_StRpPaytTmesRptgDoc1 is a Composite CDS View that provides data about "AU PTR Documents" in SAP S/4HANA. It reads from 1 data source (I_OperationalAcctgDocItem) and exposes 31 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem. It has 5 associations to related views. Part of development package GLO_FIN_IS_AU.

Data Sources (1)

SourceAliasJoin Type
I_OperationalAcctgDocItem doc from

Parameters (3)

NameTypeDefault
P_AU_InvoiceIssueDateType fiau_invoice_issue_date_type
P_FromReportingDate figen_rep_date_from
P_ToReportingDate figen_rep_date_to

Associations (5)

CardinalityTargetAliasCondition
[0..*] I_AU_StRpPTRSmallBusinessIdn _PTRSmallBusiness $projection.CompanyCode = _PTRSmallBusiness.CompanyCode and $projection.Supplier = _PTRSmallBusiness.Supplier
[0..*] I_StRpJournalEntryLog _ReportedItemsLog _ReportedItemsLog.CompanyCode = $projection.CompanyCode and _ReportedItemsLog.AccountingDocument = $projection.AccountingDocument and _ReportedItemsLog.FiscalYear = $projection.FiscalYear
[0..1] I_JournalEntry _ReferenceInvoice doc.CompanyCode = _ReferenceInvoice.CompanyCode and doc.InvoiceReference = _ReferenceInvoice.AccountingDocument and doc.InvoiceReferenceFiscalYear = _ReferenceInvoice.FiscalYear and doc.InvoiceReference is not null and doc.InvoiceReference is not initial
[0..1] I_OperationalAcctgDocItem _ReferenceInvoiceItem doc.CompanyCode = _ReferenceInvoiceItem.CompanyCode and doc.InvoiceReference = _ReferenceInvoiceItem.AccountingDocument and doc.InvoiceReferenceFiscalYear = _ReferenceInvoiceItem.FiscalYear and doc.Supplier = _ReferenceInvoiceItem.Supplier and doc.InvoiceReference is not null and doc.InvoiceReference is not initial
[0..1] I_Businesspartnertaxnumber _Businesspartnertaxnumber _Businesspartnertaxnumber.BusinessPartner = $projection.businesspartner and _Businesspartnertaxnumber.BPTaxType = 'AU0'

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view

Fields (31)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_OperationalAcctgDocItem CompanyCode Receiver Company Code
KEY AccountingDocument I_OperationalAcctgDocItem AccountingDocument Journal Entry
KEY FiscalYear I_OperationalAcctgDocItem FiscalYear G/L Fiscal Year
KEY AccountingDocumentItem I_OperationalAcctgDocItem AccountingDocumentItem Posting View Item
CompanyCodeName
VATRegistration
Supplier I_OperationalAcctgDocItem Supplier Supplier
BusinessPartner
BPTaxNumber I_OperationalAcctgDocItem VATRegistration VAT Registration No.
ClearingDate I_OperationalAcctgDocItem ClearingDate Clearing Date
PostingDateendendasInvoiceIssueDate
PostingDate I_OperationalAcctgDocItem PostingDate Posting Date for GR
AccountingDocumentType I_OperationalAcctgDocItem AccountingDocumentType Journal Entry Type
SupplierAccountGroup
PartnerCompany I_OperationalAcctgDocItem PartnerCompany Trading Partner
TradingPartner
ClearingJournalEntry I_OperationalAcctgDocItem ClearingJournalEntry Clrng doc.
InvoiceReference I_OperationalAcctgDocItem InvoiceReference Invoice Reference
InvoiceReferenceFiscalYear I_OperationalAcctgDocItem InvoiceReferenceFiscalYear Invoice Reference Fiscal Year
DebitCreditCode I_OperationalAcctgDocItem DebitCreditCode Single-Character Flag
PaymentTermsendasPaymentTerms
CashDiscount1Percent I_OperationalAcctgDocItem CashDiscount1Percent Disc. Percent 1
CashDiscount2Percent I_OperationalAcctgDocItem CashDiscount2Percent Disc. Percent 2
CashDiscount1Days I_OperationalAcctgDocItem CashDiscount1Days Days from Baseline Date for Payment
CashDiscount2Days I_OperationalAcctgDocItem CashDiscount2Days Days from Baseline Date for Payment
NetPaymentDays I_OperationalAcctgDocItem NetPaymentDays Net Pmt Terms Period
ReferenceDocumentType I_OperationalAcctgDocItem ReferenceDocumentType Reference Document Type
CompanyCodeCurrency I_OperationalAcctgDocItem CompanyCodeCurrency Local Currency
_PTRSmallBusiness _PTRSmallBusiness
_ReportedItemsLog _ReportedItemsLog
_Businesspartnertaxnumber _Businesspartnertaxnumber

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_AU_StRpPaytTmesRptgDoc1.
-- 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.
-- Parameters: P_AU_InvoiceIssueDateType : fiau_invoice_issue_date_type, P_FromReportingDate : figen_rep_date_from, P_ToReportingDate : figen_rep_date_to

CREATE VIEW P_AU_StRpPaytTmesRptgDoc1 AS
SELECT
  doc.CompanyCode AS CompanyCode,
  doc.AccountingDocument AS AccountingDocument,
  doc.FiscalYear AS FiscalYear,
  doc.AccountingDocumentItem AS AccountingDocumentItem,
  doc._CompanyCode.CompanyCodeName AS CompanyCodeName,
  doc._CompanyCode.VATRegistration AS VATRegistration,
  doc.Supplier AS Supplier,
  doc._Supplier._SupplierToBusinessPartner._BusinessPartner.BusinessPartner AS BusinessPartner,
  doc.VATRegistration AS BPTaxNumber,
  doc.ClearingDate AS ClearingDate,
  case when _ReferenceInvoice.AccountingDocument is not null then case $parameters.P_AU_InvoiceIssueDateType when '1' then _ReferenceInvoice.DocumentDate when '2' then _ReferenceInvoice.PostingDate when '3' then _ReferenceInvoice.InvoiceReceiptDate else _ReferenceInvoice.PostingDate end else case $parameters.P_AU_InvoiceIssueDateType when '1' then doc.DocumentDate when '2' then doc.PostingDate when '3' then doc._JournalEntry.InvoiceReceiptDate else doc.PostingDate end end as InvoiceIssueDate AS PostingDateendendasInvoiceIssueDate,
  doc.PostingDate AS PostingDate,
  doc.AccountingDocumentType AS AccountingDocumentType,
  doc._Supplier.SupplierAccountGroup AS SupplierAccountGroup,
  doc.PartnerCompany AS PartnerCompany,
  doc._Supplier.TradingPartner AS TradingPartner,
  doc.ClearingJournalEntry AS ClearingJournalEntry,
  doc.InvoiceReference AS InvoiceReference,
  doc.InvoiceReferenceFiscalYear AS InvoiceReferenceFiscalYear,
  doc.DebitCreditCode AS DebitCreditCode,
  case when _ReferenceInvoice.AccountingDocument is not null then _ReferenceInvoiceItem.PaymentTerms else doc.PaymentTerms end as PaymentTerms AS PaymentTermsendasPaymentTerms,
  doc.CashDiscount1Percent AS CashDiscount1Percent,
  doc.CashDiscount2Percent AS CashDiscount2Percent,
  doc.CashDiscount1Days AS CashDiscount1Days,
  doc.CashDiscount2Days AS CashDiscount2Days,
  doc.NetPaymentDays AS NetPaymentDays,
  doc.ReferenceDocumentType AS ReferenceDocumentType,
  doc.CompanyCodeCurrency AS CompanyCodeCurrency
FROM I_OperationalAcctgDocItem AS doc
LEFT OUTER JOIN I_AU_StRpPTRSmallBusinessIdn AS _PTRSmallBusiness ON CompanyCode = _PTRSmallBusiness.CompanyCode AND Supplier = _PTRSmallBusiness.Supplier  -- association [0..*]
LEFT OUTER JOIN I_StRpJournalEntryLog AS _ReportedItemsLog ON _ReportedItemsLog.CompanyCode = CompanyCode AND _ReportedItemsLog.AccountingDocument = AccountingDocument AND _ReportedItemsLog.FiscalYear = FiscalYear  -- association [0..*]
LEFT OUTER JOIN I_JournalEntry AS _ReferenceInvoice ON doc.CompanyCode = _ReferenceInvoice.CompanyCode AND doc.InvoiceReference = _ReferenceInvoice.AccountingDocument AND doc.InvoiceReferenceFiscalYear = _ReferenceInvoice.FiscalYear AND doc.InvoiceReference is not null AND doc.InvoiceReference is not initial  -- association [0..1]
LEFT OUTER JOIN I_OperationalAcctgDocItem AS _ReferenceInvoiceItem ON doc.CompanyCode = _ReferenceInvoiceItem.CompanyCode AND doc.InvoiceReference = _ReferenceInvoiceItem.AccountingDocument AND doc.InvoiceReferenceFiscalYear = _ReferenceInvoiceItem.FiscalYear AND doc.Supplier = _ReferenceInvoiceItem.Supplier AND doc.InvoiceReference is not null AND doc.InvoiceReference is not initial  -- association [0..1]
LEFT OUTER JOIN I_Businesspartnertaxnumber AS _Businesspartnertaxnumber ON _Businesspartnertaxnumber.BusinessPartner = businesspartner AND _Businesspartnertaxnumber.BPTaxType = 'AU0'  -- association [0..1]
;