<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/try/m-p/1706700#M309420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;TRY statement is used when you expect some error/exception condition but not sure of which type of error may be present in a code block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in that case just wrap the code block in &amp;lt;b&amp;gt;TRY&amp;lt;/b&amp;gt; ..&amp;lt;b&amp;gt;ENDTRY&amp;lt;/b&amp;gt; block&lt;/P&gt;&lt;P&gt;see this sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TRY.&lt;/P&gt;&lt;P&gt;     SORT T_ERGEB-MSG_T_SAP_ACTIVITY-ITEM DESCENDING.&lt;/P&gt;&lt;P&gt;     DELETE ADJACENT DUPLICATES FROM T_ERGEB-MSG_T_SAP_ACTIVITY-ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     CALL METHOD ZCO_SAP_ACTIVITY_TOMX=&amp;gt;EXECUTE_ASYNCHRONOUS&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            OUTPUT = T_ERGEB&lt;/P&gt;&lt;P&gt;            CONTROLLER = L_CONTROLLER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CATCH CX_AI_SYSTEM_FAULT INTO L_SYS_EXCEPTION.&lt;/P&gt;&lt;P&gt;        SY-MSGV1 = L_SYS_EXCEPTION-&amp;gt;ERRORTEXT.&lt;/P&gt;&lt;P&gt;        SUBRC = 1.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;    ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here we are expecting that this code may generate a CX_AI_SYSTEM_FAULT type of exception. to handle this we have written a catch block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error of type CX_AI_SYSTEM_FAULT will be handled by this catch block&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Nov 2006 14:21:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-17T14:21:04Z</dc:date>
    <item>
      <title>Try</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try/m-p/1706697#M309417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please explain about thr Try statement.&lt;/P&gt;&lt;P&gt;give some example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 14:16:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try/m-p/1706697#M309417</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T14:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Try</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try/m-p/1706698#M309418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basic form &lt;/P&gt;&lt;P&gt;TRY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;You catch class-based exceptions in the statement block enclosed by the TRY and ENDTRY statements. To catch these exceptions, you define handlers within the specified TRY block. You introduce a handler using a CATCH statement, followed by the exception classes to be caught and the associated handler code. After the CATCH clauses, you can declare a CLEANUP clause. The statements in the latter clause will be executed if an exception is caught outsidethe TRY block. The structure of the TRY block is as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TRY. 
  ... guarded section 

CATCH cx11 ... cx1n [INTO ex1]. 
  ... handlers for exceptions cx11 to cx1n 

CATCH cx21 ... cx2m [INTO ex2]. 
  ... handlers for exceptions cx21 bis cx2m 
... other handlers 
CLEANUP. 
  ... cleanup block 
ENDTRY. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The TRY block is split into different sections using the CATCH and CLEANUP clauses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 14:18:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try/m-p/1706698#M309418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T14:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Try</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try/m-p/1706699#M309419</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;Please check this thread&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=93818&amp;amp;messageID=2288302" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=93818&amp;amp;messageID=2288302&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It explains many more similar commands also...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 14:18:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try/m-p/1706699#M309419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T14:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Try</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try/m-p/1706700#M309420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;TRY statement is used when you expect some error/exception condition but not sure of which type of error may be present in a code block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in that case just wrap the code block in &amp;lt;b&amp;gt;TRY&amp;lt;/b&amp;gt; ..&amp;lt;b&amp;gt;ENDTRY&amp;lt;/b&amp;gt; block&lt;/P&gt;&lt;P&gt;see this sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TRY.&lt;/P&gt;&lt;P&gt;     SORT T_ERGEB-MSG_T_SAP_ACTIVITY-ITEM DESCENDING.&lt;/P&gt;&lt;P&gt;     DELETE ADJACENT DUPLICATES FROM T_ERGEB-MSG_T_SAP_ACTIVITY-ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     CALL METHOD ZCO_SAP_ACTIVITY_TOMX=&amp;gt;EXECUTE_ASYNCHRONOUS&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            OUTPUT = T_ERGEB&lt;/P&gt;&lt;P&gt;            CONTROLLER = L_CONTROLLER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CATCH CX_AI_SYSTEM_FAULT INTO L_SYS_EXCEPTION.&lt;/P&gt;&lt;P&gt;        SY-MSGV1 = L_SYS_EXCEPTION-&amp;gt;ERRORTEXT.&lt;/P&gt;&lt;P&gt;        SUBRC = 1.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;    ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here we are expecting that this code may generate a CX_AI_SYSTEM_FAULT type of exception. to handle this we have written a catch block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error of type CX_AI_SYSTEM_FAULT will be handled by this catch block&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 14:21:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try/m-p/1706700#M309420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T14:21:04Z</dc:date>
    </item>
  </channel>
</rss>

