Skip to Content
author's profile photo Former Member
Former Member

How to find a value if it is numeirc or not?

Hi,

How can I find whether a value is numeirc or alpha numeric?

Thanks and regards.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2008 at 05:33 AM

    Use FM NUMERIC_CHECK.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2008 at 05:33 AM

    Hi,

    By seeing the DataElement or Domain u can say that .. numeirc or alpha numeric...

    Raghunath.S

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2008 at 05:50 AM

    hi,

    if ur number is only going to be integer then u can check using the following method.

    DATA ur_value TYPE string.
    
    ur_value = '123a'.
    
    IF ur_value CO '0123456789.'.
      WRITE 'numeric-value'.
    ELSE.
      WRITE 'alpha-numeric'.
    ENDIF.
    

    if ur number can also contain a decimal then use the following.

    DATA ur_value TYPE string.
    
    ur_value = '123.'.
    
    IF ur_value CO '0123456789.'.     "add the decimal point in the string
      WRITE 'numeric-value'.
    ELSE.
      WRITE 'alpha-numeric'.
    ENDIF.
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.