<?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 Checking if a value is supported for a given type in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-if-a-value-is-supported-for-a-given-type/m-p/7007335#M1496128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a value of Type string. e.g.   2.3&lt;/P&gt;&lt;P&gt;I want to check if this value can be of type p in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea is to move 2.3 to type p and catch an exception if  2.3 or any other value cannot be converted to p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please give me an insight how to implement this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nitish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jun 2010 12:49:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-06-22T12:49:58Z</dc:date>
    <item>
      <title>Checking if a value is supported for a given type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-if-a-value-is-supported-for-a-given-type/m-p/7007335#M1496128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a value of Type string. e.g.   2.3&lt;/P&gt;&lt;P&gt;I want to check if this value can be of type p in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea is to move 2.3 to type p and catch an exception if  2.3 or any other value cannot be converted to p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please give me an insight how to implement this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nitish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jun 2010 12:49:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-if-a-value-is-supported-for-a-given-type/m-p/7007335#M1496128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-22T12:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a value is supported for a given type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-if-a-value-is-supported-for-a-given-type/m-p/7007336#M1496129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this code snippet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETERS: p_string TYPE string.

DATA: v_pack TYPE p DECIMALS 2.

DATA: error_ref TYPE REF TO cx_sy_conversion_no_number,
     err_text TYPE string.

TRY .
    MOVE p_string TO v_pack.
    WRITE v_pack.
  CATCH cx_sy_conversion_no_number INTO error_ref.
    err_text = error_ref-&amp;gt;get_text( ).
    WRITE err_text.
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jun 2010 13:22:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-if-a-value-is-supported-for-a-given-type/m-p/7007336#M1496129</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-06-22T13:22:36Z</dc:date>
    </item>
  </channel>
</rss>

