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_CAStRpECSalesListEntry.
-- 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: PCASRECSLENTRY
CREATE VIEW P_CAStRpECSalesListEntry AS
SELECT
CompanyCode,
CARptgDateTypeForECSalesList,
ECSalesListReportingDate,
BusinessPartner,
cast( CADocumentNumber as opbel_ca_kk preserving type ) AS CADocument,
CASqncNumberForECSalesList,
_DocHeader.CAReconciliationKey AS CAReconciliationKey,
_CompCode.FiscalYearVariant AS FiscalYearVariant,
cast(_BusinessPartner.BusinessPartnerName as bp_name_ca preserving type ) AS BusinessPartnerName,
cast(_CompCode.TaxableEntity as umkrs ) AS TaxableEntity,
_BusinessPartner.AuthorizationGroup AS AuthorizationGroup,
cast(TaxCode as mwskz preserving type ) AS TaxCode,
cast(BusinessPartner as fis_kunnr preserving type ) AS Debtor,
cast(_BusinessPartner.BusinessPartnerName as md_customer_name ) AS CustomerName,
cast(BusinessPartner as fis_lifnr preserving type ) AS Creditor,
cast(_BusinessPartner.BusinessPartnerName as md_supplier_name ) AS SupplierName,
cast(VATRegistration as stceg preserving type ) AS VATRegistration,
cast(Country as land1 preserving type ) AS Country,
cast(CATaxBaseAmtInCountryCrcy as glo_amount_rptg_crcy ) AS AmountInReportingCurrency,
cast(CountryCurrency as glo_reporting_currency preserving type ) AS ReportingCurrency,
cast(TaxReturnCountry as glo_country preserving type ) AS ReportingCountry,
cast(TaxReturnCountry as land1_stml preserving type ) AS TaxReturnCountry,
cast(ECSalesListReportingDate as glo_reporting_date preserving type ) AS ReportingDate,
cast(CATaxBaseAmtInCoCodeCrcy as hwbas ) AS TaxBaseAmountInCoCodeCrcy,
cast(CompanyCodeCurrency as fis_hwaer preserving type ) AS CompanyCodeCurrency,
cast(CATaxBaseAmtInCountryCrcy as glo_cntry_base ) AS TaxBaseAmountInCountryCrcy,
cast(CountryCurrency as waers_005 preserving type ) AS CountryCurrency,
cast(CAPostingDate as fis_budat preserving type ) AS PostingDate,
cast(DocumentDate as fis_bldat preserving type ) AS DocumentDate,
cast(TaxReportingDate as vatdate preserving type ) AS TaxReportingDate,
cast(EUTaxClassification as egrkz preserving type ) AS EUTaxClassification,
cast(TaxType as mwart preserving type ) AS TaxType,
cast('' as fins_xreversed preserving type ) AS IsReversed,
cast(0 as fwbas ) AS TaxBaseAmountInTransCrcy,
cast('' as xcpdk preserving type ) AS IsOneTimeAccount,
cast('' as txgrp ) AS TaxItemGroup,
cast('' as txjcd ) AS TaxJurisdiction,
cast('' as xegdr preserving type ) AS IsEUTriangularDeal,
cast('' as egbld ) AS DelivOfGoodsDestCountry,
cast('' as eglld ) AS DelivOfGoodsOriginCountry,
cast('' as waers ) AS DocumentCurrency,
cast('' as belnr_d ) AS AccountingDocument,
cast('' as ktosl ) AS TransactionTypeDetermination,
cast('' as taxitem ) AS TaxItem,
cast('' as srf_rep_cat_id ) AS StatryRptCategory,
cast('' as srf_report_run_id ) AS StatryRptRunID,
cast('' as srf_reporting_entity ) AS StatryRptgEntity,
cast('' as fis_awtyp ) AS ReferenceDocumentType
FROM I_CAStRpECSalesListDoc
;