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: 

How to convert number value to string or numberic string to number?

Former Member
0 Kudos

Hi all,

Is there any function module can convert number to string and convert string to number?

Thank you.

1 ACCEPTED SOLUTION

andreas_mann3
Active Contributor
0 Kudos

hi,

you need no fm : use move

and catch eventual system-exception

A.

Message was edited by: Andreas Mann

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

You can directly assign a number to a string.

CONVERT_STRING_TO_INTEGER

is an fm to convert string to integer.

WOSI_CONVERT_STRING_TO_NUM

also does the same.

Former Member
0 Kudos

Hi

use FM CONVERT_STRING_TO_INTEGER

Regards

amole

andreas_mann3
Active Contributor
0 Kudos

hi,

you need no fm : use move

and catch eventual system-exception

A.

Message was edited by: Andreas Mann

Former Member
0 Kudos
number to string

REPORT ZSPELL.
 
TABLES SPELL.
 
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER  VALUE '1234510'.
 
SY-TITLE = 'SPELLING NUMBER'.
 
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
 
WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
 
FORM SPELL_AMOUNT USING PWRBTR PWAERS.
 
  CALL FUNCTION 'SPELL_AMOUNT'
       EXPORTING
            AMOUNT    = PAMOUNT
            CURRENCY  = PWAERS
            FILLER    = SPACE
            LANGUAGE  = 'E'
       IMPORTING
            IN_WORDS  = T_SPELL
       EXCEPTIONS
            NOT_FOUND = 1
            TOO_LARGE = 2
            OTHERS    = 3.
ENDFORM.                               " SPELL_AMOUNT

anversha_s
Active Contributor
0 Kudos

Hi Use this Fm to do that.

CONVERT_STRING_TO_INTEGER

JUST pass string variable to this you will get int valueregards

rgds

anver

Former Member
0 Kudos

Thanks.