P_APCshDiscUtilization8

DDL: P_APCSHDISCUTILIZATION8 SQL: PFIAPCSHDISUTI8 Type: view COMPOSITE

P_APCshDiscUtilization8 is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (P_APCshDiscUtilization4, P_APCshDiscUtilization7) and exposes 19 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem. It has 1 association to related views.

Data Sources (2)

SourceAliasJoin Type
P_APCshDiscUtilization4 P_APCshDiscUtilization4 from
P_APCshDiscUtilization7 P_APCshDiscUtilization7 left_outer

Parameters (2)

NameTypeDefault
P_KeyDate abap.dats
P_BeforeKeyDateDays abap.int4

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_AccountingDocument _AccountingDocument $projection.ClearingAccountingDocument = _AccountingDocument.AccountingDocument and $projection.CompanyCode = _AccountingDocument.CompanyCode and $projection.ClearingDocFiscalYear = _AccountingDocument.FiscalYear

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PFIAPCSHDISUTI8 view
VDM.private true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode CompanyCode Receiver Company Code
KEY AccountingDocument AccountingDocument Journal Entry
KEY FiscalYear FiscalYear G/L Fiscal Year
KEY AccountingDocumentItem AccountingDocumentItem Posting View Item
ClearingAccountingDocument ClearingAccountingDocument Clearing Journal Entry
ClearingDocFiscalYear ClearingDocFiscalYear Fiscal Year of Clearing Journal Entry
Supplier Supplier Supplier
PaymentTerms PaymentTerms Pyt Terms
TransactionCurrency TransactionCurrency Transaction Currency
KeyDate KeyDate Maturity Key Date
TakenCshDiscInTransacCrcy TakenCshDiscInTransacCrcy
OfferedCshDiscInTransacCrcy OfferedCshDiscInTransacCrcy
AccountingDocumentCreationDate AccountingDocumentCreationDate Journal Entry Date
DocumentDate DocumentDate Journal Entry Date
CashDiscountDuedate CashDiscountDuedate
DocumentDateendasPaymentDate
_Supplier _Supplier
_CompanyCode _CompanyCode
_CustomerPaymentTerms _CustomerPaymentTerms

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_APCshDiscUtilization8.
-- 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: PFIAPCSHDISUTI8
-- Parameters: P_KeyDate : abap.dats, P_BeforeKeyDateDays : abap.int4

CREATE VIEW P_APCshDiscUtilization8 AS
SELECT
  CompanyCode,
  AccountingDocument,
  FiscalYear,
  AccountingDocumentItem,
  ClearingAccountingDocument,
  ClearingDocFiscalYear,
  Supplier,
  PaymentTerms,
  TransactionCurrency,
  KeyDate,
  TakenCshDiscInTransacCrcy,
  OfferedCshDiscInTransacCrcy,
  AccountingDocumentCreationDate,
  DocumentDate,
  CashDiscountDuedate,
  case when ArrearsBaseDate = '1' then ValueDate else _AccountingDocument.DocumentDate end as PaymentDate AS DocumentDateendasPaymentDate
FROM P_APCshDiscUtilization4
LEFT OUTER JOIN P_APCshDiscUtilization7 ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_AccountingDocument AS _AccountingDocument ON ClearingAccountingDocument = _AccountingDocument.AccountingDocument AND CompanyCode = _AccountingDocument.CompanyCode AND ClearingDocFiscalYear = _AccountingDocument.FiscalYear  -- association [1..1]
;