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_ReportedFinancialData_RT.
-- 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: PREPFINDRT
-- Parameters: p_timestamp_from : timestamp, p_timestamp_to : timestamp
CREATE VIEW P_ReportedFinancialData_RT AS
SELECT
cast('' as gu_recid) AS gl_sirid,
Source.rldnr_fin AS rldnr_fin,
cast(Source.rldnr as rldnr) AS rldnr,
cast('0' as rrcty) AS rrcty,
cast( cast(Source.rvers as abap.char(3)) as rvers) AS rvers,
Source.ryear AS ryear,
cast(Source.rtcur as rtcur) AS rtcur,
cast(Source.runit as meins) AS runit,
cast(' ' as shkzg) AS drcrk,
cast(Source.poper as poper) AS poper,
Source.fiscal_year_period AS fiscyearper,
cast('A' as docct) AS docct,
cast(Source.belnr as belnr_d) AS docnr,
cast(Source.docln as docln6) AS docln,
cast(' ' as rcomp_d) AS rcomp,
cast(Source.rdimen as fc_dimen) AS rdimen,
cast(Source.rbunit as fc_bunit) AS rbunit,
cast(Source.ritclg as fc_itclg) AS ritclg,
cast(Source.ritem as fc_item) AS ritem,
cast(coalesce(Source.rbuptr,'') as fc_buptr) AS rbuptr,
cast(' ' as fc_congr) AS rcongr,
cast(Source.robukrs as obukr) AS robukrs,
cast(Source.sityp as fc_sityp) AS sityp,
cast(Source.subit as fc_sitem) AS subit,
cast(' ' as fc_plevl) AS plevl,
cast('0' as fc_rpflg) AS rpflg,
cast('0' as fc_rtflg) AS rtflg,
cast(Source.docty as fc_docty) AS docty,
cast('0000' as fc_ryacq) AS yracq,
cast('000' as rpacq) AS pracq,
cast(' ' as fc_coicu) AS coicu,
cast(Source.poper as updhp) AS updhp,
cast(Source.tsl as vtcur9) AS tsl,
cast(Source.hsl as vlcur9) AS hsl,
cast(Source.ksl as vgcur9) AS ksl,
cast(Source.msl as quan1_9) AS msl,
cast(' ' as sgtxt) AS sgtxt,
cast(' ' as autom) AS autom,
cast(Source.activ as glvor) AS activ,
cast(' ' as bvorg) AS bvorg,
cast(Source.budat as budat) AS budat,
cast(Source.budat as wsdat) AS wsdat,
cast(Source.refdocnr as belnr_d) AS refdocnr,
cast(Source.refryear as gjahr) AS refryear,
cast('000000' as buzei6) AS refdocln,
cast('W' as docct) AS refdocct,
cast(Source.refactiv as glvor) AS refactiv,
cast(substring(cast(Source._acdoca.timestamp as abap.char(19)), 1, 8) as cpudt) AS cpudt,
cast(substring(cast(Source._acdoca.timestamp as abap.char(19)),5,6) as cputm) AS cputm,
cast(Source.usnam as usnam) AS usnam,
cast(' ' as stblg) AS rvsdocnr,
cast(' ' as stbln) AS orndocnr,
cast(' ' as fc_coiac) AS coiac,
cast(' ' as fc_coinr) AS coinr,
cast('' as fc_uppcu) AS uppcu,
cast('0000' as fc_revyear) AS revyear,
cast(Source.awtyp as awtyp) AS awtyp,
cast(Source.aworg as aworg) AS aworg,
cast(Source.logsys as logsys) AS logsys,
Source._acdoca.ktopl AS ktopl,
cast(Source.rlcurr as lcurr) AS rhcur,
cast(Source.rgcurr as gcurr) AS rkcur,
racct,
cast('' as xblnr1) AS xblnr,
_acdoca.zuonr AS zuonr,
rcntr,
prctr,
rfarea,
rbusa,
_acdoca.kokrs AS kokrs,
segment,
_acdoca.scntr AS scntr,
_acdoca.pprctr AS pprctr,
_acdoca.sfarea AS sfarea,
_acdoca.sbusa AS sbusa,
_acdoca.rassc AS rassc,
_acdoca.psegment AS psegment,
_acdoca.aufnr AS aufnr,
_acdoca.kunnr AS kunnr,
_acdoca.lifnr AS lifnr,
_acdoca.matnr AS matnr,
_acdoca.matkl_mm AS matkl_mm,
_acdoca.werks AS werks,
rmvct,
_acdoca.ps_psp_pnr AS ps_psp_pnr,
_acdoca.ps_posid AS ps_posid,
_acdoca.ps_pspid AS ps_pspid,
_acdoca.fkart AS fkart,
_acdoca.vkorg AS vkorg,
_acdoca.vtweg AS vtweg,
_acdoca.spart AS spart,
_acdoca.matnr_copa AS matnr_copa,
_acdoca.matkl AS matkl,
_acdoca.kdgrp AS kdgrp,
_acdoca.land1 AS land1,
_acdoca.brsch AS brsch,
_acdoca.bzirk AS bzirk,
_acdoca.kunre AS kunre,
_acdoca.kunwe AS kunwe,
_acdoca.konzs AS konzs,
_acdoca.timestamp AS timestamp,
cast('' as data_temperature ) AS _dataaging
FROM P_ReportedFinancialData_RT_07
;