P_AU_StRpPaytTmesRptgDoc2

DDL: P_AU_STRPPAYTTMESRPTGDOC2 Type: view_entity COMPOSITE Package: GLO_FIN_IS_AU

AU PTR Documents

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

Data Sources (1)

SourceAliasJoin Type
P_AU_StRpPaytTmesRptgDoc1 P_AU_StRpPaytTmesRptgDoc1 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 (3)

CardinalityTargetAliasCondition
[0..1] I_SupplierInvoice _SupplierInvoice _SupplierInvoice.SupplierInvoice = docs.SupplierInvoice and _SupplierInvoice.FiscalYear = docs.SupplierInvoiceFiscalYear and _SupplierInvoice.CompanyCode = docs.CompanyCode and ( docs.SupplierInvoice is not null and docs.SupplierInvoice is not initial )
[0..1] P_AU_PurchaseHistory _PurchaseHistory _PurchaseHistory.SupplierInvoice = docs.SupplierInvoice and _PurchaseHistory.FiscalYear = docs.SupplierInvoiceFiscalYear and _PurchaseHistory.SuplrInvcPurgDocItmCompanyCode = docs.CompanyCode and ( docs.SupplierInvoice is not null and docs.SupplierInvoice is not initial )
[0..1] P_AU_StRpPTRMultiplePOPerInvc _MultiplePOPerInvc _MultiplePOPerInvc.SupplierInvoice = docs.SupplierInvoice and _MultiplePOPerInvc.FiscalYear = docs.SupplierInvoiceFiscalYear and _MultiplePOPerInvc.SuplrInvcPurgDocItmCompanyCode = docs.CompanyCode and ( docs.SupplierInvoice is not null and docs.SupplierInvoice is not initial )

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 (30)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode docs CompanyCode Receiver Company Code
KEY AccountingDocument docs AccountingDocument Journal Entry
KEY FiscalYear docs FiscalYear G/L Fiscal Year
KEY AccountingDocumentItem docs AccountingDocumentItem Posting View Item
PostingDate docs PostingDate Posting Date for GR
CompanyCodeName docs CompanyCodeName Company Name
VATRegistration docs VATRegistration VAT Registration No.
Supplier docs Supplier Supplier
BusinessPartner docs BusinessPartner Issuing Authority
SupplierInvoice docs SupplierInvoice
SupplierInvoiceFiscalYear docs SupplierInvoiceFiscalYear
InvoiceReference docs InvoiceReference Invoice Reference
InvoiceReferenceFiscalYear docs InvoiceReferenceFiscalYear Invoice Reference Fiscal Year
BPTaxNumberendasBPTaxNumber
InvcHasMultiplePurchaseOrders _MultiplePOPerInvc InvcHasMultiplePurchaseOrders
ClearingDateendasPaymentDate
InvoiceIssueDate docs InvoiceIssueDate
LastGoodsReceiptPostingDate _PurchaseHistory LastGoodsReceiptPostingDate
InvoiceIssueDateendasReportingDate
SupplierInvoiceOrigin _SupplierInvoice SupplierInvoiceOrigin IV category
PaymentTerms docs PaymentTerms Pyt Terms
AccountingDocumentType docs AccountingDocumentType Journal Entry Type
SupplierAccountGroup docs SupplierAccountGroup Account group
TradingPartner docs TradingPartner Trading Partner
DebitCreditCode docs DebitCreditCode Single-Character Flag
CompanyCodeCurrency docs CompanyCodeCurrency Local Currency
AU_AccountingDocumentType docs AU_AccountingDocumentType
CashDiscountAmtInCoCodeCrcy docs CashDiscountAmtInCoCodeCrcy Discount Amt
_PTRSmallBusiness docs _PTRSmallBusiness
_ReportedItemsLog docs _ReportedItemsLog

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_StRpPaytTmesRptgDoc2.
-- 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_StRpPaytTmesRptgDoc2 AS
SELECT
  docs.CompanyCode AS CompanyCode,
  docs.AccountingDocument AS AccountingDocument,
  docs.FiscalYear AS FiscalYear,
  docs.AccountingDocumentItem AS AccountingDocumentItem,
  docs.PostingDate AS PostingDate,
  docs.CompanyCodeName AS CompanyCodeName,
  docs.VATRegistration AS VATRegistration,
  docs.Supplier AS Supplier,
  docs.BusinessPartner AS BusinessPartner,
  docs.SupplierInvoice AS SupplierInvoice,
  docs.SupplierInvoiceFiscalYear AS SupplierInvoiceFiscalYear,
  docs.InvoiceReference AS InvoiceReference,
  docs.InvoiceReferenceFiscalYear AS InvoiceReferenceFiscalYear,
  case when docs.BPTaxNumber is not initial then docs.BPTaxNumber when docs._Businesspartnertaxnumber.BPTaxNumber is not initial then docs._Businesspartnertaxnumber.BPTaxNumber end as BPTaxNumber AS BPTaxNumberendasBPTaxNumber,
  _MultiplePOPerInvc.InvcHasMultiplePurchaseOrders AS InvcHasMultiplePurchaseOrders,
  case when docs.AU_AccountingDocumentType = '006' then docs.PostingDate when docs.AU_AccountingDocumentType = '002' then docs.ClearingDate end as PaymentDate AS ClearingDateendasPaymentDate,
  docs.InvoiceIssueDate AS InvoiceIssueDate,
  _PurchaseHistory.LastGoodsReceiptPostingDate AS LastGoodsReceiptPostingDate,
  case when _PurchaseHistory.LastGoodsReceiptPostingDate is not initial then _PurchaseHistory.LastGoodsReceiptPostingDate else docs.InvoiceIssueDate end as ReportingDate AS InvoiceIssueDateendasReportingDate,
  _SupplierInvoice.SupplierInvoiceOrigin AS SupplierInvoiceOrigin,
  docs.PaymentTerms AS PaymentTerms,
  docs.AccountingDocumentType AS AccountingDocumentType,
  docs.SupplierAccountGroup AS SupplierAccountGroup,
  docs.TradingPartner AS TradingPartner,
  docs.DebitCreditCode AS DebitCreditCode,
  docs.CompanyCodeCurrency AS CompanyCodeCurrency,
  docs.AU_AccountingDocumentType AS AU_AccountingDocumentType,
  docs.CashDiscountAmtInCoCodeCrcy AS CashDiscountAmtInCoCodeCrcy,
  docs._PTRSmallBusiness AS _PTRSmallBusiness,
  docs._ReportedItemsLog AS _ReportedItemsLog
