P_APCshDiscDocument1
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)
| Source | Alias | Join Type |
|---|---|---|
| I_ReceivablesPayablesItem | I_ReceivablesPayablesItem | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_KeyDate | abap.dats |
Associations (3)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [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)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA