<?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: Numeric value check in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356338#M7266</link>
    <description>&lt;P&gt;Dear &lt;A href="https://answers.sap.com/users/16611/takashi322.html"&gt;Takashi Watanabe&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I don't think Function Module making mistake, maybe its your import/export parameter. &lt;/P&gt;&lt;P&gt;Let me know you are receiving import parameter?. FM module return parameter(for us its import parameter) if given data is numeric('-200' or 200.00 or 200.0).&lt;/P&gt;&lt;P&gt;Else it will not return value to return parameter. Then we decide that value is not numeric.&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;REPORT ztest_test.&lt;BR /&gt;DATA: lv_output(10) TYPE c,&lt;BR /&gt;lv_input(10) TYPE c.&lt;BR /&gt;*lv_input = '1.000'.&lt;/P&gt;&lt;P&gt;*lv_input = '-1000'.&lt;/P&gt;&lt;P&gt;lv_input = 'abcd'.&lt;BR /&gt;&lt;BR /&gt;CALL FUNCTION 'CATS_NUMERIC_INPUT_CHECK'&lt;BR /&gt;EXPORTING&lt;BR /&gt;input = lv_input&lt;BR /&gt;INTERNAL = 'X'&lt;BR /&gt;IMPORTING&lt;BR /&gt;OUTPUT = lv_output&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;NO_NUMERIC = 1&lt;BR /&gt;OTHERS = 2.&lt;BR /&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;* Implement suitable error handling here&lt;BR /&gt;ENDIF.&lt;BR /&gt;&lt;BR /&gt;WRITE: lv_output.&lt;/P&gt;&lt;P&gt;You can try this code.&lt;/P&gt;&lt;P&gt;1. uncomment lv_input ='1.000' then see output as 1.000&lt;/P&gt;&lt;P&gt;2.uncomment lv_input = '-1000' then see output as 1000-&lt;/P&gt;&lt;P&gt;3 uncomment lv_input = 'abcd' then you will not see any output, since lv_output has no value.&lt;/P&gt;&lt;P&gt;Hope you understand.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sivaraj Sadasivam.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Oct 2016 07:10:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-10-26T07:10:31Z</dc:date>
    <item>
      <title>Numeric value check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356333#M7261</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am using CATS_NUMERIC_INPUT_CHECK to check if the value is numeric or not.&lt;/P&gt;&lt;P&gt;But if I input a value "-"(Negative sign only) the system treats this value as Numeric.We find "." also. &lt;/P&gt;&lt;P&gt;How to solve this without creating original function module?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 02:48:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356333#M7261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-10-26T02:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric value check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356334#M7262</link>
      <description>&lt;P&gt;We want that system treat this value as Error if customer input "-"(Negative sign only) or "."(Period only).&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 02:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356334#M7262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-10-26T02:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric value check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356335#M7263</link>
      <description>&lt;P&gt;Clearly the function module is not fit for purpose. So you'll have to write some custom code.  &lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 05:07:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356335#M7263</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2016-10-26T05:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric value check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356336#M7264</link>
      <description>&lt;P&gt;an easy way to check is:&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;MOVE 'check_value' TO 'numeric variable'.&lt;/P&gt;&lt;P&gt;CATCH CX_SY_CONVERSION_NO_NUMBER.&lt;/P&gt;&lt;P&gt;  MESSAGE ... 'no number'.&lt;/P&gt;&lt;P&gt;ENDTRY. &lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 06:43:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356336#M7264</guid>
      <dc:creator>former_member226519</dc:creator>
      <dc:date>2016-10-26T06:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric value check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356337#M7265</link>
      <description>&lt;P&gt;Hi Takashi,&lt;/P&gt;&lt;P&gt;This may help you.&lt;/P&gt;&lt;P&gt;CONSTANTS: lc_sy_numbers TYPE string VALUE '0123456789'.&lt;BR /&gt; IF iv_string CN lc_sy_numbers.&lt;BR /&gt;  "not numeric&lt;BR /&gt; ELSE.&lt;BR /&gt;  "numeric&lt;BR /&gt; ENDIF.&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;Pramod Kumar Mandal.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 07:01:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356337#M7265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-10-26T07:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric value check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356338#M7266</link>
      <description>&lt;P&gt;Dear &lt;A href="https://answers.sap.com/users/16611/takashi322.html"&gt;Takashi Watanabe&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I don't think Function Module making mistake, maybe its your import/export parameter. &lt;/P&gt;&lt;P&gt;Let me know you are receiving import parameter?. FM module return parameter(for us its import parameter) if given data is numeric('-200' or 200.00 or 200.0).&lt;/P&gt;&lt;P&gt;Else it will not return value to return parameter. Then we decide that value is not numeric.&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;REPORT ztest_test.&lt;BR /&gt;DATA: lv_output(10) TYPE c,&lt;BR /&gt;lv_input(10) TYPE c.&lt;BR /&gt;*lv_input = '1.000'.&lt;/P&gt;&lt;P&gt;*lv_input = '-1000'.&lt;/P&gt;&lt;P&gt;lv_input = 'abcd'.&lt;BR /&gt;&lt;BR /&gt;CALL FUNCTION 'CATS_NUMERIC_INPUT_CHECK'&lt;BR /&gt;EXPORTING&lt;BR /&gt;input = lv_input&lt;BR /&gt;INTERNAL = 'X'&lt;BR /&gt;IMPORTING&lt;BR /&gt;OUTPUT = lv_output&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;NO_NUMERIC = 1&lt;BR /&gt;OTHERS = 2.&lt;BR /&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;* Implement suitable error handling here&lt;BR /&gt;ENDIF.&lt;BR /&gt;&lt;BR /&gt;WRITE: lv_output.&lt;/P&gt;&lt;P&gt;You can try this code.&lt;/P&gt;&lt;P&gt;1. uncomment lv_input ='1.000' then see output as 1.000&lt;/P&gt;&lt;P&gt;2.uncomment lv_input = '-1000' then see output as 1000-&lt;/P&gt;&lt;P&gt;3 uncomment lv_input = 'abcd' then you will not see any output, since lv_output has no value.&lt;/P&gt;&lt;P&gt;Hope you understand.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sivaraj Sadasivam.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 07:10:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356338#M7266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-10-26T07:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric value check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356339#M7267</link>
      <description>&lt;P&gt;Hello Takashi&lt;/P&gt;&lt;P&gt;You could use a small Regex-check?&lt;/P&gt;&lt;P&gt;Something along the lines of :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(lv_text) = '-'.

