<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Validating Numbers in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784070#M337767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Divide the number by 1 and check if it equal to the same number  and give a try..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;v_var =  v_amount / 1.

if v_var = v_amount.
else.
 *give error message that it is not anumber
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Dec 2006 06:49:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-11T06:49:57Z</dc:date>
    <item>
      <title>Validating Numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784069#M337766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I have to validate a field for numbers. Its an Amount field. I am taking the input in a Character field and then moving it to an amount field in the code. &lt;/P&gt;&lt;P&gt;I have done the validation for entering characters and throwing error message in this case. &lt;/P&gt;&lt;P&gt;How do i do the validation if something like '1..00' is entered or '1.0.2.3.4.' is entered? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quick answers will be rewarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rashmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2006 06:45:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784069#M337766</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-11T06:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784070#M337767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Divide the number by 1 and check if it equal to the same number  and give a try..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;v_var =  v_amount / 1.

if v_var = v_amount.
else.
 *give error message that it is not anumber
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2006 06:49:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784070#M337767</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-11T06:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784071#M337768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data p1(8) type c '1.2.3.4'.&lt;/P&gt;&lt;P&gt;data p2 type p decimal 2.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;p2 = p1.&lt;/P&gt;&lt;P&gt;catch cx_root.&lt;/P&gt;&lt;P&gt;mesage ' Invalid input'.&lt;/P&gt;&lt;P&gt;endtry.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2006 06:54:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784071#M337768</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-11T06:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784072#M337769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rashmi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is one idea:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Take the number into temp variable l_num.&lt;/P&gt;&lt;P&gt;2) use FIND '.' IN l_num MATCH OFFSET off.&lt;/P&gt;&lt;P&gt;3) then using the offset value in 'off' take the remaining string from there oneards.&lt;/P&gt;&lt;P&gt;4) l_num2 = l_num+off.&lt;/P&gt;&lt;P&gt;5) now apply same FIND on l_num2.&lt;/P&gt;&lt;P&gt;6) if another '.' is found then the input was wrong like 1..0 or 1.2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both the condition metioned by u can be validated by this logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vivek Kute.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2006 06:54:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784072#M337769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-11T06:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784073#M337770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rasmi,&lt;/P&gt;&lt;P&gt;you can use CATCH to validate the input...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the following codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA int TYPE i.&lt;/P&gt;&lt;P&gt;  CATCH SYSTEM-EXCEPTIONS conversion_errors = 1.&lt;/P&gt;&lt;P&gt;      MOVE 'abc' TO int.&lt;/P&gt;&lt;P&gt;   ENDCATCH.&lt;/P&gt;&lt;P&gt;   IF sy-subrc = 1.&lt;/P&gt;&lt;P&gt;       MESSAGE i398(00) WITH 'Conversion Error'.&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hendy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2006 06:55:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784073#M337770</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-11T06:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784074#M337771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope the following code will be helpful.&lt;/P&gt;&lt;P&gt;Please do validation in character field only and move to numeric fileds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;   c_numeric       TYPE char69&lt;/P&gt;&lt;P&gt;       VALUE '12345 .67890'.  " Alphanumc Group&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;IF lv_amount CO c_numeric.&lt;/P&gt;&lt;P&gt;  find '.' in lv_amount MATCH LENGTH mlen.&lt;/P&gt;&lt;P&gt;if mlen gT 1.&lt;/P&gt;&lt;P&gt;    Message 'Invalid amount value'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--- define your code here.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt; Message 'Invalid amount value'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bhupal Reddy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Bhupal Reddy Vendidandi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2006 06:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784074#M337771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-11T06:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Validating Numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784075#M337772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;Thanks a lot for your answers. &lt;/P&gt;&lt;P&gt;I am now catching the exception and giving the message. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rashmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2006 08:24:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-numbers/m-p/1784075#M337772</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-11T08:24:49Z</dc:date>
    </item>
  </channel>
</rss>

