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 FM_tot_Fmia.
-- 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: FMV_TOT_FMIA
CREATE VIEW FM_tot_Fmia AS
SELECT
rclnt,
rldnr,
ryear,
cast('000' as abap.char(3)) AS rvers,
cast('0' as abap.char(1)) AS RRCTY,
'000000000000000000' AS ROBJNR,
'000000000000000000' AS COBJNR,
'000000000000000000' AS SOBJNR,
rtcur,
rbukrs,
rfistl,
rfonds,
rfipex,
rwrttp,
rbtart,
rgnjhr,
rhkont,
rstats,
rcflev,
robjnrz,
rvrgng,
ruserdim,
rfarea,
rmeasure,
grant_nbr,
rbusa,
budget_pd,
fikrs,
' ' AS DISTKEY,
' ' AS CSPRED,
case poper when '000' then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tslvt,
case mod( cast(poper as abap.int4 ), 16) when 1 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl01,
case mod( cast(poper as abap.int4 ), 16) when 2 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl02,
case mod( cast(poper as abap.int4 ), 16) when 3 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl03,
case mod( cast(poper as abap.int4 ), 16) when 4 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl04,
case mod( cast(poper as abap.int4 ), 16) when 5 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl05,
case mod( cast(poper as abap.int4 ), 16) when 6 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl06,
case mod( cast(poper as abap.int4 ), 16) when 7 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl07,
case mod( cast(poper as abap.int4 ), 16) when 8 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl08,
case mod( cast(poper as abap.int4 ), 16) when 9 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl09,
case mod( cast(poper as abap.int4 ), 16) when 10 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl10,
case mod( cast(poper as abap.int4 ), 16) when 11 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl11,
case mod( cast(poper as abap.int4 ), 16) when 12 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl12,
case mod( cast(poper as abap.int4 ), 16) when 13 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl13,
case mod( cast(poper as abap.int4 ), 16) when 14 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl14,
case mod( cast(poper as abap.int4 ), 16) when 15 then cast(tsl as abap.curr( 17, 2 )) else 0 end AS tsl15,
case poper when '000' then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hslvt,
case mod( cast(poper as abap.int4 ), 16) when 1 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl01,
case mod( cast(poper as abap.int4 ), 16) when 2 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl02,
case mod( cast(poper as abap.int4 ), 16) when 3 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl03,
case mod( cast(poper as abap.int4 ), 16) when 4 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl04,
case mod( cast(poper as abap.int4 ), 16) when 5 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl05,
case mod( cast(poper as abap.int4 ), 16) when 6 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl06,
case mod( cast(poper as abap.int4 ), 16) when 7 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl07,
case mod( cast(poper as abap.int4 ), 16) when 8 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl08,
case mod( cast(poper as abap.int4 ), 16) when 9 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl09,
case mod( cast(poper as abap.int4 ), 16) when 10 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl10,
case mod( cast(poper as abap.int4 ), 16) when 11 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl11,
case mod( cast(poper as abap.int4 ), 16) when 12 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl12,
case mod( cast(poper as abap.int4 ), 16) when 13 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl13,
case mod( cast(poper as abap.int4 ), 16) when 14 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl14,
case mod( cast(poper as abap.int4 ), 16) when 15 then cast(hsl as abap.curr( 17, 2 )) else 0 end AS hsl15
FROM fmia
LEFT OUTER JOIN fmale_csystem AS csystem ON rclnt = csystem.mandt -- association [0..1]
;