TRY.

    DATA(lo_matcher) = cl_abap_matcher=&amp;gt;create(
          pattern = `([0-9]*)`
          text    = lv_text ).

    DATA(lv_matches_regex) = lo_matcher-&amp;gt;match( ).

  CATCH cx_sy_matcher INTO DATA(lo_excp).
    DATA(lv_msg) = lo_excp-&amp;gt;get_text( ).
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Oct 2016 08:02:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356339#M7267</guid>
      <dc:creator>NTeunckens</dc:creator>
      <dc:date>2016-10-26T08:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric value check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356340#M7268</link>
      <description>&lt;P&gt;Now this is just getting confusing. "Only"? So now if someone enters "-1" it's OK but "-" is not OK?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 17:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356340#M7268</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2016-10-27T17:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric value check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356341#M7269</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;Jelena.&lt;/P&gt;&lt;P&gt;You are corecct. "-1" it's OK but "-" is not OK.&lt;BR /&gt;We will try to add to code like as Mr.Volker.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 05:15:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356341#M7269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-10-31T05:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric value check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356342#M7270</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dear All&lt;/P&gt;&lt;P&gt;Thank you for many response.&lt;BR /&gt;I understand that SAP have not other function module which match our require.&lt;BR /&gt;So, I will programing like as Mr.Volker.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 05:17:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/numeric-value-check/m-p/356342#M7270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-10-31T05:17:39Z</dc:date>
    </item>
  </channel>
</rss>

