P_APCashDiscount5
cash discount 5
P_APCashDiscount5 is a Composite CDS View that provides data about "cash discount 5" in SAP S/4HANA. It reads from 1 data source (P_APCashDiscount4) and exposes 32 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem. It has 1 association to related views. Part of development package FINS_FIS_AP_APPS.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_APCashDiscount4 | P_APCashDiscount4 | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_KeyDate | abap.char(8) |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_ToleranceGroup | _ToleranceGroup | $projection.CompanyCode = _ToleranceGroup.CompanyCode and $projection.APARToleranceGroup = _ToleranceGroup.APARToleranceGroup |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PFIAPCSHDISC5 | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (32)
| 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 | |
| Supplier | Supplier | Supplier | ||
| PaymentBlockingReason | PaymentBlockingReason | Pmnt block | ||
| PaymentTerms | PaymentTerms | Pyt Terms | ||
| FinancialAccountType | FinancialAccountType | Fin. Account Type | ||
| AccountingDocumentCategory | AccountingDocumentCategory | Journal Entry Category | ||
| IsSalesRelated | IsSalesRelated | Is Sales Related | ||
| SpecialGLCode | SpecialGLCode | Special G/L Ind | ||
| ClearingAccountingDocument | ClearingAccountingDocument | Clearing Journal Entry | ||
| PostingDate | PostingDate | Posting Date for GR | ||
| DocumentDate | DocumentDate | Journal Entry Date | ||
| DueCalculationBaseDate | DueCalculationBaseDate | Due Calculation Base Date | ||
| CashDiscount1Percent | CashDiscount1Percent | Disc. Percent 1 | ||
| CashDiscount1Days | CashDiscount1Days | Days from Baseline Date for Payment | ||
| CashDiscount2Percent | CashDiscount2Percent | Disc. Percent 2 | ||
| CashDiscount2Days | CashDiscount2Days | Days from Baseline Date for Payment | ||
| NetPaymentDays | NetPaymentDays | Net Pmt Terms Period | ||
| DebitCreditCode | DebitCreditCode | Single-Character Flag | ||
| CashDiscountAmountInputted | CashDiscountAmountInputted | |||
| CashDiscountBaseAmount | CashDiscountBaseAmount | Cash Dscnt Base Amt | ||
| GrossAmount | GrossAmount | Gross value | ||
| Currency | Currency | Valuation Crcy | ||
| KeyDate | KeyDate | Maturity Key Date | ||
| APARToleranceGroup | APARToleranceGroup | Tolerance Group | ||
| NetDueDate | NetDueDate | Net Due Date | ||
| CashDiscount1DueDate | CashDiscount1DueDate | Cash Discount 1 | ||
| CashDiscount2DueDate | CashDiscount2DueDate | Cash Discount 2 | ||
| GraceDays | _ToleranceGroup | GraceDays | ||
| FixedCashDiscountendasFixedCashDiscount |
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_APCashDiscount5.
-- 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: PFIAPCSHDISC5
-- Parameters: P_KeyDate : abap.char(8)
CREATE VIEW P_APCashDiscount5 AS
SELECT
CompanyCode,
AccountingDocument,
FiscalYear,
AccountingDocumentItem,
Supplier,
PaymentBlockingReason,
PaymentTerms,
FinancialAccountType,
AccountingDocumentCategory,
IsSalesRelated,
SpecialGLCode,
ClearingAccountingDocument,
PostingDate,
DocumentDate,
DueCalculationBaseDate,
CashDiscount1Percent,
CashDiscount1Days,
CashDiscount2Percent,
CashDiscount2Days,
NetPaymentDays,
DebitCreditCode,
CashDiscountAmountInputted,
CashDiscountBaseAmount,
GrossAmount,
Currency,
KeyDate,
APARToleranceGroup,
NetDueDate,
CashDiscount1DueDate,
CashDiscount2DueDate,
_ToleranceGroup.GraceDays AS GraceDays,
(case P_APCashDiscount4.FixedCashDiscount when '' then case when _ToleranceGroup.FixedCashDiscount is null then '' when _ToleranceGroup.FixedCashDiscount = '0' then '' when _ToleranceGroup.FixedCashDiscount = '*' then '' else _ToleranceGroup.FixedCashDiscount end else P_APCashDiscount4.FixedCashDiscount end) as FixedCashDiscount AS FixedCashDiscountendasFixedCashDiscount
FROM P_APCashDiscount4
LEFT OUTER JOIN I_ToleranceGroup AS _ToleranceGroup ON CompanyCode = _ToleranceGroup.CompanyCode AND APARToleranceGroup = _ToleranceGroup.APARToleranceGroup -- association [0..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