Search code examples
abapdivision

CX_SY_CONVERSION_NO_NUMBER when divide on i type?


I am trying to divide my 2 number. And I determine them with different type. I am getting error when I try to divide them.

But my point is, when I am in debug, why does the first number show '*'? The problem is happening because of this.

EXCEPTION :  CX_SY_CONVERSION_NO_NUMBER


DATA : sayi1, sayi2 TYPE i.
DATA : sonuc TYPE p LENGTH 3.

BREAK-POINT.
sayi1 = 16.
sayi2 = 19.

sonuc  = sayi1 / sayi2.

WRITE : / sonuc.

Solution

  • You should define every parameter differently in ABAP, you cant do it with like one "type i" :) its not like other languages such as C, C++, Java :)

    So it should be like this:

    DATA : sayi1 type i,
           sayi2 TYPE i.
    DATA : sonuc TYPE p LENGTH 3.
    

    Hope it was helpful

    Talha