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

FM to check whether an input is numeric

Hi ,

I am uploading data from a file to an internal table , i want to check whether the value uploaded in a perticular field is numeric or not.

Is there any FM to do it.

Regards

Arun

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Feb 25, 2005 at 10:55 AM

    Hi,

    Why don't you play with ca co ? (contain any, contain only)

    Frédéric

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2005 at 10:58 AM

    Hi Arun,

    may be you can just use

    CHECK field CO '0123456789.,'.

    regards

    Siggi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 25, 2005 at 11:02 AM

    Hi Arun,

    Check the value with system variable SY-ABCDE to find out whether any alphabets are there or not. The system variable Sy-ABCDE contains all alphabets.

    Also check FM NUMERIC_CHECK.

    Thanks

    Lakshman

    Message was edited by: Lakshman Tandra

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 25, 2005 at 11:31 AM

    Hi,

    1)

    data amount type p decimals 2.

    CATCH SYSTEM-EXCEPTIONS conversion_errors = 1.

    MOVE itab-field TO amount.

    ENDCATCH.

    IF sy-subrc EQ 1...

    or

    2) convert-text-to-amount

    regards

    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.