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

Function to eliminate characters

Former Member
0 Likes
704

Hi:

I wonder if exists a function to eliminate characters that doesn't be numbers. Or do I have to make my own code to eliminate them?

Thanks

Points for helpful answers!!

1 ACCEPTED SOLUTION
Read only

RichHeilman
Product and Topic Expert
Product and Topic Expert
0 Likes
682

Quick fix is to move the value to a type N field. It will get rid of the non-numeric.



report zrich_0001 .

data: str type string.
data: n(20) type n.


str = '12A34B56C78D9'.

n = str.

Regards,

Rich Heilman

4 REPLIES 4
Read only

Former Member
0 Likes
682

code it like this.

if itab-field1 CA '1234567890.'.

regds,

kiran

Read only

0 Likes
682

Or :


if itab-field1 CA sy-abcde.

Erwan

Read only

RichHeilman
Product and Topic Expert
Product and Topic Expert
0 Likes
683

Quick fix is to move the value to a type N field. It will get rid of the non-numeric.



report zrich_0001 .

data: str type string.
data: n(20) type n.


str = '12A34B56C78D9'.

n = str.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
682

Hi Herr,

You have to cook your own logic.

v_len = strlen( v_string ).

do v_len times.

if v_string+sy-index(1) ca sy-abcde.

v_string+sy-index(1) = ''.

endif.

enddo.

REgards,

Ravi