P_APCshDiscUtilizationA1
P_APCshDiscUtilizationA1 is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_ReceivablesPayablesItem) and exposes 17 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem. It has 1 association to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_ReceivablesPayablesItem | I_ReceivablesPayablesItem | from |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_KeyDate | abap.dats | |
| P_StartDate | vdm_v_start_date |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_AccountingDocument | _AccountingDocument | $projection.AccountingDocument = _AccountingDocument.AccountingDocument and $projection.CompanyCode = _AccountingDocument.CompanyCode and $projection.FiscalYear = _AccountingDocument.FiscalYear |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PFIAPCSHDISUTIA1 | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (17)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | CompanyCode | ||
| KEY | AccountingDocument | AccountingDocument | ||
| KEY | FiscalYear | FiscalYear | ||
| KEY | AccountingDocumentItem | AccountingDocumentItem | ||
| FixedCashDiscount | FixedCashDiscount | |||
| DueCalculationBaseDate | DueCalculationBaseDate | |||
| CashDiscountBaseAmount | ||||
| CashDiscount1Percent | CashDiscount1Percent | |||
| CashDiscount2Percent | CashDiscount2Percent | |||
| TakenCshDiscInTransacCrcy | ||||
| Supplier | Creditor | |||
| ClearingDate | ClearingDate | |||
| PaymentTerms | PaymentTerms | |||
| CashDiscount1Days | CashDiscount1Days | |||
| CashDiscount2Days | CashDiscount2Days | |||
| KeyDate | ||||
| TransactionCurrency | TransactionCurrency |
@AbapCatalog.sqlViewName: 'PFIAPCSHDISUTIA1'
@VDM.private: true
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
define view P_APCshDiscUtilizationA1 //Refer to P_APCshDiscUtilization1
with parameters
P_KeyDate : abap.dats,
P_StartDate : vdm_v_start_date
as select from I_ReceivablesPayablesItem //P_APCshDiscDocument2(P_KeyDate : :P_KeyDate)
association [1..1] to I_AccountingDocument as _AccountingDocument on $projection.AccountingDocument = _AccountingDocument.AccountingDocument
and $projection.CompanyCode = _AccountingDocument.CompanyCode
and $projection.FiscalYear = _AccountingDocument.FiscalYear
{
key CompanyCode,
key AccountingDocument,
key FiscalYear,
key AccountingDocumentItem,
FixedCashDiscount, //t043g.sktre is not covered
DueCalculationBaseDate,
// case when DebitCreditCode = 'S' then
// CashDiscountBaseAmount
// else
// - 1 * CashDiscountBaseAmount
// end as CashDiscountBaseAmount,
- 1 * CashDiscountBaseAmount as CashDiscountBaseAmount,
CashDiscount1Percent,
CashDiscount2Percent,
// case when DebitCreditCode = 'S' then
// CashDiscountAmount
// else
// - 1 * CashDiscountAmount
// end as TakenCshDiscInTransacCrcy,
- 1 * CashDiscountAmount as TakenCshDiscInTransacCrcy,
Creditor as Supplier, //Supplier,
ClearingDate,
PaymentTerms,
CashDiscount1Days,
CashDiscount2Days,
:P_KeyDate as KeyDate, //KeyDate,
TransactionCurrency
}
where
FinancialAccountType = 'K'
and AccountingDocumentCategory = ''
and SpecialGLCode = ''
and IsSalesRelated = 'X'
and _AccountingDocument.ReverseDocument = ''
and ClearingAccountingDocument != ''
and AccountingDocument != ClearingAccountingDocument
and ClearingDate >= :P_StartDate
and ClearingDate <= :P_KeyDate;
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ACCOUNTINGDOCUMENT",
"I_RECEIVABLESPAYABLESITEM"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- 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