‎2007 May 02 12:46 PM
Hi,
I am trying to pass a value of 9999999999 from a character field to an integer field but the program goes into dump.Why is it so and how can it be resolved?
Thanks,
Sandeep.
‎2007 May 02 12:57 PM
Please try it using ...declaring that interger as:
data: i(15) type i.
it will work fine.... it is all beacuse integer can hold only eight values by default and for increasing it you have to declare the lenght for it....
Hope that it solves your doubt.
Regards,
Jayant.
Please reward if helpful
‎2007 May 02 12:51 PM
whats the dump message?
also tell the declaration of the char field and the interger field
‎2007 May 02 12:52 PM
Hello Sandeep,
The interger can hold only 8 digits.
If u want to have more than 8 digits then move the value to the Packed numbers.
If useful reward.
Vasanth
‎2007 May 02 12:53 PM
Hi,
The source field must contain a number in mathematical or commercial notation. Exception: A source field that contains only blank characters is interpreted as the number zero. Scientific notation is not allowed, unless it can be interpreted as mathematical notation. Decimal placesare rounded to whole-numbered values. If the number lies within the value range of data types i, b or s, it is converted into the internal representation of an integral number, otherwise a treatable exception is raised. Prior to release 6.10, an exception is also raised when the source field was specified as the text field literal '-2147483648'
The problem I think is user setting ..why dont u use Move
santhosh
‎2007 May 02 12:56 PM
ensure that the character field doesn't contain any sp.characters, for ex: if u run the following program, it goes for a dump as the system can't interpret the value '123,456' as a number.
REPORT z_test1.
data:
w_char(7) type c value '123,456',
w_int type i value 123456789.
w_int = w_char.
write:w_int.
‎2007 May 02 12:57 PM
Please try it using ...declaring that interger as:
data: i(15) type i.
it will work fine.... it is all beacuse integer can hold only eight values by default and for increasing it you have to declare the lenght for it....
Hope that it solves your doubt.
Regards,
Jayant.
Please reward if helpful
‎2007 May 02 12:59 PM
Hi,
see this link:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm
i think that the number you want to convert is higher than the limit of type i
2**31-1 = 4294967295.
regards,
Paisante