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_UnrealizedCrcyDiffFilter.
-- 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: PUNCRCYDIFFFTR
CREATE VIEW P_UnrealizedCrcyDiffFilter AS
SELECT
cast('' as logsys ) AS OriginSystem,
cast('FCV' as fqm_origin_application ) AS OriginApplication,
cast(concat(flow.AccountingDocument,concat(flow.CompanyCode,flow.FiscalYear)) as fqm_origin_doc_id ) AS OriginDocument,
cast(concat(flow.CompanyCode,concat('-',concat(flow.FiscalYear,concat('-',flow.AccountingDocument)))) as fqm_origin_trans_id) AS OriginTransaction,
cast('' as fqm_origin_trans_qualifier) AS OriginTransactionQualifier,
cast(flow.LedgerGLLineItem as fqm_origin_flow_id) AS CashFlow,
cast('19000101000001' as timestampl) AS ValidFrom,
cast('99991231235959' as timestampl) AS ValidTo,
gl.CashFlowScopeForAccounting AS CashFlowScopeForAccounting,
cast('' as fqm_flow_id) AS CashFlowID,
cast('19000101000001.0000000' as abap.char(27)) AS CashFlowSnapshotValue,
cast('X' as boolean) AS IsValid,
cast(flow.AccountingDocCreatedByUser as fclm_bam_created_by) AS CreatedByUser,
cast('19000101000001' as timestamp) AS CreationDateTime,
cast('' as fclm_bam_lastchgby) AS LastChangedByUser,
cast('19000101000001' as timestamp) AS LastChangeDateTime,
cast('FCV' as fqm_owner) AS CashTransactionOwner,
flow.CompanyCode AS CompanyCode,
cast(case when flow.TransactionDate = '' then '00000000' else flow.TransactionDate end as valut ) AS TransactionDate,
cast('ACTUAL' as fqm_certainty_level) AS CertaintyLevel,
flow.TransactionCurrency AS TransactionCurrency,
cast(flow.AmountInTransactionCurrency as fclm_cp_trans_amount preserving type ) AS AmountInTransactionCurrency,
cast(flow.CompanyCodeCurrency as fclm_cp_local_waers preserving type ) AS CompanyCodeCurrency,
cast(flow.AmountInCompanyCodeCurrency as fclm_cp_local_amount preserving type ) AS AmountInCompanyCodeCurrency,
cast(flow.BankAccountCurrency as fclm_bank_acct_currency preserving type ) AS BankAccountCurrency,
cast('' as fqm_release_status) AS CashReleaseStatus,
cast(flow.AccountingDocument as fis_belnr preserving type ) AS AccountingDocument,
cast(substring(cast(flow.LedgerGLLineItem as abap.char( 6 )),4,3) as fclm_cp_buzei ) AS AccountingDocumentItem,
flow.FiscalYear AS FiscalYear,
cast(cast(flow.FiscalPeriod as abap.char( 2 ) ) as monat) AS PostingFiscalPeriod,
flow.AccountingDocumentType AS AccountingDocumentType,
cast('' as fqm_payment_method) AS PaymentMethod,
flow.GLAccount AS GLAccount,
flow.FinancialAccountType AS FinancialAccountType,
flow.DocumentItemText AS DocumentItemText,
cast(case when flow.PostingDate = '' then '00000000' else flow.PostingDate end as budat ) AS PostingDate,
flow.CashPlanningGroup AS CashPlanningGroup,
flow.PlanningLevel AS PlanningLevel,
flow.HouseBank AS HouseBank,
flow.HouseBankAccount AS HouseBankAccount,
flow.BankAccountInternalID AS BankAccountInternalID,
flow.Customer AS Customer,
flow.Supplier AS Supplier,
cast('' as bu_partner) AS BusinessPartner,
flow.Material AS Material,
flow.BusinessArea AS BusinessArea,
flow.ProfitCenter AS ProfitCenter,
WBSElementInternalID,
flow.PartnerCompany AS PartnerCompany,
flow.CostCenter AS CostCenter,
flow.Segment AS Segment,
flow.LiquidityItem AS LiquidityItem,
cast('' as bukrs) AS SourceCompanyCode,
flow.Fund AS Fund,
flow.GrantID AS GrantID,
cast('' as vvsart) AS FinancialInstrumentProductType,
cast('' as tb_sfhaart) AS FinancialTransactionType,
cast('' as vvranlw) AS SecurityClass,
cast('' as rldepo) AS SecurityAccount,
cast('' as vertnr ) AS AssetContract,
cast('' as rportb) AS Portfolio,
cast('99991231' as datum) AS ExpirationDate,
cast('99991231' as datum) AS NetDueDate,
cast(concat(flow.CompanyCode,concat('-',concat(flow.FiscalYear,concat('-',flow.AccountingDocument)))) as fqm_origin_trans_id) AS OriginTransactionValue,
cast(flow.LedgerGLLineItem as fqm_origin_flow_id) AS OriginFlowID,
cast(flow.AccountingDocument as fclm_cp_doc_id ) AS OriginDocumentValue,
'00000000' AS BankStatementShortID,
'00000' AS BankStatementItem
FROM I_CshJrnlEntrForUnrlzdCrcyDiff AS flow
INNER JOIN I_Ledger AS ledger ON /* join condition not captured in parsed metadata */
INNER JOIN P_CashFlowItemGLAccountComb AS gl ON /* join condition not captured in parsed metadata */
;