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: 

Pick up only numeric values from a string.

Former Member
0 Kudos

Hi all,

We have a requirement to pick up only numeric characters from a string which contains both numeric and non-numeric characters.e.g If string contains value 12345abc,we need to pick only 12345.Are there any function modules for this or any methods. Any inputs will be highly appreciated with points.

Thanks and regards

Kiran

1 ACCEPTED SOLUTION

former_member673464
Active Contributor
0 Kudos

hi,

you can move those values to variables which is of data type N.It will move only numeric values.

Regards,

Veeresh

3 REPLIES 3

former_member673464
Active Contributor
0 Kudos

hi,

you can move those values to variables which is of data type N.It will move only numeric values.

Regards,

Veeresh

Former Member
0 Kudos

data: lv_char type c length 20 value '12ab34c5'.
data: lv_num type n length 10.

lv_num = lv_data.

write lv_num.

thats it.

Former Member
0 Kudos

hi,

do this way ..


data: v_char(15) value '12345abcd'.

translate v_char using 'a b c d '.

condense v_char no-gaps.
write : v_char. 

Regards.

Santosh