P_KZ_VATRetForeignDocRenew

DDL: P_KZ_VATRETFOREIGNDOCRENEW SQL: PKZVATRETFORREN Type: view COMPOSITE

P_KZ_VATRetForeignDocRenew is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_KZ_DSVATRetForiegnDocRenew1) and exposes 47 fields. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
P_KZ_DSVATRetForiegnDocRenew1 P_KZ_DSVATRetForiegnDocRenew1 from

Parameters (4)

NameTypeDefault
P_VATReturnVersion j_3rvatdversion
P_TaxItemGroupingVersion verstax
P_ReportingPeriodStartDate datum
P_ReportingPeriodEndDate datum

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_KZ_BusinessPartnerContract _Contract BusinessPartnerItem.AssignmentReference = _Contract.AssignmentReference and ForeignDoc.CompanyCode = _Contract.CompanyCode

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PKZVATRETFORREN view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view
AbapCatalog.compiler.compareFilter true view

Fields (47)

KeyFieldSource TableSource FieldDescription
CompanyCode ForeignDoc CompanyCode Receiver Company Code
AccountingDocument ForeignDoc AccountingDocument Journal Entry
FiscalYear ForeignDoc FiscalYear G/L Fiscal Year
TaxBaseAmountInCoCodeCrcy BusinessPartnerItem AmountInCompanyCodeCurrency Local Crcy Amt
TaxAmountInCoCodeCrcy ForeignDoc TaxAmountInCoCodeCrcy Tax Amount in Company Code Currency
PostingDate ForeignDoc PostingDate Posting Date for GR
TaxReportingDate ForeignDoc TaxReportingDate Tax Reporting Date
DocumentDate ForeignDoc DocumentDate Journal Entry Date
AccountingDocumentType ForeignDoc AccountingDocumentType Journal Entry Type
IsReversal ForeignDoc IsReversal Reversal doc.
IsReversed ForeignDoc IsReversed Reversed?
OriginalReferenceDocument ForeignDoc OriginalReferenceDocument Reference Key
ReferenceDocumentType ForeignDoc ReferenceDocumentType Reference Document Type
DocumentReferenceID ForeignDoc DocumentReferenceID Reference
BusinessTransactionType ForeignDoc BusinessTransactionType Bus.transaction
SenderLogicalSystem ForeignDoc SenderLogicalSystem Sender Logical System
CompanyCodeCurrency ForeignDoc CompanyCodeCurrency Local Currency
Currency Currency Valuation Crcy
VATToBePaid ForeignDoc TaxBaseAmountInCoCodeCrcy TxBaseAmt CoCodeCrcy
SupplierName SupplierData SupplierName Supplier Name
Country Country CountryThreeDigitISOCode
TaxNumber1 RootSuplierData TaxNumber1 VAT Reg. No.
TaxCode ForeignDoc TaxCode Tax Code
AccountingDocumentItem ForeignDoc AccountingDocumentItem Posting View Item
FiscalPeriod ForeignDoc FiscalPeriod Tax period
ControllingArea BusinessPartnerItem ControllingArea Controlling Area
Segment BusinessPartnerItem Segment Segment number
ProfitCenter BusinessPartnerItem ProfitCenter Profit Center
CostCenter BusinessPartnerItem CostCenter Cost Center
BusinessArea BusinessPartnerItem BusinessArea Business Area
Supplier BusinessPartnerItem Supplier Supplier
Customer BusinessPartnerItem Customer Sold-to Party
MasterFixedAsset BusinessPartnerItem MasterFixedAsset Fixed Asset
FixedAsset BusinessPartnerItem FixedAsset Sub-number
AssetClass BusinessPartnerItem AssetClass Asset Class
AssignmentReference BusinessPartnerItem AssignmentReference Assignment Reference
Plant BusinessPartnerItem Plant Valuation Area
InventoryValuationType BusinessPartnerItem InventoryValuationType Valuation Type
ValuationArea BusinessPartnerItem ValuationArea Valuation Area
Product BusinessPartnerItem Product Product Sold
FunctionalArea BusinessPartnerItem FunctionalArea Sendr Fctl Area
Material BusinessPartnerItem Material Vehicle Model
AccountingDocumentCategory ForeignDoc AccountingDocumentCategory Journal Entry Category
KZ_TaxTurnoverCode KZ_TaxTurnoverCode
TaxGroupOperation ForeignDoc TaxGroupOperation
DebitCreditCode ForeignDoc DebitCreditCode Single-Character Flag
_Contract _Contract

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_VATRetForeignDocRenew.
-- 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: PKZVATRETFORREN
-- Parameters: P_VATReturnVersion : j_3rvatdversion, P_TaxItemGroupingVersion : verstax, P_ReportingPeriodStartDate : datum, P_ReportingPeriodEndDate : datum

