07-03-2007 9:29 AM
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
07-03-2007 9:35 AM
check FM NUMERIC_CHECK
but why do u want to go for FM where there is an easy way using CA
07-03-2007 9:35 AM
check FM NUMERIC_CHECK
but why do u want to go for FM where there is an easy way using CA
07-03-2007 9:39 AM
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!
07-03-2007 9:41 AM
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
07-03-2007 9:46 AM
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
07-03-2007 9:52 AM
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!
07-03-2007 9:59 AM
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.