我在 AMDP 类中有一个 sqlscript。我得到以下声明的转储:
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;
问题似乎在于将单独的 idate 和 itime 字段转换为时间戳。我已经为时间戳值尝试了许多不同的数据类型,例如上面显示的 TIMESTAMP 和 ABAP 类型。我也尝试过 to_timestamp()、cast()、to_decimal() 等。
奇怪的是,几乎完全相同的语句在 HANA 边车的 HANA Studio SQL 控制台中运行良好。
转储显示 CX_AMDP_EXECUTION_FAILED SQL 错误 339“[339](范围 3)无效号码异常:无效号码:“TST”。“SAPTST”。“ZCL_TEST_CLASS=>EXECUTE#stb2#20210405110801”:||l”
系统是 S/4 1809 SAP_ABA 75D SP5 on HANA 2.00.048.00.1591276203
我很感激你们能提供的任何帮助。