Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CX_SY_ARITHMETIC_OVERFLOW different data type

calvinkarlo
Explorer
0 Kudos
1,129

Hi I encountered CX_SY_ARITHMETIC_OVERFLOW

upon checking the data types vat_percentage is dec and kbetr is curr

Please help thank you!

4 REPLIES 4

raymond_giuseppi
Active Contributor
999

Check

  • the value of currency code (KOEI1) associated to the original field to get number of decimal, is this '%'
  • Flag Fixed Point Arithmletic of you main object (class, program, function group)

calvinkarlo
Explorer
0 Kudos
999

Yes this is for '%'

VXLozano
Active Contributor
999

Check the error syntax. But even that is not needed.

CX_SY_ARITHMETIC_OVERFLOW means "this value is too large for this variable".

10000 / 10 = 1000

Your variable is defined as DEC 5/2, so it's five positions with two decimal, ergo from -999,99 to 999,99.

0 Kudos
999

Also maybe it's a more complex case if the Fixed Point Arithmetic flag is not selected in the program attributes (means the decimals are ignored), as Raymond suggested. The analysis is different if we ignore the decimals but comes to the same conclusion: the division of 1,000,000 (1 million) by 10 gives 100,000 (1 hundred thousands), which can't be stored as the maximum is 99,999 (1 hundred thousands minus 1).