P_KZ_VATRetOutDoc

DDL: P_KZ_VATRETOUTDOC SQL: PKZVATRETOUTDOC Type: view COMPOSITE Package: GLO_FIN_IS_VAT_KZ_RETURN

Selection for outgoing documents

P_KZ_VATRetOutDoc is a Composite CDS View that provides data about "Selection for outgoing documents" in SAP S/4HANA. It reads from 2 data sources (P_KZ_BillingMaterialDetails, P_KZ_JournalEntryItemLdngLdgr) and exposes 46 fields. Part of development package GLO_FIN_IS_VAT_KZ_RETURN.

Data Sources (2)

SourceAliasJoin Type
P_KZ_BillingMaterialDetails BillingMaterial left_outer
P_KZ_JournalEntryItemLdngLdgr DocumentItem left_outer

Annotations (6)

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

Fields (46)

KeyFieldSource TableSource FieldDescription
CompanyCode LogItems CompanyCode Receiver Company Code
AccountingDocument LogItems AccountingDocument Journal Entry
FiscalYear LogItems FiscalYear G/L Fiscal Year
TaxCode LogItems TaxCode Tax Code
TaxRate LogItems TaxRate Tax Rate
AmountSign LogItems AmountSign
NegativeSign LogItems NegativeSign
AmountInCompanyCodeCurrency P_KZ_JournalEntryItemLdngLdgr AmountInCompanyCodeCurrency Local Crcy Amt
TaxBaseAmountInCoCodeCrcy LogItems TaxBaseAmountInCoCodeCrcy TxBaseAmt CoCodeCrcy
TaxAmountInCoCodeCrcy LogItems TaxAmountInCoCodeCrcy Tax Amount in Company Code Currency
TaxBaseAmountInCoCodeCrcyABS
AmountInCompanyCodeCurrencyABS
TaxBaseAmountInCoCodeCrcyTot LogItems TaxBaseAmountInCoCodeCrcy TxBaseAmt CoCodeCrcy
TaxAmountInCoCodeCrcyTot LogItems TaxAmountInCoCodeCrcy Tax Amount in Company Code Currency
TransactionTypeDetermination LogItems TransactionTypeDetermination Transaction Key
PostingDate LogItems PostingDate Posting Date for GR
TaxReportingDate LogItems TaxReportingDate Tax Reporting Date
AccountingDocumentType LogItems AccountingDocumentType Journal Entry Type
IsReversal LogItems IsReversal Reversal doc.
IsReversed LogItems IsReversed Reversed?
OriginalReferenceDocument LogItems OriginalReferenceDocument Reference Key
ReferenceDocumentType LogItems ReferenceDocumentType Reference Document Type
DocumentReferenceID LogItems DocumentReferenceID Reference
BusinessTransactionType LogItems BusinessTransactionType Bus.transaction
SenderLogicalSystem LogItems SenderLogicalSystem Sender Logical System
AccountingDocumentHeaderText LogItems AccountingDocumentHeaderText Doc.Header Text
AccountingDocCreatedByUser LogItems AccountingDocCreatedByUser User which created overhead document
Reference1InDocumentHeader LogItems Reference1InDocumentHeader Reference 1
Reference2InDocumentHeader LogItems Reference2InDocumentHeader Reference 2
DocumentItemText LogItems DocumentItemText Text
CompanyCodeCurrency LogItems CompanyCodeCurrency Local Currency
Currency LogItems Currency Valuation Crcy
StatryRptgEntity LogItems StatryRptgEntity Reporting Entity
StatryRptCategory LogItems StatryRptCategory Report ID
StatryRptRunID LogItems StatryRptRunID Report Run ID
AccountingDocumentItem LogItems AccountingDocumentItem Posting View Item
KZ_VATReturnSectionType LogItems KZ_VATReturnSectionType
Material P_KZ_BillingMaterialDetails Material Vehicle Model
PurchasingDocument P_KZ_JournalEntryItemLdngLdgr PurchasingDocument Purchasing Document
PurchasingDocumentItem P_KZ_JournalEntryItemLdngLdgr PurchasingDocumentItem Purchasing Doc. Item
MaterialNameelseendasMaterialName
ActivityendasActivity
KZ_MaterialSubGroup P_KZ_BillingMaterialDetails KZ_MaterialSubGroup
AnalyticBaseUnit P_KZ_BillingMaterialDetails BaseUnit Unit of Measure
AnalyticBillingQuantity P_KZ_BillingMaterialDetails BillingQuantity Invoiced Qty
AnalyticMaterialName P_KZ_BillingMaterialDetails MaterialName Material Description

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_VATRetOutDoc.
-- 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: PKZVATRETOUTDOC

