Skip to Content

Invalid number exception in AMDP

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.

Add comment
10|10000 characters needed 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!

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 24, 2017 at 02:55 PM

    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

    Add comment
    10|10000 characters needed characters exceeded