‎2007 Mar 26 5:12 AM
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.
‎2007 Mar 26 5:18 AM
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
‎2007 Mar 26 5:20 AM
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
‎2007 Mar 26 5:20 AM
‎2007 Mar 26 5:24 AM
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