P_PT_CAPrepForUnion
CA Document Preperation for Union for Portugal Annex O
P_PT_CAPrepForUnion is a Consumption CDS View that provides data about "CA Document Preperation for Union for Portugal Annex O" in SAP S/4HANA. It reads from 1 data source (P_PT_CADocItmAnnex) and exposes 32 fields with key fields AccountingDocument, CompanyCode, FiscalYear, AccountingDocumentItem, StatryRptCategory.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_PT_CADocItmAnnex | P_PT_CADocItmAnnex | from |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | CA Document Preperation for Union for Portugal Annex O | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view |
Fields (32)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | AccountingDocument | |||
| KEY | CompanyCode | P_PT_CADocItmAnnex | CompanyCode | Receiver Company Code |
| KEY | FiscalYear | FiscalYear | FiscalYear | G/L Fiscal Year |
| KEY | AccountingDocumentItem | |||
| KEY | StatryRptCategory | log_fica | StatryRptCategory | Report ID |
| KEY | StatryRptgEntity | log_fica | StatryRptgEntity | Reporting Entity |
| KEY | StatryRptRunID | log_fica | StatryRptRunID | Report Run ID |
| KEY | CADocumentNumber | P_PT_CADocItmAnnex | CADocumentNumber | Document Number |
| KEY | CARepetitionItemNumber | P_PT_CADocItmAnnex | CARepetitionItemNumber | Repetition Item |
| KEY | CABPItemNumber | P_PT_CADocItmAnnex | CABPItemNumber | Item |
| KEY | CASubItemNumber | P_PT_CADocItmAnnex | CASubItemNumber | Subitem |
| PostingDate | P_PT_CADocItmAnnex | PostingDate | Posting Date for GR | |
| DocumentDate | P_PT_CADocItmAnnex | DocumentDate | Journal Entry Date | |
| Customer | ||||
| Supplier | ||||
| BusinessPartner | P_PT_CADocItmAnnex | BusinessPartner | Issuing Authority | |
| BusinessPartnerName | P_PT_CADocItmAnnex | BusinessPartnerName | Extracted Customer Name | |
| WithholdingTaxCode | ||||
| BalanceTransactionCurrency | P_PT_CADocItmAnnex | CAClearingCurrency | Clearing Curr. | |
| AccountingDocumentType | ||||
| CADocumentType | P_PT_CADocItmAnnex | CADocumentType | Document Type | |
| WithholdingTaxAmount | ||||
| curr132endasCashDiscountAmtInCoCodeCrcy | ||||
| CashDiscountAmount | ||||
| TransactionCurrency | P_PT_CADocItmAnnex | TransactionCurrency | Transaction Currency | |
| IsSalesRelated | ||||
| AmountInCompanyCodeCurrency | P_PT_CADocItmAnnex | CAAmountInLocalCurrency | Local Crcy Amt | |
| FinancialAccountType | ||||
| AmountInReportingCurrency | ||||
| ReportingVATRegistration | P_PT_CADocItmAnnex | VATRegistration | VAT Registration No. | |
| CompanyCodeCurrency | P_PT_CADocItmAnnex | CompanyCodeCurrency | Local Currency | |
| VATRegistrationCountry |
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_PT_CAPrepForUnion.
-- 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.
CREATE VIEW P_PT_CAPrepForUnion AS
SELECT
cast( '0' as farp_belnr_d ) AS AccountingDocument,
P_PT_CADocItmAnnex.CompanyCode AS CompanyCode,
FiscalYear.FiscalYear AS FiscalYear,
cast( '000' as fis_buzei ) AS AccountingDocumentItem,
log_fica.StatryRptCategory AS StatryRptCategory,
log_fica.StatryRptgEntity AS StatryRptgEntity,
log_fica.StatryRptRunID AS StatryRptRunID,
P_PT_CADocItmAnnex.CADocumentNumber AS CADocumentNumber,
P_PT_CADocItmAnnex.CARepetitionItemNumber AS CARepetitionItemNumber,
P_PT_CADocItmAnnex.CABPItemNumber AS CABPItemNumber,
P_PT_CADocItmAnnex.CASubItemNumber AS CASubItemNumber,
P_PT_CADocItmAnnex.PostingDate AS PostingDate,
P_PT_CADocItmAnnex.DocumentDate AS DocumentDate,
cast('#' as kunnr ) AS Customer,
cast('#' as md_supplier ) AS Supplier,
P_PT_CADocItmAnnex.BusinessPartner AS BusinessPartner,
P_PT_CADocItmAnnex.BusinessPartnerName AS BusinessPartnerName,
cast('' as fac_qsskz ) AS WithholdingTaxCode,
P_PT_CADocItmAnnex.CAClearingCurrency AS BalanceTransactionCurrency,
cast('' as farp_blart) AS AccountingDocumentType,
P_PT_CADocItmAnnex.CADocumentType AS CADocumentType,
cast( 0 as qbshb_shl ) AS WithholdingTaxAmount,
case when P_PT_CADocItmAnnex.CAExchangeRate is initial or P_PT_CADocItmAnnex.CAExchangeRate = 0 or P_PT_CADocItmAnnex.CAExchangeRate is null then P_PT_CADocItmAnnex.CACashDiscAmountInClearingCrcy when P_PT_CADocItmAnnex.ExchRateIsIndirectQuotation = 'X' then cast( cast(P_PT_CADocItmAnnex.CACashDiscAmountInClearingCrcy as abap.fltp) / cast(P_PT_CADocItmAnnex.CAExchangeRate as abap.fltp) as abap.curr(13,2)) else cast( cast(P_PT_CADocItmAnnex.CACashDiscAmountInClearingCrcy as abap.fltp) * cast(P_PT_CADocItmAnnex.CAExchangeRate as abap.fltp) as abap.curr(13,2)) end as CashDiscountAmtInCoCodeCrcy AS curr132endasCashDiscountAmtInCoCodeCrcy,
cast( 0 as fis_sknto ) AS CashDiscountAmount,
P_PT_CADocItmAnnex.TransactionCurrency AS TransactionCurrency,
'X' AS IsSalesRelated,
P_PT_CADocItmAnnex.CAAmountInLocalCurrency AS AmountInCompanyCodeCurrency,
cast('D' as farp_koart ) AS FinancialAccountType,
P_PT_CADocItmAnnex.CAAmountInLocalCurrency - CashDiscountAmtInCoCodeCrcy AS AmountInReportingCurrency,
P_PT_CADocItmAnnex.VATRegistration AS ReportingVATRegistration,
P_PT_CADocItmAnnex.CompanyCodeCurrency AS CompanyCodeCurrency,
left(P_PT_CADocItmAnnex.VATRegistration,2) AS VATRegistrationCountry
FROM P_PT_CADocItmAnnex
;
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