P_StRpTaxReturn
P_StRpTaxReturn is a Composite CDS View in SAP S/4HANA. It reads from 6 data sources and exposes 85 fields with key fields CompanyCode, AccountingDocument, FiscalYear, TaxItem, TaxCode. It has 1 association to related views.
Data Sources (6)
| Source | Alias | Join Type |
|---|---|---|
| P_RndRulesForCoCodeAndCrcy | _CCCurrency | left_outer |
| P_RndRulesForCoCodeAndCrcy | _DocCurrency | left_outer |
| I_StRpTaxItem | I_StRpTaxItem | from |
| P_CndnTypeTaxClassification | P_CndnTypeTaxClassification | left_outer |
| P_RefundRelatedTaxCode | P_RefundRelatedTaxCode | left_outer |
| P_T007B_GLO | P_T007B_GLO | inner |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..*] | P_BaseAmtForNegativeCharge | _NegCharge | $projection.CompanyCode = _NegCharge.CompanyCode and $projection.AccountingDocument = _NegCharge.AccountingDocument and $projection.FiscalYear = _NegCharge.FiscalYear and $projection.ReportingDate = _NegCharge.ReportingDate |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PSRTAXRETURN | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| VDM.viewType | #COMPOSITE | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.serviceQuality | #P | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_INCLUDED | view | |
| VDM.private | true | view | |
| AccessControl.blocking | #BLOCKED_DATA_INCLUDED | view |
Fields (85)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | I_StRpTaxItem | CompanyCode | Receiver Company Code |
| KEY | AccountingDocument | I_StRpTaxItem | AccountingDocument | Journal Entry |
| KEY | FiscalYear | I_StRpTaxItem | FiscalYear | G/L Fiscal Year |
| KEY | TaxItem | TaxItem | Tax Item | |
| KEY | TaxCode | I_StRpTaxItem | TaxCode | Tax Code |
| KEY | TransactionTypeDetermination | TransactionTypeDetermination | Transaction Key | |
| DebitCreditCode | DebitCreditCode | Single-Character Flag | ||
| TaxCalculationProcedure | I_StRpTaxItem | TaxCalculationProcedure | Tax Procedure | |
| TaxRate | TaxRate | Tax Rate | ||
| GLAccount | GLAccount | General Ledger | ||
| TaxItemGroup | TaxItemGroup | Tax doc. item number | ||
| BusinessPlace | BusinessPlace | Business place | ||
| TaxJurisdiction | TaxJurisdiction | Tax Jurisdiction | ||
| LowestLevelTaxJurisdiction | LowestLevelTaxJurisdiction | Jurisdict. Code | ||
| AccountingDocumentType | AccountingDocumentType | Journal Entry Type | ||
| ReferenceDocumentType | ReferenceDocumentType | Reference Document Type | ||
| ReverseDocument | ReverseDocument | Reversed With | ||
| ReverseDocumentFiscalYear | ReverseDocumentFiscalYear | Year | ||
| ConditionRecord | P_CndnTypeTaxClassification | ConditionRecord | Cond.Record No. | |
| CalculatedTxAmtInCoCodeCrcy | TaxAmountInCoCodeCrcy | Tax Amount in Company Code Currency | ||
| CalculatedTaxAmountInTransCrcy | TaxAmount | Tax Amt in Rptg Crcy | ||
| TaxReturnCountryendasCountry | ||||
| EUTaxClassification | I_StRpTaxItem | EUTaxClassification | ||
| DocumentReferenceID | DocumentReferenceID | Reference | ||
| Ledger | Ledger | Ledger | ||
| LedgerGroup | LedgerGroup | Ledger Group | ||
| PostingDate | PostingDate | Posting Date for GR | ||
| DocumentDate | DocumentDate | Journal Entry Date | ||
| TaxReportingDate | TaxReportingDate | Tax Reporting Date | ||
| ReportingDate | I_StRpTaxItem | ReportingDate | ||
| FiscalPeriod | FiscalPeriod | Tax period | ||
| ExchangeRate | ExchangeRate | Exchange rate | ||
| IsReversal | IsReversal | Reversal doc. | ||
| IsReversed | IsReversed | Reversed? | ||
| AccountingDocumentHeaderText | AccountingDocumentHeaderText | Doc.Header Text | ||
| CompanyCodeCountry | CompanyCodeCountry | Reporting Ctry/Reg. | ||
| ReportingCountry | ReportingCountry | |||
| TaxReturnCountry | I_StRpTaxItem | TaxReturnCountry | Reporting C/R | |
| TaxCountry | I_StRpTaxItem | TaxCountry | Tax Ctry/Reg. | |
| CompanyCodeCurrency | CompanyCodeCurrency | Local Currency | ||
| CountryCurrency | CountryCurrency | Currency | ||
| DocumentCurrency | DocumentCurrency | Document Currency | ||
| ReportingCurrency | ReportingCurrency | Currency | ||
| AdditionalCurrency1 | AdditionalCurrency1 | Local curr. 2 | ||
| AdditionalCurrency2 | AdditionalCurrency2 | Local curr. 3 | ||
| TaxBaseAmountInRptgCrcy | TaxBaseAmountInRptgCrcy | Base Amount | ||
| TaxAmountInRptgCrcy | TaxAmountInRptgCrcy | Tax Rept. Crcy | ||
| TaxAmountInCoCodeCrcy | TaxAmountInCoCodeCrcy | Tax Amount in Company Code Currency | ||
| TaxBaseAmountInCoCodeCrcy | TaxBaseAmountInCoCodeCrcy | TxBaseAmt CoCodeCrcy | ||
| TaxAmount | TaxAmount | Tax Amt in Rptg Crcy | ||
| TaxBaseAmountInCountryCrcy | TaxBaseAmountInCountryCrcy | Base Amount | ||
| TaxAmountInCountryCrcy | TaxAmountInCountryCrcy | Tax Rept. Crcy | ||
| TaxBaseAmountInTransCrcy | TaxBaseAmountInTransCrcy | Value-Added Tax | ||
| TaxBaseAmtInAdditionalCrcy1 | TaxBaseAmtInAdditionalCrcy1 | LC 2 Base | ||
| TaxBaseAmtInAdditionalCrcy2 | TaxBaseAmtInAdditionalCrcy2 | LC 3 Base | ||
| TaxAmountInAdditionalCurrency1 | TaxAmountInAdditionalCurrency1 | LC 2 Tax | ||
| TaxAmountInAdditionalCurrency2 | TaxAmountInAdditionalCurrency2 | LC 3 Tax | ||
| OriginalReferenceDocument | _AccountingDocument | OriginalReferenceDocument | Reference Key | |
| FinancialAccountType | _DebtorCreditorRblsPyblsItem | FinancialAccountType | Fin. Account Type | |
| Customer | ||||
| TaxType | I_StRpTaxItem | TaxType | Tax Type | |
| TargetTaxCode | I_StRpTaxItem | TargetTaxCode | ||
| TaxNumber1 | TaxNumber1 | VAT Reg. No. | ||
| TaxNumber2 | TaxNumber2 | Tax Number 2 | ||
| TaxNumber3 | TaxNumber3 | |||
| BusinessPartner | BusinessPartner | Issuing Authority | ||
| BusinessPartnerName | BusinessPartnerName | Extracted Customer Name | ||
| CustomerSupplierAddress | CustomerSupplierAddress | |||
| SupplierAccountGroup | SupplierAccountGroup | Account group | ||
| ConditionType | I_StRpTaxItem | ConditionType | Condition type | |
| TaxIsNotDeductible | TaxIsNotDeductible | Non-Deductible | ||
| _ReportingCurrency | _ReportingCurrency | |||
| _AccountingDocument | _AccountingDocument | |||
| _GLAccount | _GLAccount | |||
| _TaxJurisdiction | _TaxJurisdiction | |||
| _DebtorCreditorRblsPyblsItem | _DebtorCreditorRblsPyblsItem | |||
| _ReceivablesPayablesItem | _ReceivablesPayablesItem | |||
| _TaxReceivablesPayablesItem | _TaxReceivablesPayablesItem | |||
| _TaxTypeText | _TaxTypeText | |||
| _TaxCodeText | _TaxCodeText | |||
| _ReportedItemsLog | _ReportedItemsLog | |||
| _NegCharge | _NegCharge | |||
| StatryRptgEntity | _ReportedItemsLog | StatryRptgEntity | Reporting Entity | |
| StatryRptCategory | _ReportedItemsLog | StatryRptCategory | Report ID | |
| StatryRptRunID | _ReportedItemsLog | StatryRptRunID | Report Run ID |
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_StRpTaxReturn.
-- 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: PSRTAXRETURN
CREATE VIEW P_StRpTaxReturn AS
SELECT
I_StRpTaxItem.CompanyCode AS CompanyCode,
I_StRpTaxItem.AccountingDocument AS AccountingDocument,
I_StRpTaxItem.FiscalYear AS FiscalYear,
TaxItem,
I_StRpTaxItem.TaxCode AS TaxCode,
TransactionTypeDetermination,
DebitCreditCode,
I_StRpTaxItem.TaxCalculationProcedure AS TaxCalculationProcedure,
TaxRate,
GLAccount,
TaxItemGroup,
BusinessPlace,
TaxJurisdiction,
LowestLevelTaxJurisdiction,
AccountingDocumentType,
ReferenceDocumentType,
ReverseDocument,
ReverseDocumentFiscalYear,
P_CndnTypeTaxClassification.ConditionRecord AS ConditionRecord,
TaxAmountInCoCodeCrcy AS CalculatedTxAmtInCoCodeCrcy,
TaxAmount AS CalculatedTaxAmountInTransCrcy,
case when I_StRpTaxItem.TaxReturnCountry is null or I_StRpTaxItem.TaxReturnCountry = ' ' then CompanyCodeCountry else I_StRpTaxItem.TaxReturnCountry end as Country AS TaxReturnCountryendasCountry,
I_StRpTaxItem.EUTaxClassification AS EUTaxClassification,
DocumentReferenceID,
Ledger,
LedgerGroup,
PostingDate,
DocumentDate,
TaxReportingDate,
I_StRpTaxItem.ReportingDate AS ReportingDate,
FiscalPeriod,
ExchangeRate,
IsReversal,
IsReversed,
AccountingDocumentHeaderText,
CompanyCodeCountry,
ReportingCountry,
I_StRpTaxItem.TaxReturnCountry AS TaxReturnCountry,
I_StRpTaxItem.TaxCountry AS TaxCountry,
CompanyCodeCurrency,
CountryCurrency,
DocumentCurrency,
ReportingCurrency,
AdditionalCurrency1,
AdditionalCurrency2,
TaxBaseAmountInRptgCrcy,
TaxAmountInRptgCrcy,
TaxAmountInCoCodeCrcy,
TaxBaseAmountInCoCodeCrcy,
TaxAmount,
TaxBaseAmountInCountryCrcy,
TaxAmountInCountryCrcy,
TaxBaseAmountInTransCrcy,
TaxBaseAmtInAdditionalCrcy1,
TaxBaseAmtInAdditionalCrcy2,
TaxAmountInAdditionalCurrency1,
TaxAmountInAdditionalCurrency2,
_AccountingDocument.OriginalReferenceDocument AS OriginalReferenceDocument,
_DebtorCreditorRblsPyblsItem.FinancialAccountType AS FinancialAccountType,
_DebtorCreditorRblsPyblsItem._Customer.Customer AS Customer,
I_StRpTaxItem.TaxType AS TaxType,
I_StRpTaxItem.TargetTaxCode AS TargetTaxCode,
TaxNumber1,
TaxNumber2,
TaxNumber3,
BusinessPartner,
BusinessPartnerName,
CustomerSupplierAddress,
SupplierAccountGroup,
I_StRpTaxItem.ConditionType AS ConditionType,
TaxIsNotDeductible,
_ReportedItemsLog.StatryRptgEntity AS StatryRptgEntity,
_ReportedItemsLog.StatryRptCategory AS StatryRptCategory,
_ReportedItemsLog.StatryRptRunID AS StatryRptRunID
FROM I_StRpTaxItem
INNER JOIN P_T007B_GLO ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_RndRulesForCoCodeAndCrcy AS _CCCurrency ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_RndRulesForCoCodeAndCrcy AS _DocCurrency ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_RefundRelatedTaxCode ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_CndnTypeTaxClassification ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_BaseAmtForNegativeCharge AS _NegCharge ON CompanyCode = _NegCharge.CompanyCode AND AccountingDocument = _NegCharge.AccountingDocument AND FiscalYear = _NegCharge.FiscalYear AND ReportingDate = _NegCharge.ReportingDate -- association [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