<?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: Problem with CATCH CX_SY_CONVERSION_NO_NUMBER in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489153#M1557133</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;You have defined char type, you should always use character literals in comparision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ld_char = '0'.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&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;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Dec 2010 10:41:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-12-06T10:41:23Z</dc:date>
    <item>
      <title>Problem with CATCH CX_SY_CONVERSION_NO_NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489152#M1557132</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 try this simple code and get allways a short dump with CONVT_NO_NUMBER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: WA_CHAR TYPE CHAR128 VALUE 'TEST'.
*
IF WA_CHAR = 0. WRITE: 'is 0'. ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i try it with CATCH and get still the short dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: WA_CHAR TYPE CHAR128 VALUE 'TEST'.
*
TRY.
    IF WA_CHAR = 0. WRITE: 'is 0'. ENDIF.
  CATCH CX_SY_CONVERSION_NO_NUMBER.
    WRITE: / 'ERROR'.
ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone an idea with mistake i do.&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;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 10:30:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489152#M1557132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-06T10:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with CATCH CX_SY_CONVERSION_NO_NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489153#M1557133</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;You have defined char type, you should always use character literals in comparision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ld_char = '0'.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&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;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 10:41:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489153#M1557133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-06T10:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with CATCH CX_SY_CONVERSION_NO_NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489154#M1557134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The way you're doing the conversion implicitely ("IF WA_CHAR = 0"), the exception is not assigned to a class and cannot be caught with TRY / CATCH / ENDTRY.&lt;/P&gt;&lt;P&gt;If you declare a number field and move the content from the character to the number field, then class CX_SY_CONVERSION_NO_NUMBER will be assigned. Compare the headings of the respective short dumps.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 10:42:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489154#M1557134</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2010-12-06T10:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with CATCH CX_SY_CONVERSION_NO_NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489155#M1557135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dieter is wondering why he cannot catch the exception, not how to properly convert between types (which would be too basic and get locked...)&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 10:43:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489155#M1557135</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2010-12-06T10:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with CATCH CX_SY_CONVERSION_NO_NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489156#M1557136</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;     If you want to avoid the dump write as :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF WA_CHAR = '0'.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;WRITE: 'is 0'.&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;Srini.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 10:45:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489156#M1557136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-06T10:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with CATCH CX_SY_CONVERSION_NO_NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489157#M1557137</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;thanks, but i will not avoid it by changing the statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will catch this exception (as Thomas allready says).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 11:06:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489157#M1557137</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-06T11:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with CATCH CX_SY_CONVERSION_NO_NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489158#M1557138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Run the following code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: WA_CHAR TYPE CHAR128 VALUE 'TEST'.
data oref TYPE REF TO cx_root.


TRY.
 RAISE EXCEPTION TYPE cx_sy_conversion_no_number.
    IF WA_CHAR = 0.
    RAISE EXCEPTION TYPE cx_sy_conversion_no_number.
    WRITE: 'is 0'.
    ENDIF.
  CATCH CX_SY_CONVERSION_NO_NUMBER into oref.
    WRITE: / 'ERROR'.
    CATCH cx_root into oref.
    CLEANUP.
    clear wa_char.
ENDTRY.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 12:45:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489158#M1557138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-06T12:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with CATCH CX_SY_CONVERSION_NO_NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489159#M1557139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krupaji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please explain your code for the dummy?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I understand, the first thing you do after TRY .. CATCH block is opened with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TRY&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;RAISE EXCEPTION TYPE cx_sy_conversion_no_number.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will transfer directly to the CATCH block, the lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF WA_CHAR = 0.
    RAISE EXCEPTION TYPE cx_sy_conversion_no_number.
    WRITE: 'is 0'.
    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are never processed. Processing continues with &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CATCH CX_SY_CONVERSION_NO_NUMBER into oref.
    WRITE: / 'ERROR'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;regardsless of WA_CHAR value&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CATCH cx_root into oref.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is not reached from anywhere &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLEANUP.
    clear wa_char.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;will work as designed: Clear WA_CHAR regardsless of value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for the uncatchable exception is in the kernel architecture: If you compare a text value with a numeric dataobject, the text value is converted implicitly to a number allowing all kind of comparisons like GT, GE, EQ, NE, LT, LE.&lt;/P&gt;&lt;P&gt;This implicit conversion can not be caught, even CX_ROOT will not catch it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is also new to me: I thought I could catch just everything with CX_ROOT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Dec 2010 10:40:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-catch-cx-sy-conversion-no-number/m-p/7489159#M1557139</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-12-07T10:40:23Z</dc:date>
    </item>
  </channel>
</rss>

