<?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: Try catch implementation in dynamic query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-catch-implementation-in-dynamic-query/m-p/2558889#M583426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The exception is 'CX_SY_DYNAMIC_OSQL_SEMANTICS',&lt;/P&gt;&lt;P&gt;Can I handle this with catch system-exceptions also ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jul 2007 08:39:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-09T08:39:56Z</dc:date>
    <item>
      <title>Try catch implementation in dynamic query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-catch-implementation-in-dynamic-query/m-p/2558887#M583424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am fetching values by dynamic selection  (select a,b,..from (var)...) . &lt;/P&gt;&lt;P&gt;Eveytime if I am selecting garbage value of var it will throw dump . Can u tell me how we implement try catch method / exception handling method so that I can avoid dump in dynamic query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appropriate answer will rewarded with points  that is for sure .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2007 08:31:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-catch-implementation-in-dynamic-query/m-p/2558887#M583424</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-09T08:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Try catch implementation in dynamic query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-catch-implementation-in-dynamic-query/m-p/2558888#M583425</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;Check the dump to find the Exception that is being raised.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is someting that starts with CX_ then use as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;Your code here.&lt;/P&gt;&lt;P&gt;Catch CX_----- (Exception.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is not any exception that starts with CX then some of the runtime exceptions cannot be handled with the help of TRY CATCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CATCH SYSTEM-EXCEPTIONS:&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>Mon, 09 Jul 2007 08:34:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-catch-implementation-in-dynamic-query/m-p/2558888#M583425</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-07-09T08:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Try catch implementation in dynamic query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-catch-implementation-in-dynamic-query/m-p/2558889#M583426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The exception is 'CX_SY_DYNAMIC_OSQL_SEMANTICS',&lt;/P&gt;&lt;P&gt;Can I handle this with catch system-exceptions also ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2007 08:39:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-catch-implementation-in-dynamic-query/m-p/2558889#M583426</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-09T08:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Try catch implementation in dynamic query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-catch-implementation-in-dynamic-query/m-p/2558890#M583427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the usage  of th try statements ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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 =  1 / p_number. 
      WRITE: / 'Result of division:', p_result. 
      p_result = SQRT( p_number ). 
      WRITE: / 'Result of square root:', p_result. 
    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;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;please see this  link for detailed  explaination  of the TRY &amp;amp; ENDTRY  ...&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://"&amp;gt;http://help.sap.com/saphelp_nw04/helpdata/en/a9/b8eef8fe9411d4b2ee0050dadfb92b/content.htm&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward  points if it is usefull......&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2007 08:45:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-catch-implementation-in-dynamic-query/m-p/2558890#M583427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-09T08:45:15Z</dc:date>
    </item>
  </channel>
</rss>

