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

report

Former Member
0 Likes
375

report for converting a character into numeric.

3 REPLIES 3
Read only

Sm1tje
Active Contributor
0 Likes
353

there must be a FM in transaction SE37. Search for * CONVERTCHARNUM* or something like it.

Read only

Former Member
0 Likes
353

hi,

do this way ..

data : v_char(10) value '1000',

v_numc(10) type n.

v_numc = v_char.

write : v_char, v_numc.

If you are looking for some FM then

USE

CALL FUNCTION 'CHAR_NUMC_CONVERSION'

EXPORTING

INPUT = 0

IMPORTING

NUMCSTR = .

or u can use this piece of code also.

DATA: lv_chr(4) type c,

lv_num type p.

CALL FUNCTION 'MOVE_CHAR_TO_NUM'

EXPORTING

CHR = lv_chr

IMPORTING

NUM = lv_num

EXCEPTIONS

CONVT_NO_NUMBER = 1

CONVT_OVERFLOW = 2

OTHERS = 3.

IF SY-SUBRC 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.[/code]

or USE

CONVERT_STRING_TO_INTEGER

or USE THESE FMs

MOVE_CHAR_TO_NUM

C14W_CHAR_NUMBER_CONVERSION

CHAR_NUMC_CONVERSION

plz reward me if useful...

Read only

Former Member
0 Likes
353

Hi

Declare a numeric field and pass the character value. make sure u dont have any special characters.