P_APCshDiscDocument1

DDL: P_APCSHDISCDOCUMENT1 SQL: PFIAPCSHDISDOC1 Type: view COMPOSITE Package: FINS_FIS_AP_APPS

Account Payable Cash Discount Document

P_APCshDiscDocument1 is a Composite CDS View that provides data about "Account Payable Cash Discount Document" in SAP S/4HANA. It reads from 1 data source (I_ReceivablesPayablesItem) and exposes 36 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem. It has 3 associations to related views. Part of development package FINS_FIS_AP_APPS.

Data Sources (1)

SourceAliasJoin Type
I_ReceivablesPayablesItem I_ReceivablesPayablesItem from

Parameters (1)

NameTypeDefault
P_KeyDate abap.dats

Associations (3)

CardinalityTargetAliasCondition
[1..1] I_AccountingDocument _AccountingDocument $projection.AccountingDocument = _AccountingDocument.AccountingDocument and $projection.CompanyCode = _AccountingDocument.CompanyCode and $projection.FiscalYear = _AccountingDocument.FiscalYear
[1..1] I_SupplierCompany _SupplierCompany $projection.Supplier = _SupplierCompany.Supplier and $projection.CompanyCode = _SupplierCompany.CompanyCode
[1..1] I_CustomerPaymentTerms _CustomerPaymentTerms $projection.PaymentTerms = _CustomerPaymentTerms.CustomerPaymentTerms

Annotations (6)

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

Fields (36)

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
FixedCashDiscount FixedCashDiscount Fixed Cash Discount
DueCalculationBaseDate DueCalculationBaseDate Due Calculation Base Date
CashDiscount1Percent CashDiscount1Percent Disc. Percent 1
CashDiscount2Percent CashDiscount2Percent Disc. Percent 2
IsSalesRelated IsSalesRelated Is Sales Related
DebitCreditCode DebitCreditCode Single-Character Flag
CashDiscountBaseAmount CashDiscountBaseAmount Cash Dscnt Base Amt
CashDiscountAmount CashDiscountAmount CD Amount
Supplier Creditor Supplier
ClearingDate ClearingDate Clearing Date
FinancialAccountType FinancialAccountType Fin. Account Type
ClearingAccountingDocument ClearingAccountingDocument Clearing Journal Entry
PaymentTerms PaymentTerms Pyt Terms
PaymentBlockingReason PaymentBlockingReason Pmnt block
ClearingDocFiscalYear ClearingDocFiscalYear Fiscal Year of Clearing Journal Entry
CashDiscount1Days CashDiscount1Days Days from Baseline Date for Payment
CashDiscount2Days CashDiscount2Days Days from Baseline Date for Payment
DocumentDate DocumentDate Journal Entry Date
ValueDate ValueDate Value Date
PostingDate PostingDate Posting Date for GR
NetPaymentDays NetPaymentDays Net Pmt Terms Period
AmountInTransactionCurrency AmountInTransactionCurrency Pt Crcy Amt
TransactionCurrency TransactionCurrency Transaction Currency
KeyDate
AccountingDocumentCategory AccountingDocumentCategory Journal Entry Category
SpecialGLCode SpecialGLCode Special G/L Ind
APARToleranceGroup _SupplierCompany APARToleranceGroup Tolerance Group
_Supplier _Supplier
_CompanyCode _CompanyCode
_AccountingDocument _AccountingDocument
_CustomerPaymentTerms _CustomerPaymentTerms
_SupplierCompany _SupplierCompany

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_APCshDiscDocument1.
-- 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: PFIAPCSHDISDOC1
-- Parameters: P_KeyDate : abap.dats

CREATE VIEW P_APCshDiscDocument1 AS
SELECT
  CompanyCode,
  AccountingDocument,
  FiscalYear,
  AccountingDocumentItem,
  FixedCashDiscount,
  DueCalculationBaseDate,
  CashDiscount1Percent,
  CashDiscount2Percent,
  IsSalesRelated,
  DebitCreditCode,
  CashDiscountBaseAmount,
  CashDiscountAmount,
  Creditor AS Supplier,
  ClearingDate,
  FinancialAccountType,
  ClearingAccountingDocument,
  PaymentTerms,
  PaymentBlockingReason,
  ClearingDocFiscalYear,
  CashDiscount1Days,
  CashDiscount2Days,
  DocumentDate,
  ValueDate,
  PostingDate,
  NetPaymentDays,
  AmountInTransactionCurrency,
  TransactionCurrency,
  :P_KeyDate AS KeyDate,
  AccountingDocumentCategory,
  SpecialGLCode,
  _SupplierCompany.APARToleranceGroup AS APARToleranceGroup
FROM I_ReceivablesPayablesItem
LEFT OUTER JOIN I_AccountingDocument AS _AccountingDocument ON AccountingDocument = _AccountingDocument.AccountingDocument AND CompanyCode = _AccountingDocument.CompanyCode AND FiscalYear = _AccountingDocument.FiscalYear  -- association [1..1]
LEFT OUTER JOIN I_SupplierCompany AS _SupplierCompany ON Supplier = _SupplierCompany.Supplier AND CompanyCode = _SupplierCompany.CompanyCode  -- association [1..1]
LEFT OUTER JOIN I_CustomerPaymentTerms AS _CustomerPaymentTerms ON PaymentTerms = _CustomerPaymentTerms.CustomerPaymentTerms  -- association [1..1]
;