P_KZ_StRpWhldgTaxRepCorrItem
P_KZ_StRpWhldgTaxRepCorrItem is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_StRpWhldgTaxItem) and exposes 34 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem, WithholdingTaxType. It has 6 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_StRpWhldgTaxItem | wht | from |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_StatryRptgEntity | srf_reporting_entity | |
| P_StatryRptCategory | srf_rep_cat_id |
Associations (6)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | P_StRpWhldgTaxItem | invdoc | invdoc.CompanyCode = wht.CompanyCode and invdoc.AccountingDocument = wht.InvoiceReference and invdoc.FiscalYear = wht.InvoiceReferenceFiscalYear and invdoc.AccountingDocumentItem = wht.InvoiceItemReference and invdoc.WithholdingTaxType = wht.WithholdingTaxType |
| [0..1] | P_StRpWhldgTaxItem | paydoc | paydoc.CompanyCode = wht.CompanyCode and paydoc.AccountingDocument = wht.ClearingJournalEntry and paydoc.FiscalYear = wht.ClearingJournalEntryFiscalYear and paydoc.ClearingItem = wht.ClearingItem and paydoc.WithholdingTaxType = wht.WithholdingTaxType |
| [0..1] | I_WithholdingTaxReportingDate | _WHTRptDateActive | _WHTRptDateActive.CompanyCode = wht.CompanyCode |
| [0..1] | I_Extendedwhldgtaxcode | _WithholdingTaxCode | wht.Country = _WithholdingTaxCode.Country and wht.WithholdingTaxType = _WithholdingTaxCode.WithholdingTaxType and wht.WithholdingTaxCode = _WithholdingTaxCode.WithholdingTaxCode |
| [0..1] | P_Withholdingtxtype | _TaxType | _TaxType.land1 = wht.Country and _TaxType.witht = wht.WithholdingTaxType |
| [0..1] | I_SupplierWithHoldingTax | wtax | wht.BusinessPartner = wtax.Supplier and wht.CompanyCode = wtax.CompanyCode and wht.WithholdingTaxType = wtax.WithholdingTaxType |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view | |
| AccessControl.authorizationCheck | #NOT_ALLOWED | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.serviceQuality | #P | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_INCLUDED | view |
Fields (34)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | P_StRpWhldgTaxItem | CompanyCode | Receiver Company Code |
| KEY | AccountingDocument | P_StRpWhldgTaxItem | AccountingDocument | Journal Entry |
| KEY | FiscalYear | P_StRpWhldgTaxItem | FiscalYear | G/L Fiscal Year |
| KEY | AccountingDocumentItem | P_StRpWhldgTaxItem | AccountingDocumentItem | Posting View Item |
| KEY | WithholdingTaxType | P_StRpWhldgTaxItem | WithholdingTaxType | WTax Type |
| WithholdingTaxIncomeType | P_StRpWhldgTaxItem | WithholdingTaxIncomeType | ||
| Runstatus | _StRpRptdJournalEntry | StatryRptRunStatus | ||
| BusinessPartnerNumber | P_StRpWhldgTaxItem | BusinessPartnerNumber | ||
| Country | P_StRpWhldgTaxItem | Country | Venue: Ctry/Reg | |
| BusinessPartner | P_StRpWhldgTaxItem | BusinessPartner | Issuing Authority | |
| ReportingCurrency | P_StRpWhldgTaxItem | ReportingCurrency | Currency | |
| TransactionCurrency | P_StRpWhldgTaxItem | TransactionCurrency | Transaction Currency | |
| WithholdingTaxPercent | P_StRpWhldgTaxItem | WithholdingTaxPercent | ||
| BusinessPartnerCountry | P_StRpWhldgTaxItem | BusinessPartnerCountry | BP Ctry/Reg. | |
| Name | P_StRpWhldgTaxItem | Name | Zone name | |
| PostingDate | P_StRpWhldgTaxItem | PostingDate | Posting Date for GR | |
| ClearingDate | P_StRpWhldgTaxItem | ClearingDate | Clearing Date | |
| PostingDateendasReportingDate | ||||
| MwtiIsActive | _WHTRptDateActive | WhldgTaxRptgDateIsActive | ||
| FiscalPeriodendasFiscalPeriod | ||||
| WithholdingTaxReportingDate | P_StRpWhldgTaxItem | WithholdingTaxReportingDate | Withholding Tax Reporting Date | |
| ClearingJournalEntry | P_StRpWhldgTaxItem | ClearingJournalEntry | Clrng doc. | |
| ClearingItem | P_StRpWhldgTaxItem | ClearingItem | Clearing Item | |
| WhldgTaxExmptCertificate | P_StRpWhldgTaxItem | WhldgTaxExmptCertificate | Exemption Number | |
| WithholdingTaxExmptPercent | P_StRpWhldgTaxItem | WithholdingTaxExmptPercent | Exemption Rate | |
| AssignmentReference | ||||
| IsReversal | P_StRpWhldgTaxItem | IsReversal | Reversal doc. | |
| IsReversed | P_StRpWhldgTaxItem | IsReversed | Reversed? | |
| ItemIsReportingRelevant | P_StRpWhldgTaxItem | ItemIsReportingRelevant | Item Reporting Relv | |
| FinancialAccountType | P_StRpWhldgTaxItem | FinancialAccountType | Fin. Account Type | |
| InvoiceReference | P_StRpWhldgTaxItem | InvoiceReference | Invoice Reference | |
| BusinessPartnerType | bp | type | Worklist Type | |
| Extendedwtaxrate | _WithholdingTaxCode | WithholdingTaxPercent | ||
| Wtax_exempercent | wtax | WithholdingTaxExmptPercent | Exemption Rate |
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_KZ_StRpWhldgTaxRepCorrItem.
-- 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.
-- Parameters: P_StatryRptgEntity : srf_reporting_entity, P_StatryRptCategory : srf_rep_cat_id
CREATE VIEW P_KZ_StRpWhldgTaxRepCorrItem AS
SELECT
wht.CompanyCode AS CompanyCode,
wht.AccountingDocument AS AccountingDocument,
wht.FiscalYear AS FiscalYear,
wht.AccountingDocumentItem AS AccountingDocumentItem,
wht.WithholdingTaxType AS WithholdingTaxType,
wht.WithholdingTaxIncomeType AS WithholdingTaxIncomeType,
_StRpRptdJournalEntry.StatryRptRunStatus AS Runstatus,
wht.BusinessPartnerNumber AS BusinessPartnerNumber,
wht.Country AS Country,
wht.BusinessPartner AS BusinessPartner,
wht.ReportingCurrency AS ReportingCurrency,
wht.TransactionCurrency AS TransactionCurrency,
wht.WithholdingTaxPercent AS WithholdingTaxPercent,
wht.BusinessPartnerCountry AS BusinessPartnerCountry,
wht.Name AS Name,
wht.PostingDate AS PostingDate,
wht.ClearingDate AS ClearingDate,
case when ( wht.WhldgTaxDocumentType = '002' or wht.WhldgTaxDocumentType = '007' ) and _WHTRptDateActive.WhldgTaxRptgDateIsActive = '' then wht.ClearingDate when ( wht.WhldgTaxDocumentType = '002' or wht.WhldgTaxDocumentType = '007' ) and _WHTRptDateActive.WhldgTaxRptgDateIsActive = 'X' then wht.WithholdingTaxReportingDate when ( wht.WhldgTaxDocumentType = '004' or wht.WhldgTaxDocumentType = '005' or wht.WhldgTaxDocumentType = '006' or wht.WhldgTaxDocumentType = '008' ) and _WHTRptDateActive.WhldgTaxRptgDateIsActive = '' then wht.PostingDate when ( wht.WhldgTaxDocumentType = '004' or wht.WhldgTaxDocumentType = '005' or wht.WhldgTaxDocumentType = '006' or wht.WhldgTaxDocumentType = '008' ) and _WHTRptDateActive.WhldgTaxRptgDateIsActive = 'X' then wht.WithholdingTaxReportingDate else wht.PostingDate end as ReportingDate AS PostingDateendasReportingDate,
_WHTRptDateActive.WhldgTaxRptgDateIsActive AS MwtiIsActive,
case when _WHTRptDateActive.WhldgTaxRptgDateIsActive = 'X' and wht.WithholdingTaxReportingDate is not initial then cast( substring(wht.WithholdingTaxReportingDate, 5, 2) as fins_fiscalperiod ) else wht.FiscalPeriod end as FiscalPeriod AS FiscalPeriodendasFiscalPeriod,
wht.WithholdingTaxReportingDate AS WithholdingTaxReportingDate,
wht.ClearingJournalEntry AS ClearingJournalEntry,
wht.ClearingItem AS ClearingItem,
wht.WhldgTaxExmptCertificate AS WhldgTaxExmptCertificate,
wht.WithholdingTaxExmptPercent AS WithholdingTaxExmptPercent,
wht._OperationalAcctgDocItem.AssignmentReference AS AssignmentReference,
wht.IsReversal AS IsReversal,
wht.IsReversed AS IsReversed,
wht.ItemIsReportingRelevant AS ItemIsReportingRelevant,
wht.FinancialAccountType AS FinancialAccountType,
wht.InvoiceReference AS InvoiceReference,
bp.type AS BusinessPartnerType,
_WithholdingTaxCode.WithholdingTaxPercent AS Extendedwtaxrate,
wtax.WithholdingTaxExmptPercent AS Wtax_exempercent
FROM P_StRpWhldgTaxItem AS wht
LEFT OUTER JOIN P_StRpWhldgTaxItem AS invdoc ON invdoc.CompanyCode = wht.CompanyCode AND invdoc.AccountingDocument = wht.InvoiceReference AND invdoc.FiscalYear = wht.InvoiceReferenceFiscalYear AND invdoc.AccountingDocumentItem = wht.InvoiceItemReference AND invdoc.WithholdingTaxType = wht.WithholdingTaxType -- association [0..1]
LEFT OUTER JOIN P_StRpWhldgTaxItem AS paydoc ON paydoc.CompanyCode = wht.CompanyCode AND paydoc.AccountingDocument = wht.ClearingJournalEntry AND paydoc.FiscalYear = wht.ClearingJournalEntryFiscalYear AND paydoc.ClearingItem = wht.ClearingItem AND paydoc.WithholdingTaxType = wht.WithholdingTaxType -- association [0..1]
LEFT OUTER JOIN I_WithholdingTaxReportingDate AS _WHTRptDateActive ON _WHTRptDateActive.CompanyCode = wht.CompanyCode -- association [0..1]
LEFT OUTER JOIN I_Extendedwhldgtaxcode AS _WithholdingTaxCode ON wht.Country = _WithholdingTaxCode.Country AND wht.WithholdingTaxType = _WithholdingTaxCode.WithholdingTaxType AND wht.WithholdingTaxCode = _WithholdingTaxCode.WithholdingTaxCode -- association [0..1]
LEFT OUTER JOIN P_Withholdingtxtype AS _TaxType ON _TaxType.land1 = wht.Country AND _TaxType.witht = wht.WithholdingTaxType -- association [0..1]
LEFT OUTER JOIN I_SupplierWithHoldingTax AS wtax ON wht.BusinessPartner = wtax.Supplier AND wht.CompanyCode = wtax.CompanyCode AND wht.WithholdingTaxType = wtax.WithholdingTaxType -- 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