<?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 TRY......ENDTRY in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440687#M546256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suresh,&lt;/P&gt;&lt;P&gt;both the options mentioned are not possible in my case as i'm using this code in user-exit MV45AFZB to compare the value of xkomv-kbetr with a value from variant variable table (TVARVC-LOW).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any inputs will be highly appreciated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jun 2007 12:59:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-28T12:59:34Z</dc:date>
    <item>
      <title>problem with TRY......ENDTRY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440679#M546248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;REPORT.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  w_char(4) TYPE c VALUE '9,00',&lt;/P&gt;&lt;P&gt;  w_num(4)  TYPE n,&lt;/P&gt;&lt;P&gt;  w_int     TYPE i VALUE 10,&lt;/P&gt;&lt;P&gt;  oref  TYPE REF TO cx_root,&lt;/P&gt;&lt;P&gt;  text  TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;    IF w_int &amp;gt; w_char.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  CATCH cx_sy_conversion_no_number INTO oref.&lt;/P&gt;&lt;P&gt;    text = oref-&amp;gt;get_text( ).&lt;/P&gt;&lt;P&gt;  CATCH cx_root into oref.&lt;/P&gt;&lt;P&gt;   CLEANUP.&lt;/P&gt;&lt;P&gt;    CLEAR w_int.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CATCH SYSTEM-EXCEPTIONS convt_no_number = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  IF w_int &amp;gt; w_char.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*ENDCATCH.&lt;/P&gt;&lt;P&gt;*IF sy-subrc EQ 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; WRITE:w_int.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*ENDIF.&lt;/P&gt;&lt;P&gt;WRITE:/ w_int,&lt;/P&gt;&lt;P&gt;      / text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inspite of catching the exceptions the code goes for a dump, any help will be highly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 11:29:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440679#M546248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T11:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: problem with TRY......ENDTRY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440680#M546249</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;Make the value as '9.00' instead of '9,00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since its a run time exception and the exception raised is not a CLass based exception you are not able to handle it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 11:36:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440680#M546249</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-06-28T11:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: problem with TRY......ENDTRY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440681#M546250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code snippet below works fine however !?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;w_char(4) TYPE c VALUE '9,00',&lt;/P&gt;&lt;P&gt;w_num(4) TYPE n,&lt;/P&gt;&lt;P&gt;w_int TYPE i VALUE 10,&lt;/P&gt;&lt;P&gt;oref TYPE REF TO cx_root,&lt;/P&gt;&lt;P&gt;text TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;w_int = w_char.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CATCH cx_sy_conversion_no_number INTO oref.&lt;/P&gt;&lt;P&gt;text = oref-&amp;gt;get_text( ).&lt;/P&gt;&lt;P&gt;CATCH cx_root into oref.&lt;/P&gt;&lt;P&gt;CLEANUP.&lt;/P&gt;&lt;P&gt;CLEAR w_int.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;WRITE:/ w_int,&lt;/P&gt;&lt;P&gt;      / text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 11:46:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440681#M546250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T11:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with TRY......ENDTRY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440682#M546251</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;Here you are just trying to assign a worng value to the INT type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO this is just giving an error that this assignment is not possible and conversion is not possible and a class based exception is raised and your handled it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where as in the previous case you were trying to check a logical condition, in the case of logical condition before you check the condition one of the operands will be converted to the other's type. So this conversion which was done by Runtime internally was rasining an exception which we cannot handle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your case you are your self trying to CONVERT, in the previous case the SYSTEM is trying to convert it , so the source of exception is different in both the cases so if the source of exception is you it will let you handle it else it has to dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope my explaination is good enough to satisfy you &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 11:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440682#M546251</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-06-28T11:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: problem with TRY......ENDTRY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440683#M546252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Sai, ur explanation is good enough, so can I conclude there is no solution(exception handling) to my problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 12:01:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440683#M546252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T12:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: problem with TRY......ENDTRY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440684#M546253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had  changed  your  logic  .... please  use the  below  one it was  working fine ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  REPORT  ZTSTEWR.
PARAMETERS number TYPE i.
DATA: result TYPE p LENGTH 8 DECIMALS 2,
      oref   TYPE REF TO cx_root,
      text   TYPE string.

TRY.
    IF ABS( number ) &amp;gt; 100.
      RAISE EXCEPTION TYPE cx_demo_abs_too_large.
    ENDIF.
    PERFORM calculation USING    number
                      CHANGING result
                               text.
  CATCH cx_sy_arithmetic_error INTO oref.
    text = oref-&amp;gt;get_text( ).
  CATCH cx_root INTO oref.
    text = oref-&amp;gt;get_text( ).
ENDTRY.

IF NOT text IS INITIAL.
  WRITE / text.
ENDIF.

WRITE: / 'Final result:', result.

FORM calculation USING    p_number LIKE number
                 CHANGING p_result LIKE result
                          p_text   LIKE text
                          RAISING  cx_sy_arithmetic_error.

  DATA l_oref TYPE REF TO cx_root.

  TRY.
      p_result =   p_number.
*      WRITE: / 'Result of division:', p_result.
*      p_result = SQRT( p_number ).
    CATCH cx_sy_zerodivide INTO l_oref.
      p_text = l_oref-&amp;gt;get_text( ).
    CLEANUP.
      CLEAR p_result.
  ENDTRY.

ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward  points  if it is usefull .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 12:17:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440684#M546253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T12:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: problem with TRY......ENDTRY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440685#M546254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Girish,&lt;/P&gt;&lt;P&gt;  I've tried the code below but in vain, I had a good look at the link below &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/a9/b8eef8fe9411d4b2ee0050dadfb92b/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/a9/b8eef8fe9411d4b2ee0050dadfb92b/content.htm&lt;/A&gt;, &lt;/P&gt;&lt;P&gt;tried several options, nothing seem to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  z_test1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  w_char(4) TYPE c VALUE '9,00',&lt;/P&gt;&lt;P&gt;  w_num(4)  TYPE n,&lt;/P&gt;&lt;P&gt;  w_int     TYPE i VALUE 10,&lt;/P&gt;&lt;P&gt;  oref  TYPE REF TO cx_root,&lt;/P&gt;&lt;P&gt;  text  TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;  IF w_int &amp;gt; w_char.&lt;/P&gt;&lt;P&gt;     RAISE EXCEPTION TYPE cx_sy_conversion_no_number.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CATCH cx_sy_conversion_no_number INTO oref.&lt;/P&gt;&lt;P&gt;    text = oref-&amp;gt;get_text( ).&lt;/P&gt;&lt;P&gt;  CATCH cx_root into oref.&lt;/P&gt;&lt;P&gt;   CLEANUP.&lt;/P&gt;&lt;P&gt;    CLEAR w_int.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 12:28:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440685#M546254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T12:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: problem with TRY......ENDTRY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440686#M546255</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;u r comparing a string to a number. so  u might get short dump there. so there r 2 options&lt;/P&gt;&lt;P&gt;         1. declare that no as a numeric[ allws only character strings] and compare&lt;/P&gt;&lt;P&gt;         2. or make that character string as a number and compare to number parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if useful reward some points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;Suresh.A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 12:41:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440686#M546255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T12:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: problem with TRY......ENDTRY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440687#M546256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suresh,&lt;/P&gt;&lt;P&gt;both the options mentioned are not possible in my case as i'm using this code in user-exit MV45AFZB to compare the value of xkomv-kbetr with a value from variant variable table (TVARVC-LOW).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any inputs will be highly appreciated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 12:59:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-try-endtry/m-p/2440687#M546256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T12:59:34Z</dc:date>
    </item>
  </channel>
</rss>

