I have a sqlscript inside an AMDP class. I get a dump on the following statement:
sel1 = select mandt, equnr,
ROW_NUMBER() OVER ( PARTITION BY equnr ORDER BY equnr, idate, itime, mdocm) as rnum,
to_date(idate) as idate,
cast(to_varchar(idate) || to_varchar(itime) as "$ABAP.type( TSTMP_BW_EXTRACT )" ) AS mytimestmp,
LEAD(cast(to_varchar(idate) || to_varchar(itime) as "$ABAP.type( TSTMP_BW_EXTRACT )" )) OVER ( ORDER
BY equnr, idate, itime, MDOCM) timdelta,
to_decimal('0.0',25,6) as mydiff,
VLCOD,
LEAD(vlcod, 1) OVER ( ORDER BY equnr,idate,itime,MDOCM) as nxtVlcod,
TO_DECIMAL('0.0',25,6) as T_PRESS_RUN,
TO_DECIMAL('0.0',25,6) as T_PRESS_DWN,
TO_DECIMAL('0.0',25,6) as T_UPRESS_DWN
from :sel_imrg
where equnr = :v_equnr
and idate between v_date_begin and v_date_end
order by mandt, equnr, idate, itime, MDOCM;
The issue seems to be with converting separate idate and itime fields into a timestamp. I've tried many different data types for the timestamp value, such as TIMESTAMP and the ABAP type shown above. I've also tried to_timestamp(), cast(), to_decimal(), etc.
Strange thing is, almost exact same statement worked just fine in the HANA studio SQL console in a HANA sidecar.
The dump says CX_AMDP_EXECUTION_FAILED SQL error 339 "[339] (range 3) invalid number exception: invalid number: "TST"."SAPTST"."ZCL_TEST_CLASS=>EXECUTE#stb2#20210405110801": | | l"
System is S/4 1809 SAP_ABA 75D SP5 on HANA 2.00.048.00.1591276203
I appreciate any help you all can provide.