P_KZ_VATRetCdec
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)
| Source | Alias | Join Type |
|---|---|---|
| I_CompanyCode | CompanyCode | left_outer |
| I_KZ_VATCstmDeclnItemLog | ItemLog | from |
| P_KZ_CustomDeclarationPrev | P_KZ_CustomDeclarationPrev | left_outer |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_FiscalYear | gjahr | |
| P_FiscalPeriod | j_3rf_quarters |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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 */
;
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