CREATE VIEW P_KZ_VATRetForeignDocRenew AS
SELECT
  ForeignDoc.CompanyCode AS CompanyCode,
  ForeignDoc.AccountingDocument AS AccountingDocument,
  ForeignDoc.FiscalYear AS FiscalYear,
  BusinessPartnerItem.AmountInCompanyCodeCurrency AS TaxBaseAmountInCoCodeCrcy,
  ForeignDoc.TaxAmountInCoCodeCrcy AS TaxAmountInCoCodeCrcy,
  ForeignDoc.PostingDate AS PostingDate,
  ForeignDoc.TaxReportingDate AS TaxReportingDate,
  ForeignDoc.DocumentDate AS DocumentDate,
  ForeignDoc.AccountingDocumentType AS AccountingDocumentType,
  ForeignDoc.IsReversal AS IsReversal,
  ForeignDoc.IsReversed AS IsReversed,
  ForeignDoc.OriginalReferenceDocument AS OriginalReferenceDocument,
  ForeignDoc.ReferenceDocumentType AS ReferenceDocumentType,
  ForeignDoc.DocumentReferenceID AS DocumentReferenceID,
  ForeignDoc.BusinessTransactionType AS BusinessTransactionType,
  ForeignDoc.SenderLogicalSystem AS SenderLogicalSystem,
  ForeignDoc.CompanyCodeCurrency AS CompanyCodeCurrency,
  Currency,
  ForeignDoc.TaxBaseAmountInCoCodeCrcy AS VATToBePaid,
  SupplierData.SupplierName AS SupplierName,
  Country.CountryThreeDigitISOCode AS Country,
  RootSuplierData.TaxNumber1 AS TaxNumber1,
  ForeignDoc.TaxCode AS TaxCode,
  ForeignDoc.AccountingDocumentItem AS AccountingDocumentItem,
  ForeignDoc.FiscalPeriod AS FiscalPeriod,
  BusinessPartnerItem.ControllingArea AS ControllingArea,
  BusinessPartnerItem.Segment AS Segment,
  BusinessPartnerItem.ProfitCenter AS ProfitCenter,
  BusinessPartnerItem.CostCenter AS CostCenter,
  BusinessPartnerItem.BusinessArea AS BusinessArea,
  BusinessPartnerItem.Supplier AS Supplier,
  BusinessPartnerItem.Customer AS Customer,
  BusinessPartnerItem.MasterFixedAsset AS MasterFixedAsset,
  BusinessPartnerItem.FixedAsset AS FixedAsset,
  BusinessPartnerItem.AssetClass AS AssetClass,
  BusinessPartnerItem.AssignmentReference AS AssignmentReference,
  BusinessPartnerItem.Plant AS Plant,
  BusinessPartnerItem.InventoryValuationType AS InventoryValuationType,
  BusinessPartnerItem.ValuationArea AS ValuationArea,
  BusinessPartnerItem.Product AS Product,
  BusinessPartnerItem.FunctionalArea AS FunctionalArea,
  BusinessPartnerItem.Material AS Material,
  ForeignDoc.AccountingDocumentCategory AS AccountingDocumentCategory,
  KZ_TaxTurnoverCode,
  ForeignDoc.TaxGroupOperation AS TaxGroupOperation,
  ForeignDoc.DebitCreditCode AS DebitCreditCode
FROM P_KZ_DSVATRetForiegnDocRenew1
LEFT OUTER JOIN I_KZ_BusinessPartnerContract AS _Contract ON BusinessPartnerItem.AssignmentReference = _Contract.AssignmentReference AND ForeignDoc.CompanyCode = _Contract.CompanyCode  -- association [0..1]
;