P_KZ_VATRetCdec

DDL: P_KZ_VATRETCDEC SQL: PKZVATRETCDEC Type: view COMPOSITE Package: GLO_FIN_IS_VAT_KZ_RETURN

Selection for custome declarations

P_KZ_VATRetCdec is a Composite CDS View that provides data about "Selection for custome declarations" in SAP S/4HANA. It reads from 3 data sources (I_CompanyCode, I_KZ_VATCstmDeclnItemLog, P_KZ_CustomDeclarationPrev) and exposes 17 fields with key fields StatryRptgEntity, StatryRptCategory, StatryRptRunID, CompanyCode, FiscalYear. Part of development package GLO_FIN_IS_VAT_KZ_RETURN.

Data Sources (3)

SourceAliasJoin Type
I_CompanyCode CompanyCode left_outer
I_KZ_VATCstmDeclnItemLog ItemLog from
P_KZ_CustomDeclarationPrev P_KZ_CustomDeclarationPrev left_outer

Parameters (2)

NameTypeDefault
P_FiscalYear gjahr
P_FiscalPeriod j_3rf_quarters

Annotations (7)

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

Fields (17)

KeyFieldSource TableSource FieldDescription
KEY StatryRptgEntity I_KZ_VATCstmDeclnItemLog StatryRptgEntity Reporting Entity
KEY StatryRptCategory I_KZ_VATCstmDeclnItemLog StatryRptCategory Report ID
KEY StatryRptRunID I_KZ_VATCstmDeclnItemLog StatryRptRunID Report Run ID
KEY CompanyCode I_KZ_VATCstmDeclnItemLog CompanyCode Receiver Company Code
KEY FiscalYear I_KZ_VATCstmDeclnItemLog FiscalYear G/L Fiscal Year
KEY FiscalPeriod I_KZ_VATCstmDeclnItemLog PostingFiscalPeriod Period
KEY CustomDeclarationNumber I_KZ_VATCstmDeclnItemLog CustomsDeclaration Cus. Decl. No.
KEY SectionNum KZ_VATReturnSection VAT Return Section
LineItem VAT Return Line Item
KEY LineItem VAT Return Line Item
CustomDeclDate CustDecl CustomsDeclarationRegDate
LocalVATAMount CustDecl TaxAmount Tax Amt in Rptg Crcy
PaymentLimitDate CustDecl PaymentDate Payment Date
PaidVATAmount CustDecl PaidAmountInPaytCurrency Payment Amount
PaidVATAmountPrev CustDeclPrev PaidVATAmount
VatDebt
Currency I_CompanyCode Currency Valuation Crcy

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_VATRetCdec.
-- 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: PKZVATRETCDEC
-- Parameters: P_FiscalYear : gjahr, P_FiscalPeriod : j_3rf_quarters

CREATE VIEW P_KZ_VATRetCdec AS
SELECT
  ItemLog.StatryRptgEntity AS StatryRptgEntity,
  ItemLog.StatryRptCategory AS StatryRptCategory,
  ItemLog.StatryRptRunID AS StatryRptRunID,
  ItemLog.CompanyCode AS CompanyCode,
  ItemLog.FiscalYear AS FiscalYear,
  ItemLog.PostingFiscalPeriod AS FiscalPeriod,
  ItemLog.CustomsDeclaration AS CustomDeclarationNumber,
  KZ_VATReturnSection AS SectionNum,
  cast( KZ_VATLineItem as numc08) AS LineItem,
  CustDecl.CustomsDeclarationRegDate AS CustomDeclDate,
  CustDecl.TaxAmount AS LocalVATAMount,
  CustDecl.PaymentDate AS PaymentLimitDate,
  CustDecl.PaidAmountInPaytCurrency AS PaidVATAmount,
  CustDeclPrev.PaidVATAmount AS PaidVATAmountPrev,
  CustDecl.TaxAmount - ( CustDecl.PaidAmountInPaytCurrency + coalesce( CustDeclPrev.PaidVATAmount, 0 ) ) AS VatDebt,
  CompanyCode.Currency AS Currency
FROM I_KZ_VATCstmDeclnItemLog AS ItemLog
LEFT OUTER JOIN P_KZ_CustomDeclarationPrev ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_CompanyCode AS CompanyCode ON /* join condition not captured in parsed metadata */
;