‎2009 Jan 23 12:16 PM
Hi
Kindly let me know which fumction module is used to check if the data is numeric of alpha numeric ?.
Thanks
Akanksha
‎2009 Jan 23 12:23 PM
Hello,
Try this:
IF V_DATA CO '0123456789'.
WRITE: 'NUMERIC'.
ELSEIF V_DATA CO SYABCDE.
WRITE: 'ALPHABETS ONLY'.
ELSE.
WRITE: 'ALPHANUMERIC'.
ENDIF.
As per other posts, you cannot determine if V_DATA contains only alphabets !!!
BR,
Suhas
‎2009 Jan 23 12:19 PM
Hi Akanksha,
simply check..
IF wa_var CO '0123456789'
"numeric
ELSE.
"alphanumeric or char only
ENDIF.
‎2009 Jan 23 12:20 PM
Hi,
If its a field or variable you can use CO..
ex:
variable CO '0123456789'
then its numeric
else not.
regards
vivek
‎2009 Jan 23 12:23 PM
Hello,
Try this:
IF V_DATA CO '0123456789'.
WRITE: 'NUMERIC'.
ELSEIF V_DATA CO SYABCDE.
WRITE: 'ALPHABETS ONLY'.
ELSE.
WRITE: 'ALPHANUMERIC'.
ENDIF.
As per other posts, you cannot determine if V_DATA contains only alphabets !!!
BR,
Suhas
‎2009 Jan 23 1:52 PM
Hi Guys
Thanks a Lot !!!!!!
Now when i ve found out that its alpha numeric , i need to remove the preceeding zero's from the alphanumeric data .
Can u please help me out how can i do it ??
Regards
Akanksha
‎2009 Jan 23 1:54 PM
Try this way:
WHILE p_no CN '123456789 '.
p_no+sy-fdpos(1) = space.
ENDWHILE.
CONDENSE p_no NO-GAPS.
‎2009 Jan 23 2:00 PM
Hi
its not working with CONDENSE .
Can you suggest me something else .
Regards
AKanksha
‎2009 Jan 23 2:02 PM
>
> Now when i ve found out that its alpha numeric
Mark the appropriate rewards for this help.
i need to remove the preceeding zero's from the alphanumeric data .
Search in SCN for this.
‎2009 Jan 23 2:07 PM
DATA: p_no(10) TYPE n VALUE '000012345'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = p_no
IMPORTING
output = p_no.
‎2009 Jan 23 2:59 PM
data: numfld(10) type c value '0000012345'.
shift numfld left deleting leading '0'.
* if you need it back to right justified within the field....
shift numfld right deleting trailing space.
write numfld.
‎2009 Jan 23 2:07 PM
‎2009 Jan 23 2:30 PM
There are options of 6 and 10 points also.
P.S Also please dont cross post.