2007 Mar 24 10:32 AM
HI,
CAN ANY BODY TELL ME HOW TO CONVERT STRING VALUE IN TO NUMERIC VALUE. WITH ERROR CHECK.
FOR EXP.
IF STRING VALUE LIKE 32145 THEN ITS NUMERIC VALUE = 32145
IF STRING VALUE IS LIKE 3245\ THEN SAY NOT A NUMERIC VALUE BUT NOT GAVE DUMP
THANKS
MUKESH
HI,
CAN ANY BODY TELL ME HOW TO CONVERT STRING VALUE IN TO NUMERIC VALUE. WITH ERROR CHECK.
FOR EXP.
IF STRING VALUE LIKE 32145 THEN ITS NUMERIC VALUE = 32145
IF STRING VALUE IS LIKE 3245\ THEN SAY NOT A NUMERIC VALUE BUT NOT GAVE DUMP
THANKS
MUKESH
2007 Mar 24 10:47 AM
Try this Fm with your inputs .
<b>NUMERIC_CHECK</b>
returns a char data type for values other than numeric
and a numc data type for numeric values.
Regards,
Vijay.
2007 Mar 24 10:56 AM
hi,
Mr. Agrawal..
Try function module CATS_ITS_MAKE_STRING_NUMERICAL
may it will help you.
cheers....................
2007 Mar 24 10:57 AM
2007 Apr 13 1:18 PM
Try this:
&----
*& Form convert-string-to-number (type f, i, p)
&----
FORM convert-string-to-number
USING
value(p_string) TYPE string
CHANGING
p_number TYPE any "-- f, i, p --
p_error TYPE i.
TRY.
CLEAR p_error.
p_number = p_string. "Convert string to number.
CATCH cx_sy_conversion_no_number.
p_error = 1.
CATCH cx_sy_conversion_overflow.
p_error = 2.
ENDTRY.
ENDFORM. "convert-string-to-number
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |