P_APCshDiscDocument2
Account Payable Cash Discount Document
P_APCshDiscDocument2 is a Composite CDS View that provides data about "Account Payable Cash Discount Document" in SAP S/4HANA. It reads from 1 data source (P_APCshDiscDocument1) and exposes 39 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_APCshDiscDocument1 | P_APCshDiscDocument1 | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_KeyDate | abap.dats |
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 | PFIAPCSHDISDOC2 | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (39)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | P_APCshDiscDocument1 | CompanyCode | Receiver Company Code |
| KEY | AccountingDocument | AccountingDocument | Journal Entry | |
| KEY | FiscalYear | FiscalYear | G/L Fiscal Year | |
| KEY | AccountingDocumentItem | AccountingDocumentItem | Posting View Item | |
| DueCalculationBaseDate | DueCalculationBaseDate | Due Calculation Base Date | ||
| CashDiscountBaseAmount | CashDiscountBaseAmount | Cash Dscnt Base Amt | ||
| CashDiscount1Percent | CashDiscount1Percent | Disc. Percent 1 | ||
| CashDiscount2Percent | CashDiscount2Percent | Disc. Percent 2 | ||
| IsSalesRelated | IsSalesRelated | Is Sales Related | ||
| DebitCreditCode | DebitCreditCode | Single-Character Flag | ||
| CashDiscountAmount | CashDiscountAmount | CD Amount | ||
| Supplier | Supplier | 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 | ||
| PostingDate | PostingDate | Posting Date for GR | ||
| NetPaymentDays | NetPaymentDays | Net Pmt Terms Period | ||
| AmountInTransactionCurrency | AmountInTransactionCurrency | Pt Crcy Amt | ||
| TransactionCurrency | TransactionCurrency | Transaction Currency | ||
| DocumentDate | DocumentDate | Journal Entry Date | ||
| ValueDate | ValueDate | Value Date | ||
| KeyDate | KeyDate | Maturity Key Date | ||
| DaysDifference | DaysDifference | |||
| AccountingDocumentCategory | AccountingDocumentCategory | Journal Entry Category | ||
| SpecialGLCode | SpecialGLCode | Special G/L Ind | ||
| APARToleranceGroup | APARToleranceGroup | Tolerance Group | ||
| GraceDays | _ToleranceGroup | GraceDays | ||
| ArrearsBaseDate | _ToleranceGroup | ArrearsDaysBaseDateDetn | ||
| FixedCashDiscountendasFixedCashDiscount | ||||
| _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_APCshDiscDocument2.
-- 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: PFIAPCSHDISDOC2
-- Parameters: P_KeyDate : abap.dats
CREATE VIEW P_APCshDiscDocument2 AS
SELECT
P_APCshDiscDocument1.CompanyCode AS CompanyCode,
AccountingDocument,
FiscalYear,
AccountingDocumentItem,
DueCalculationBaseDate,
CashDiscountBaseAmount,
CashDiscount1Percent,
CashDiscount2Percent,
IsSalesRelated,
DebitCreditCode,
CashDiscountAmount,
Supplier,
ClearingDate,
FinancialAccountType,
ClearingAccountingDocument,
PaymentTerms,
PaymentBlockingReason,
ClearingDocFiscalYear,
CashDiscount1Days,
CashDiscount2Days,
PostingDate,
NetPaymentDays,
AmountInTransactionCurrency,
TransactionCurrency,
DocumentDate,
ValueDate,
KeyDate,
DaysDifference,
AccountingDocumentCategory,
SpecialGLCode,
APARToleranceGroup,
_ToleranceGroup.GraceDays AS GraceDays,
_ToleranceGroup.ArrearsDaysBaseDateDetn AS ArrearsBaseDate,
(case P_APCshDiscDocument1.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_APCshDiscDocument1.FixedCashDiscount end) as FixedCashDiscount AS FixedCashDiscountendasFixedCashDiscount
FROM P_APCshDiscDocument1
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