P_US_StRpWhldgTaxItemDoc
P_US_StRpWhldgTaxItemDoc is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_StRpWhldgTaxItem) and exposes 36 fields with key fields CompanyCode, AccountingDocument, FiscalYear, WithholdingTaxType, AccountingDocumentItem. It has 4 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_StRpWhldgTaxItem | wht | from |
Associations (4)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_Supplier | _AltSupplier | _AltSupplier.Supplier = $projection.AlternativePayee |
| [1..1] | I_Customer | _AltCustomer | _AltCustomer.Customer = $projection.AlternativePayer |
| [0..1] | I_Businesspartnertaxnumber | _BPTxNmbr1 | wht.BusinessPartnerNumber = _BPTxNmbr1.BusinessPartner and _BPTxNmbr1.BPTaxType = 'US1' |
| [0..1] | I_Businesspartnertaxnumber | _BPTxNmbr2 | wht.BusinessPartnerNumber = _BPTxNmbr2.BusinessPartner and _BPTxNmbr2.BPTaxType = 'US2' |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PUSWHTITEM | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ObjectModel.usageType.serviceQuality | #P | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_INCLUDED | view |
Fields (36)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | CompanyCode | Receiver Company Code | |
| KEY | AccountingDocument | AccountingDocument | Journal Entry | |
| KEY | FiscalYear | FiscalYear | G/L Fiscal Year | |
| KEY | WithholdingTaxType | WithholdingTaxType | WTax Type | |
| KEY | AccountingDocumentItem | AccountingDocumentItem | Posting View Item | |
| RegionendasBPRgn | ||||
| BusinessPartner | BusinessPartner | Issuing Authority | ||
| WithholdingTaxCode | WithholdingTaxCode | WTax Code | ||
| OfficialWhldgTaxCode | OfficialWhldgTaxCode | |||
| WhldgTaxReferenceText | _WithholdingTaxCode | WhldgTaxReferenceText | ||
| PostingDate | PostingDate | Posting Date for GR | ||
| DocumentDate | DocumentDate | Journal Entry Date | ||
| ClearingDate | ClearingDate | Clearing Date | ||
| BusinessPartnerNumber | BusinessPartnerNumber | |||
| TaxNumber1asstcd1asTaxNumber1 | ||||
| TaxNumber2asstcd2asTaxNumber2 | ||||
| AlternativePayee | ||||
| AlternativePayer | ||||
| AddressIDendasAddressID | ||||
| DebtorendasPartner | ||||
| BusinessPlace | BusinessPlace | Business place | ||
| FinancialAccountType | FinancialAccountType | Fin. Account Type | ||
| AccountingDocumentType | AccountingDocumentType | Journal Entry Type | ||
| WhldgTaxDocumentType | WhldgTaxDocumentType | 3-Byte field | ||
| SpecialGLTransactionType | P_StRpWhldgTaxItem | SpecialGLTransactionType | Transact.Type | |
| SpecialGLCode | P_StRpWhldgTaxItem | SpecialGLCode | Special G/L Ind | |
| ClearingJournalEntry | ClearingJournalEntry | Clrng doc. | ||
| IsReversed | IsReversed | Reversed? | ||
| IsReversal | IsReversal | Reversal doc. | ||
| Creditor | Creditor | Supplier | ||
| ReportingCurrency | ReportingCurrency | Currency | ||
| Debtor | Debtor | Debtor | ||
| WhldgTaxExmptAmtInCoCodeCrcy | WhldgTaxExmptAmtInCoCodeCrcy | |||
| CashDiscountAmtInCoCodeCrcy | CashDiscountAmtInCoCodeCrcy | Discount Amt | ||
| _AltSupplier | _AltSupplier | |||
| _AltCustomer | _AltCustomer |
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_US_StRpWhldgTaxItemDoc.
-- 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: PUSWHTITEM
CREATE VIEW P_US_StRpWhldgTaxItemDoc AS
SELECT
CompanyCode,
AccountingDocument,
FiscalYear,
WithholdingTaxType,
AccountingDocumentItem,
case when FinancialAccountType = 'K' and wht._Supplier.IsOneTimeAccount = '' then coalesce(wht._Supplier._AddressDefaultRepresentation.POBoxDeviatingRegion,wht._Supplier._AddressDefaultRepresentation.Region) when FinancialAccountType = 'D' and wht._Customer.IsOneTimeAccount = '' then coalesce(wht._Customer._AddressDefaultRepresentation.POBoxDeviatingRegion,wht._Customer._AddressDefaultRepresentation.Region) else wht.Region end as BPRgn AS RegionendasBPRgn,
BusinessPartner,
WithholdingTaxCode,
OfficialWhldgTaxCode,
_WithholdingTaxCode.WhldgTaxReferenceText AS WhldgTaxReferenceText,
PostingDate,
DocumentDate,
ClearingDate,
BusinessPartnerNumber,
cast( coalesce(_Onetime.TaxID1, coalesce(_BPTxNmbr1.BPTaxNumber,wht.TaxNumber1)) as stcd1 ) as TaxNumber1 AS TaxNumber1asstcd1asTaxNumber1,
cast( coalesce(_Onetime.TaxID2, coalesce(_BPTxNmbr2.BPTaxNumber,wht.TaxNumber2)) as stcd2) as TaxNumber2 AS TaxNumber2asstcd2asTaxNumber2,
wht._OperationalAcctgDocItem._SupplierCompany.AlternativePayee AS AlternativePayee,
wht._OperationalAcctgDocItem._CustomerCompany.AlternativePayerAccount AS AlternativePayer,
case when FinancialAccountType = 'K' then wht._Supplier.AddressID else wht._Customer.AddressID end as AddressID AS AddressIDendasAddressID,
case when FinancialAccountType = 'K' then wht.Creditor else wht.Debtor end as Partner AS DebtorendasPartner,
BusinessPlace,
FinancialAccountType,
AccountingDocumentType,
WhldgTaxDocumentType,
wht.SpecialGLTransactionType AS SpecialGLTransactionType,
wht.SpecialGLCode AS SpecialGLCode,
ClearingJournalEntry,
IsReversed,
IsReversal,
Creditor,
ReportingCurrency,
Debtor,
WhldgTaxExmptAmtInCoCodeCrcy,
CashDiscountAmtInCoCodeCrcy
FROM P_StRpWhldgTaxItem AS wht
LEFT OUTER JOIN I_Supplier AS _AltSupplier ON _AltSupplier.Supplier = AlternativePayee -- association [1..1]
LEFT OUTER JOIN I_Customer AS _AltCustomer ON _AltCustomer.Customer = AlternativePayer -- association [1..1]
LEFT OUTER JOIN I_Businesspartnertaxnumber AS _BPTxNmbr1 ON wht.BusinessPartnerNumber = _BPTxNmbr1.BusinessPartner AND _BPTxNmbr1.BPTaxType = 'US1' -- association [0..1]
LEFT OUTER JOIN I_Businesspartnertaxnumber AS _BPTxNmbr2 ON wht.BusinessPartnerNumber = _BPTxNmbr2.BusinessPartner AND _BPTxNmbr2.BPTaxType = 'US2' -- 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