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

Pick up only numeric values from a string.

Former Member
0 Likes
2,460

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
Read only

former_member673464
Active Contributor
0 Likes
2,033

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
Read only

former_member673464
Active Contributor
0 Likes
2,034

hi,

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

Regards,

Veeresh

Read only

Former Member
0 Likes
2,033

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.

Read only

Former Member
0 Likes
2,033

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