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

Numerics in a string...

Former Member
0 Likes
830

Hi all!

I am looking for a FM to find and identify numerics or alphanumerics contained in a string. I know I can use 'ca'... but I look for a standard FM.

Thanks!

Miguel Angel.

Message was edited by:

Miguelangel Julian

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
804

check FM NUMERIC_CHECK

but why do u want to go for FM where there is an easy way using CA

6 REPLIES 6
Read only

Former Member
0 Likes
805

check FM NUMERIC_CHECK

but why do u want to go for FM where there is an easy way using CA

Read only

0 Likes
804

Hello!

Really what I need is a FM that says me...

String_In: AB12C

Results:

Position1: char

Position2: char

Position3: num

Position4: num

Position5: char

or something like this...

Thanks!

Read only

Former Member
0 Likes
804

Hi,

CONVERSION_EXIT_ALPHA_INPUT

converts any number into a string fill with zeroes, with the number at the extreme right

Example:

input = 123

output = 0000000000000...000000000000123

CONVERSION_EXIT_ALPHA_OUTPUT

converts any number with zeroes right into a simple integer

Example:

input = 00000000000123

output = 123

Reward if helpful.

Regards

Raghavendra.D.S

Read only

Former Member
0 Likes
804

then chandrasekhar gives you the correct fm here only you have to process character by character of a string...

data : text(15) value 'ABC12D',

len type i,

pos type i,

vchar.

compute len = strlen( text ).

do len times.

vchar = text+pos(1).

now use fm numeric_check and pass vchar here in eimport param you get htype.

write : / 'Pos', sy-index ,' is', htype.

pos = pos + 1.

enddo.

regards

shiba dutta

Read only

0 Likes
804

Thanks Shiba!

You are right, but i'm looking for the same functionality you said, but in a standard FM. There is any like this? If no, there is no problem, I will say to my partner I need to create a Z function.

Thanks all!

Read only

Former Member
0 Likes
804

Hi,

Try this,

data: c(10) type c.

c = '15684648ab'.

if c co '0123456789'.

write:/ 'All numeric'.

else.

write:/ 'Not all numeric'.

endif.

Regards,

Padmam.