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

Converting numerical values into integer value

Former Member
0 Likes
1,588

Hi,

My requirement is tp convert numercal value inot interger valuse , since im planing move the data from one internal table which has numerical values into to another internal table which has integer value i need to covert the value

Please help me solve this issue...

Dhanoo.

4 REPLIES 4
Read only

p291102
Active Contributor
0 Likes
1,425

Hi,

DATA v_i TYPE i.

DATA v_c(20) TYPE c VALUE '305'.

v_i = v_c.

v_c = v_i.

Check this FM ALSO.

CONVERT_STRING_TO_INTEGER

Thanks,

Sankar M

Read only

Former Member
0 Likes
1,425

just take it in int type variable..

data : v_int type i,

v_num(5) type n value '13490'.

v_int = v_num.

write : / v_int.

regards

shiba dutta

Read only

p291102
Active Contributor
0 Likes
1,425

Hi,

Check this below blog. your issue will be clear.

Thanks,

Sankar M

Read only

Former Member
0 Likes
1,425

Hi,

This is a simple issue. When u move the data from one data type to another, the data gets automatically converted into the destination wagetype. You needn't worry too much except for the fact that at times there will be some kinda of overflow error. Coz integer cant hold large values. But otherwise u can directly move it by writing a code something like this.


DATA: BEGIN OF IT_INT OCCURS 0,
             AMT TYPE I,
          END OF IT_INT.

DATA: BEGIN OF IT_NUMC OCCURS 0,
             AMT(4) TYPE N,
          END OF IT_NUMC.

CODE FOR POPULATING THE INTEGER ITAB..............

LOOP AT IT_NUMC.
    MOVE CORRESPONDING IT_NUMC TO IT_INT.
    APPEND IT_INT.
ENDLOOP.

Reward points if helpful....

Cheers,

Sam