<?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: difference between catch and raise in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066623#M427656</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RAISE--&amp;gt;For raising the exception/event.&lt;/P&gt;&lt;P&gt;CATCH-&amp;gt;For catching the exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Hakim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Mar 2007 23:56:43 GMT</pubDate>
    <dc:creator>abdul_hakim</dc:creator>
    <dc:date>2007-03-12T23:56:43Z</dc:date>
    <item>
      <title>difference between catch and raise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066619#M427652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt; What is the difference between CATCH and RAISE exeptions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a structure 's_struc' and in that structure i have a table type 't_table'.&lt;/P&gt;&lt;P&gt;Now i have to move fields into that table type from my internal table itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will the following code help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  try.&lt;/P&gt;&lt;P&gt;   s_struc = itab1.&lt;/P&gt;&lt;P&gt;   raise exception type cx_hrpa_invalid_parameter&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;     parameter = l_parameter1&lt;/P&gt;&lt;P&gt;     value = l_value1.&lt;/P&gt;&lt;P&gt;  endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will this code be feasible.&lt;/P&gt;&lt;P&gt;How will the above code behave if i write catch?&lt;/P&gt;&lt;P&gt;pls help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 08:57:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066619#M427652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-12T08:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: difference between catch and raise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066620#M427653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Deepak&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your coding will result a syntax-error and, thus, cannot be executed. Assuming that the table type field within your structure has the name ITAB then you need to code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TRY.
  s_struc-itab = itab1.
...
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not catch the exception within your TRY - ENDTRY block then the system checks whether somewhere "upsteam" there is a CATCH block. If no CATCH block is found then nothing should happen and the flow continues after the ENDTRY statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CATCH statement: event handling of a raised exception&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 09:29:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066620#M427653</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-03-12T09:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: difference between catch and raise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066621#M427654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok Uwe&lt;/P&gt;&lt;P&gt;  i am getting your point.&lt;/P&gt;&lt;P&gt;My requirement is i need to update the fields of internal table into the table type t_table which is in structure t_struc. If any field mismatch then it should throw an exception cx_hrpa_invalid_parameter setting parameter and value attributes to my local variables l_parameter1 and l_value1.&lt;/P&gt;&lt;P&gt;and by your suggestion i modified the code to the following :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;      s_struc-t_table  = itab1.&lt;/P&gt;&lt;P&gt;    CATCH cx_hrpa_invalid_parameter INTO oref&lt;/P&gt;&lt;P&gt;      l_parameter1 = oref-&amp;gt;parameter.&lt;/P&gt;&lt;P&gt;      l_value1 = oref-&amp;gt;value.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is the above code correct?&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 09:44:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066621#M427654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-12T09:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: difference between catch and raise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066622#M427655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Deepak&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on whether your report has the flag &amp;lt;b&amp;gt;"Unicode-enabled"&amp;lt;/b&amp;gt; set or not you will get a different result of the syntax check (SLIN) for statement&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;s_struc-t_table = itab1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;- Unicode-enabled = 'X':&amp;lt;/b&amp;gt; =&amp;gt; syntax error if the structures do not match exactly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;- Unicode-enabled = ' ': &amp;lt;/b&amp;gt;=&amp;gt; perhaps no syntax error but system-exceptions due to type conversion errors possible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the latter case you would use the following statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CATCH SYSTEM-EXCEPTIONS &amp;lt;type conversion error&amp;gt; = 1.

 s_struc-t_table = itab1.
...

ENDCATCH.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, please note that the CATCH SYSTEM-EXCEPTIONS is different from class-based exception handling because this statement does not return any error object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 10:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066622#M427655</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-03-12T10:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: difference between catch and raise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066623#M427656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RAISE--&amp;gt;For raising the exception/event.&lt;/P&gt;&lt;P&gt;CATCH-&amp;gt;For catching the exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Hakim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 23:56:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066623#M427656</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2007-03-12T23:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: difference between catch and raise</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066624#M427657</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;first of all if you use a raise statement in a try-endtry block and dont catch it, there is no point in using this try endtry block.&lt;/P&gt;&lt;P&gt;try -endtry block for used if there are chances of some runtime errors and you use catch statement to deal with those errors(exceptions). If you dont use catch statement then the normal flow of program will continue. and the program will dump if some exception is occured in some statement in try-endtryblock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this explaination helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 10:27:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-catch-and-raise/m-p/2066624#M427657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T10:27:59Z</dc:date>
    </item>
  </channel>
</rss>

