C_PT_SAFTPaymentDocValueC
Total Amount of Payment Document - Cube
C_PT_SAFTPaymentDocValueC is a Consumption CDS View (Cube) that provides data about "Total Amount of Payment Document - Cube" in SAP S/4HANA. It reads from 5 data sources (I_AccountingDocumentType, I_ClrgInfoRelationForAcctgDoc, I_OperationalAcctgDocItem, I_PT_DgtlSgntrNmbrRngeAcctg, I_PT_SAFTPaymentTotal) and exposes 23 fields with key fields CompanyCode, ClearingAccountingDocument, FiscalYear. It has 2 associations to related views.
Data Sources (5)
| Source | Alias | Join Type |
|---|---|---|
| I_AccountingDocumentType | AcctDoc | inner |
| I_ClrgInfoRelationForAcctgDoc | Clear | inner |
| I_OperationalAcctgDocItem | Doc | from |
| I_PT_DgtlSgntrNmbrRngeAcctg | NrRange | inner |
| I_PT_SAFTPaymentTotal | PayTotal | inner |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_SAFTAccountingTaxCheck | _TotalItems | _TotalItems.AccountingDocument = Doc.AccountingDocument and _TotalItems.CompanyCode = Doc.CompanyCode and _TotalItems.FiscalYear = Doc.FiscalYear |
| [0..1] | P_PT_SAFTTAXLAND | _MultVat | _MultVat.Customer = Doc.Customer |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #MANDATORY | view | |
| VDM.viewType | #CONSUMPTION | view | |
| Analytics.internalName | #LOCAL | view | |
| Metadata.allowExtensions | true | view | |
| Analytics.dataCategory | #CUBE | view | |
| EndUserText.label | Total Amount of Payment Document - Cube | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #S | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (23)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | I_OperationalAcctgDocItem | CompanyCode | |
| KEY | ClearingAccountingDocument | I_OperationalAcctgDocItem | AccountingDocument | |
| KEY | FiscalYear | I_OperationalAcctgDocItem | FiscalYear | |
| FiscalPeriod | I_OperationalAcctgDocItem | FiscalPeriod | ||
| DocumentDate | I_OperationalAcctgDocItem | DocumentDate | ||
| PostingDate | I_OperationalAcctgDocItem | PostingDate | ||
| CompanyCodeCurrency | I_OperationalAcctgDocItem | CompanyCodeCurrency | ||
| AccountingDocumentCategory | I_OperationalAcctgDocItem | AccountingDocumentCategory | ||
| AccountingDocumentType | I_OperationalAcctgDocItem | AccountingDocumentType | ||
| char15asPortugueseCustomerWithVersion | ||||
| Supplier | I_OperationalAcctgDocItem | Supplier | ||
| NetAmount | Net Total | |||
| GrossAmount | Gross Total | |||
| SettlementAmount | Settlement Amount | |||
| ExchangeRateendasExchangeRate | ||||
| ReferenceDocumentType | I_OperationalAcctgDocItem | ReferenceDocumentType | ||
| OriginalReferenceDocument | I_OperationalAcctgDocItem | OriginalReferenceDocument | ||
| _CompanyCodeCurrency | I_OperationalAcctgDocItem | _CompanyCodeCurrency | ||
| _TotalItems | _TotalItems | |||
| _AccountingDocumentCategory | I_OperationalAcctgDocItem | _AccountingDocumentCategory | ||
| _CompanyCode | I_OperationalAcctgDocItem | _CompanyCode | ||
| _AccountingDocumentType | I_OperationalAcctgDocItem | _AccountingDocumentType | ||
| _FiscalYear | I_OperationalAcctgDocItem | _FiscalYear |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@VDM.viewType: #CONSUMPTION
@Analytics.internalName:#LOCAL
@Metadata.allowExtensions:true
@Analytics: { dataCategory: #CUBE }
@EndUserText.label: 'Total Amount of Payment Document - Cube'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity C_PT_SAFTPaymentDocValueC
as select from I_OperationalAcctgDocItem as Doc
inner join I_PT_SAFTPaymentTotal as PayTotal on PayTotal.CompanyCode = Doc.CompanyCode
and PayTotal.ClearingAccountingDocument = Doc.AccountingDocument
and PayTotal.FiscalYear = Doc.FiscalYear
and PayTotal.PostingDate = Doc.PostingDate
inner join I_ClrgInfoRelationForAcctgDoc as Clear on Clear.ClearingInfoCompanyCode = Doc.CompanyCode
and Clear.ClearingAccountingDocument = Doc.AccountingDocument
and Clear.ClearingFiscalYear = Doc.FiscalYear
and Clear.ClearingInformationIndex = '000001'
and Clear.AccountType = 'D' //only customers accounts
and Clear.SpecialGLCode <> 'F'
inner join I_AccountingDocumentType as AcctDoc on AcctDoc.AccountingDocumentType = Doc.AccountingDocumentType
inner join I_PT_DgtlSgntrNmbrRngeAcctg as NrRange on NrRange.CompanyCode = Doc.CompanyCode
and NrRange.ToFiscalYear >= Doc.FiscalYear
and NrRange.NumberRangeInterval = AcctDoc.AccountingDocumentNumberRange
and NrRange.PT_DigitalSignatureFromDate <= Doc.PostingDate
association [0..1] to I_SAFTAccountingTaxCheck as _TotalItems on _TotalItems.AccountingDocument = Doc.AccountingDocument
and _TotalItems.CompanyCode = Doc.CompanyCode
and _TotalItems.FiscalYear = Doc.FiscalYear
association [0..1] to P_PT_SAFTTAXLAND as _MultVat on _MultVat.Customer = Doc.Customer
{
@ObjectModel.foreignKey.association: '_CompanyCode'
key Doc.CompanyCode,
key Doc.AccountingDocument as ClearingAccountingDocument,
@ObjectModel.foreignKey.association: '_FiscalYear'
key Doc.FiscalYear,
Doc.FiscalPeriod as FiscalPeriod, //Period
Doc.DocumentDate as DocumentDate,
Doc.PostingDate as PostingDate,
Doc.CompanyCodeCurrency,
Doc.AccountingDocumentCategory,
Doc.AccountingDocumentType,
cast(case
when Doc._JournalEntryItemOneTimeData.IsOneTimeAccount is not initial
then
Doc.Customer
when _MultVat.CustomerCountry is not initial
then
concat(_MultVat.Customer, concat('/', _MultVat.CustomerCountry))
else
Doc._Customer.Customer
end as abap.char(15)) as PortugueseCustomerWithVersion,
Doc.Supplier,
@DefaultAggregation:#SUM
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
@EndUserText.label: 'Net Total'
abs(PayTotal.TotalCreditAmount - PayTotal.TotalDebitAmount + PayTotal.SettlementAmount) as NetAmount,
// DocumentTotals\GrossTotal
@DefaultAggregation:#SUM
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
@EndUserText.label: 'Gross Total'
abs(PayTotal.TotalCreditAmount - PayTotal.TotalDebitAmount + PayTotal.SettlementAmount) as GrossAmount,
@DefaultAggregation:#SUM
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
@EndUserText.label: 'Settlement Amount'
abs(PayTotal.SettlementAmount) as SettlementAmount,
case when PayTotal.TransactionCurrency <> Doc.CompanyCodeCurrency then
PayTotal.TransactionCurrency end as TransactionCurrency,
case when PayTotal.TransactionCurrency <> Doc.CompanyCodeCurrency then
PayTotal.ExchangeRate end as ExchangeRate,
@DefaultAggregation:#SUM
@Semantics.amount.currencyCode: 'TransactionCurrency'
@EndUserText.label: 'Amount In Transaction Currency'
case when PayTotal.TransactionCurrency <> Doc.CompanyCodeCurrency then
abs(PayTotal.TotalCreditAmountInTransCrcy - PayTotal.TotalDebitAmountInTransCrcy) end as TotalGrossAmountInTransCrcy,
Doc.ReferenceDocumentType,
Doc.OriginalReferenceDocument,
Doc._CompanyCodeCurrency,
_TotalItems,
Doc._AccountingDocumentCategory,
Doc._CompanyCode,
Doc._AccountingDocumentType,
Doc._FiscalYear
}
where
Doc.FinancialAccountType = 'D'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ACCOUNTINGDOCUMENTTYPE",
"I_CLRGINFORELATIONFORACCTGDOC",
"I_CUSTOMER",
"I_JOURNALENTRYITEMONETIMEDATA",
"I_OPERATIONALACCTGDOCITEM",
"I_PT_DGTLSGNTRNMBRRNGEACCTG",
"I_PT_SAFTPAYMENTTOTAL",
"P_PT_SAFTTAXLAND"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENTCATEGORY",
"I_ACCOUNTINGDOCUMENTTYPE",
"I_COMPANYCODE",
"I_CURRENCY",
"I_FISCALYEARFORCOMPANYCODE",
"I_SAFTACCOUNTINGTAXCHECK"
],
"BASE":
[
"I_OPERATIONALACCTGDOCITEM"
],
"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