Skip to Content
0

Invalid number exception in AMDP

Jan 24, 2017 at 02:04 PM

356

avatar image

I have an AMDP method, with parameter IMPORTING VALUE(threshold) TYPE decfloat16

Within the AMDP is a complex select which uses to_bigint( :threshold ).

When I try to execute the method, I get a database error:

invalid number: [339] "SYSID"."ZCL_HANA_TABLE=>MY_METHOD#stb2#20170124144446": line 8 col 3 (at pos 177): [339] (range 3) invalid number exception: invalid number: [339] invalid number: not a valid number string 'C11C309000000000' at function to_bigint() (please check lines: 9)

I've check in the ABAP debugger and threshold contains the value 1048576.

If I replace :threshold with a number, the SQL works fine.

SQL
10 |10000 characters needed characters left characters exceeded

If I change the parameter type to i then I don't get a problem. It looks like decfloat isn't being passed as a number. Unfortunately, i doesn't have sufficient range for my purposes!

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Horst Keller
Jan 24, 2017 at 02:55 PM
2

See Mapping of ABAP Types to SQLScript under

http://help.sap.com/abapdocu_751/en/index.htm?file=abenamdp_hdb_sqlscript.htm

decfloat16 -> VARBINARY, length 8. Cannot be interpreted as a number in the database and no calculations can be performed

decfloat34 -> VARBINARY, length 16. Cannot be interpreted as a number in the database and no calculations can be performed

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Exactly what I was looking for - but couldn't find!

int8 would be preferred solution, but we're not at 7.5 yet. So I'm using type f.

0

I already made the mapping tables a separate topic in the next documentation release.

0