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

Checking Numeric Variable

If we have a field/variable say Amount,and if user enters wrong input like if he enters alphabet is their any function to check whether entered amount is numeric or not or say what can be done for the validating the field.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 29, 2004 at 05:02 AM

    If the field/variable is of type <b>CURR</b>, system will do a automatic check.

    If you want to have your own check you could try the following (taken from ABAP key word documentation).

    DATA I TYPE I. 
    *** CONVERSION_ERRORS contains CONVT_NO_NUMBER *** 
    CATCH SYSTEM-EXCEPTIONS CONVERSION_ERRORS = 1. 
      MOVE 'abc' TO I.          " <- Error: CONVT_NO_NUMBER 
    ENDCATCH. 
    IF SY-SUBRC = 1. 
      ... 
    ENDIF. 
    
    

    Hope this helps.

    Regards

    Raja

    Since you are new to SDN may i introduce you to the points system at SDN.

    You assign points to the replies that you have found to be useful. It's a way to say "thanks" for the effort in the replies.

    See: /people/mark.finnern/blog/2004/08/10/spread-the-love for directions.

    Click on the Yellow Star icon in each reply.

    You can give:

    1 - 10 pointer (marks it as a solved problem)

    2 - 6 pointers (very helpful)

    Lots of 2 pointers (helpful)

    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.