08-30-2007 12:36 PM
HI ALL,
CAN U PLZ TELL ME ANY FUNCTION MODULE NAME TO CONVERT STRING TO NUMBER. THANKS IN ADVANCE,
REGARDS,
MAHESH
9321043028
08-30-2007 12:39 PM
Hi..
This is the FM.
CONVERT_STRING_TO_INTEGER
<b>reward if Helpful</b>
08-30-2007 12:43 PM
Hi Mahesh,
I think such kind of facility is not available, coz, string may also contain characters, so converting chracters into numbers is not making any sense, so it may not be possible, if u want any parts of the the string you can go for offset method and can extract the required part.
Regards,
Sujatha
08-30-2007 12:44 PM
Hi Mahesh,
chk this
REPORT ZTEST.
DATA : V_STR TYPE STRING,
V_NUM LIKE CATS_ITS_FIELDS-NUM_VALUE.
V_STR = '2345687813'.
CALL FUNCTION 'CATS_ITS_MAKE_STRING_NUMERICAL'
EXPORTING
INPUT_STRING = V_STR
IMPORTING
VALUE = V_NUM
EXCEPTIONS
NOT_NUMERICAL = 1
OTHERS = 2.
WRITE : V_NUM.
08-30-2007 12:46 PM
Hi Mahesh,
The function module <b>CONVERT_STRING_TO_INTEGER</b> converts string to number. If you have any alphabets in your string then it will return zero, it will convert into number only your string completely contains numbers only.
<b>Friendly Note: </b>You have many open threads. Plz close the threads if they are answered/solved and reward points for helpful answer
Thanks,
Vinay
08-30-2007 12:47 PM
08-30-2007 8:16 PM
Hello Mahesh
If your string should contain only numeric values (without decimals) then you should first check the string using fm <b>NUMERIC_CHECK</b> whether it is indeed a numeric string.
Regards
Uwe