P_AR_PurchaseVATRateDetail
P_AR_PurchaseVATRateDetail is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (P_AR_JrnlEntryWthOfclDocType, P_AR_PurVATRateAggregatedAmt2) and exposes 27 fields with key fields CompanyCode, FiscalYear, AccountingDocument, StatryRptCategory, StatryRptgEntity.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| P_AR_JrnlEntryWthOfclDocType | P_AR_JrnlEntryWthOfclDocType | inner |
| P_AR_PurVATRateAggregatedAmt2 | PurVATRateAggregatedAmt | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_RptgAmountIsInTransCrcy | fiar_use_transaction_currency |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PARPURCVATRD | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view |
Fields (27)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | JournalEntry | CompanyCode | |
| KEY | FiscalYear | JournalEntry | FiscalYear | |
| KEY | AccountingDocument | JournalEntry | AccountingDocument | |
| KEY | StatryRptCategory | P_AR_PurVATRateAggregatedAmt2 | StatryRptCategory | |
| KEY | StatryRptgEntity | P_AR_PurVATRateAggregatedAmt2 | StatryRptgEntity | |
| KEY | StatryRptRunID | P_AR_PurVATRateAggregatedAmt2 | StatryRptRunID | |
| KEY | TaxRate | P_AR_PurVATRateAggregatedAmt2 | TaxRate | |
| PostingDate | JournalEntry | PostingDate | ||
| DocumentDate | JournalEntry | DocumentDate | ||
| ReportingDate | JournalEntry | ReportingDate | ||
| TaxReportingDate | JournalEntry | TaxReportingDate | ||
| AccountingDocumentType | JournalEntry | AccountingDocumentType | ||
| DocumentReferenceID | JournalEntry | DocumentReferenceID | ||
| AR_PrintCharacter | JournalEntry | AR_PrintCharacter | ||
| AR_Branch | JournalEntry | AR_Branch | ||
| AR_OfficialDocumentNumber | JournalEntry | AR_OfficialDocumentNumber | ||
| AR_OfficialDocumentType | JournalEntry | AR_OfficialDocumentType | ||
| AR_OfficialDocumentClass | JournalEntry | AR_OfficialDocumentClass | ||
| CompanyCodeCountry | P_AR_PurVATRateAggregatedAmt2 | CompanyCodeCountry | ||
| CompanyCodeCurrency | JournalEntry | CompanyCodeCurrency | ||
| TaxAmountInCoCodeCrcy | P_AR_PurVATRateAggregatedAmt2 | TaxAmountInCoCodeCrcy | ||
| TaxBaseAmountInCoCodeCrcy | P_AR_PurVATRateAggregatedAmt2 | TaxBaseAmountInCoCodeCrcy | ||
| TransactionCurrency | JournalEntry | TransactionCurrency | ||
| TaxAmountInTransCrcy | P_AR_PurVATRateAggregatedAmt2 | TaxAmountInTransCrcy | ||
| TaxBaseAmountInTransCrcy | P_AR_PurVATRateAggregatedAmt2 | TaxBaseAmountInTransCrcy | ||
| NmbrOfVATRates | NumberOfVATRates | NmbrOfVATRates | ||
| _OneTimeAccountBP | JournalEntry | _OneTimeAccountBP |
@AbapCatalog.sqlViewName: 'PARPURCVATRD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_AR_PurchaseVATRateDetail
with parameters
P_RptgAmountIsInTransCrcy : fiar_use_transaction_currency
as select from P_AR_PurVATRateAggregatedAmt2 as PurVATRateAggregatedAmt
inner join P_AR_JrnlEntryWthOfclDocType( P_AR_Report : 'RPFIGLAR_TAXREPORTING' ) as JournalEntry on JournalEntry.CompanyCode = PurVATRateAggregatedAmt.CompanyCode
and JournalEntry.FiscalYear = PurVATRateAggregatedAmt.FiscalYear
and JournalEntry.AccountingDocument = PurVATRateAggregatedAmt.AccountingDocument
left outer to one join P_AR_NumberOfVATRates as NumberOfVATRates on NumberOfVATRates.CompanyCode = PurVATRateAggregatedAmt.CompanyCode
and NumberOfVATRates.FiscalYear = PurVATRateAggregatedAmt.FiscalYear
and NumberOfVATRates.AccountingDocument = PurVATRateAggregatedAmt.AccountingDocument
and NumberOfVATRates.TaxType = 'V'
{
key JournalEntry.CompanyCode,
key JournalEntry.FiscalYear,
key JournalEntry.AccountingDocument,
key PurVATRateAggregatedAmt.StatryRptCategory,
key PurVATRateAggregatedAmt.StatryRptgEntity,
key PurVATRateAggregatedAmt.StatryRptRunID,
key PurVATRateAggregatedAmt.TaxRate as TaxRate,
JournalEntry.PostingDate,
JournalEntry.DocumentDate,
JournalEntry.ReportingDate,
JournalEntry.TaxReportingDate,
JournalEntry.AccountingDocumentType,
JournalEntry.DocumentReferenceID,
JournalEntry.AR_PrintCharacter,
JournalEntry.AR_Branch,
JournalEntry.AR_OfficialDocumentNumber,
JournalEntry.AR_OfficialDocumentType,
JournalEntry.AR_OfficialDocumentClass,
PurVATRateAggregatedAmt.CompanyCodeCountry,
@Semantics.currencyCode:true
JournalEntry.CompanyCodeCurrency,
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
PurVATRateAggregatedAmt.TaxAmountInCoCodeCrcy,
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
PurVATRateAggregatedAmt.TaxBaseAmountInCoCodeCrcy,
@Semantics.currencyCode:true
JournalEntry.TransactionCurrency,
@Semantics.amount.currencyCode: 'TransactionCurrency'
PurVATRateAggregatedAmt.TaxAmountInTransCrcy,
@Semantics.amount.currencyCode: 'TransactionCurrency'
PurVATRateAggregatedAmt.TaxBaseAmountInTransCrcy,
@Semantics.currencyCode:true
cast(
case $parameters.P_RptgAmountIsInTransCrcy
when 'X'
then JournalEntry.TransactionCurrency
else JournalEntry.CompanyCodeCurrency
end as glo_reporting_currency preserving type
) as ReportingCurrency,
@Semantics.amount.currencyCode: 'ReportingCurrency'
cast(
case $parameters.P_RptgAmountIsInTransCrcy
when 'X'
then PurVATRateAggregatedAmt.TaxAmountInTransCrcy
else PurVATRateAggregatedAmt.TaxAmountInCoCodeCrcy
end as glo_tax_amount_rptg_crcy preserving type
) as TaxAmountInRptgCrcy,
@Semantics.amount.currencyCode: 'ReportingCurrency'
cast(
case $parameters.P_RptgAmountIsInTransCrcy
when 'X'
then PurVATRateAggregatedAmt.TaxBaseAmountInTransCrcy
else PurVATRateAggregatedAmt.TaxBaseAmountInCoCodeCrcy
end as glo_taxbase_amount_rptg_crcy preserving type
) as TaxBaseAmountInRptgCrcy,
NumberOfVATRates.NmbrOfVATRates,
JournalEntry._OneTimeAccountBP
}
// considers the lines with taxes or lines with zero vat but without additional tax lines (<>zero)
where
( PurVATRateAggregatedAmt.TaxRate <> '0.00'
or ( PurVATRateAggregatedAmt.TaxRate = '0.00'
and ( NumberOfVATRates.NmbrOfVATRates = 0 or NumberOfVATRates.NmbrOfVATRates is null ) ) )
and
( ( JournalEntry.AR_PrintCharacter <> 'B' and JournalEntry.AR_PrintCharacter <> 'C' )
or
JournalEntry.AR_OfficialDocumentType = '033' )
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