CREATE VIEW P_KZ_VATRetOutDoc AS
SELECT
  LogItems.CompanyCode AS CompanyCode,
  LogItems.AccountingDocument AS AccountingDocument,
  LogItems.FiscalYear AS FiscalYear,
  LogItems.TaxCode AS TaxCode,
  LogItems.TaxRate AS TaxRate,
  LogItems.AmountSign AS AmountSign,
  LogItems.NegativeSign AS NegativeSign,
  DocumentItem.AmountInCompanyCodeCurrency AS AmountInCompanyCodeCurrency,
  LogItems.TaxBaseAmountInCoCodeCrcy AS TaxBaseAmountInCoCodeCrcy,
  LogItems.TaxAmountInCoCodeCrcy AS TaxAmountInCoCodeCrcy,
  abs( LogItems.TaxBaseAmountInCoCodeCrcy ) AS TaxBaseAmountInCoCodeCrcyABS,
  abs( DocumentItem.AmountInCompanyCodeCurrency ) AS AmountInCompanyCodeCurrencyABS,
  LogItems.TaxBaseAmountInCoCodeCrcy AS TaxBaseAmountInCoCodeCrcyTot,
  LogItems.TaxAmountInCoCodeCrcy AS TaxAmountInCoCodeCrcyTot,
  LogItems.TransactionTypeDetermination AS TransactionTypeDetermination,
  LogItems.PostingDate AS PostingDate,
  LogItems.TaxReportingDate AS TaxReportingDate,
  LogItems.AccountingDocumentType AS AccountingDocumentType,
  LogItems.IsReversal AS IsReversal,
  LogItems.IsReversed AS IsReversed,
  LogItems.OriginalReferenceDocument AS OriginalReferenceDocument,
  LogItems.ReferenceDocumentType AS ReferenceDocumentType,
  LogItems.DocumentReferenceID AS DocumentReferenceID,
  LogItems.BusinessTransactionType AS BusinessTransactionType,
  LogItems.SenderLogicalSystem AS SenderLogicalSystem,
  LogItems.AccountingDocumentHeaderText AS AccountingDocumentHeaderText,
  LogItems.AccountingDocCreatedByUser AS AccountingDocCreatedByUser,
  LogItems.Reference1InDocumentHeader AS Reference1InDocumentHeader,
  LogItems.Reference2InDocumentHeader AS Reference2InDocumentHeader,
  LogItems.DocumentItemText AS DocumentItemText,
  LogItems.CompanyCodeCurrency AS CompanyCodeCurrency,
  LogItems.Currency AS Currency,
  LogItems.StatryRptgEntity AS StatryRptgEntity,
  LogItems.StatryRptCategory AS StatryRptCategory,
  LogItems.StatryRptRunID AS StatryRptRunID,
  LogItems.AccountingDocumentItem AS AccountingDocumentItem,
  LogItems.KZ_VATReturnSectionType AS KZ_VATReturnSectionType,
  BillingMaterial.Material AS Material,
  DocumentItem.PurchasingDocument AS PurchasingDocument,
  DocumentItem.PurchasingDocumentItem AS PurchasingDocumentItem,
  case BillingMaterial.KZ_MaterialSubGroup when 'MIN' then BillingMaterial.MaterialName else '' end as MaterialName AS MaterialNameelseendasMaterialName,
  case BillingMaterial.Activity when '' then '1' else BillingMaterial.Activity end as Activity AS ActivityendasActivity,
  BillingMaterial.KZ_MaterialSubGroup AS KZ_MaterialSubGroup,
  BillingMaterial.BaseUnit AS AnalyticBaseUnit,
  BillingMaterial.BillingQuantity AS AnalyticBillingQuantity,
  BillingMaterial.MaterialName AS AnalyticMaterialName
LEFT OUTER JOIN P_KZ_JournalEntryItemLdngLdgr AS DocumentItem ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_KZ_BillingMaterialDetails AS BillingMaterial ON /* join condition not captured in parsed metadata */
;