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: 

NUMC to INT

Former Member
0 Kudos
5,325

Hi,

Can anyone tell me how to move a numc to int. I actually encountered a dump when i tried to move a numc of length 20 to integer.

3 REPLIES 3

Former Member
0 Kudos
671

Check out this sample code

l_sn type n length 10,
l_anz_int type i,
l_sn_int type i.

l_sn = '1231240000'.
l_anz_int = 1.

MOVE l_sn to l_sn_int.
l_sn_int = l_sn_int + l_anz_int.
MOVE l_sn_int TO l_sn.

Former Member
0 Kudos
671

See to that it doesnt have any alphabets in the numc.

Regards,

Kiran.

Former Member
0 Kudos
671

The numeric field is interpreted as a number, and transferred to the target field, where it is right-justified, and adopts a plus sign. If the target field is too short, the program may be terminated.

So this might be the reason for your dump...

In your case Integer occupies 4 bytes of data and you are assigning 20 bytes of data... Reduce the length of NUMC field.

<b>sample code:

data:

w_int type i,

w_numc(4) type n.

w_numc = '0100'.

move w_numc to w_int.</b>

Regards,

Pavan.