FROM P_AU_StRpPaytTmesRptgDoc1
LEFT OUTER JOIN I_SupplierInvoice AS _SupplierInvoice ON _SupplierInvoice.SupplierInvoice = docs.SupplierInvoice AND _SupplierInvoice.FiscalYear = docs.SupplierInvoiceFiscalYear AND _SupplierInvoice.CompanyCode = docs.CompanyCode AND ( docs.SupplierInvoice is not null AND docs.SupplierInvoice is not initial )  -- association [0..1]
LEFT OUTER JOIN P_AU_PurchaseHistory AS _PurchaseHistory ON _PurchaseHistory.SupplierInvoice = docs.SupplierInvoice AND _PurchaseHistory.FiscalYear = docs.SupplierInvoiceFiscalYear AND _PurchaseHistory.SuplrInvcPurgDocItmCompanyCode = docs.CompanyCode AND ( docs.SupplierInvoice is not null AND docs.SupplierInvoice is not initial )  -- association [0..1]
LEFT OUTER JOIN P_AU_StRpPTRMultiplePOPerInvc AS _MultiplePOPerInvc ON _MultiplePOPerInvc.SupplierInvoice = docs.SupplierInvoice AND _MultiplePOPerInvc.FiscalYear = docs.SupplierInvoiceFiscalYear AND _MultiplePOPerInvc.SuplrInvcPurgDocItmCompanyCode = docs.CompanyCode AND ( docs.SupplierInvoice is not null AND docs.SupplierInvoice is not initial )  -- association [0..1]
;