Application Development and Automation 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: 
Read only

Problem with integers.

Former Member
0 Likes
756

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
709

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

6 REPLIES 6
Read only

athavanraja
Active Contributor
0 Likes
709

whats the dump message?

also tell the declaration of the char field and the interger field

Read only

Former Member
0 Likes
709

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

Read only

Former Member
0 Likes
709

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

Read only

Former Member
0 Likes
709

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.

Read only

Former Member
0 Likes
710

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

Read only

rodrigo_paisante3
Active Contributor
0 Likes
709

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