P_US_StRpWhldgTaxItemDoc

DDL: P_US_STRPWHLDGTAXITEMDOC SQL: PUSWHTITEM Type: view COMPOSITE

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)

SourceAliasJoin Type
P_StRpWhldgTaxItem wht from

Associations (4)

CardinalityTargetAliasCondition
[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)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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]
;