<?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: Exception Handeling Error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224096#M1524189</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lx_root  TYPE REF TO cx_root.

..........

TRY.
   ...........
    CATCH cx_root INTO lx_root.
       RAISE EXCEPTION ......
          CLEANUP.
          ...............
ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See how you go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Sougata.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Aug 2010 11:29:29 GMT</pubDate>
    <dc:creator>Sougata</dc:creator>
    <dc:date>2010-08-31T11:29:29Z</dc:date>
    <item>
      <title>Exception Handeling Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224093#M1524186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have program to convert Form to PDF and then send to Email. There I am using below code for attachment.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*   create attachment (PDF file)
      document-&amp;gt;add_attachment(
          EXPORTING
            i_attachment_type    = 'PDF'
            i_attachment_subject = descr
            i_att_content_hex    = pdf_content ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as my cursor reaches this, this code raises an exception (An exception (CX_DOCUMENT_BCS) occurred&lt;/P&gt;&lt;P&gt;). I already used Try Catch. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    CATCH cx_bcs INTO bcs_exception.
      RAISE EXCEPTION TYPE cx_send_req_bcs
        EXPORTING
          error_type = bcs_exception-&amp;gt;error_type.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this shows Run time error with below details&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What happened?&lt;/P&gt;&lt;P&gt;*The exception 'CX_SEND_REQ_BCS' was raised, but it was not caught anywhere&lt;/P&gt;&lt;P&gt; along the call hierarchy.*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error analysis&lt;/P&gt;&lt;P&gt;    An exception occurred that is explained in detail below.&lt;/P&gt;&lt;P&gt;    The exception, which is assigned to class 'CX_SEND_REQ_BCS', was not caught in&lt;/P&gt;&lt;P&gt;    procedure "EMAIL_SEND_WITH_PDF" "(METHOD)", nor was it propagated by a RAISING&lt;/P&gt;&lt;P&gt;     clause.&lt;/P&gt;&lt;P&gt;    Since the caller of the procedure could not have anticipated that the&lt;/P&gt;&lt;P&gt;    exception would occur, the current program is terminated.&lt;/P&gt;&lt;P&gt;    The reason for the exception is:&lt;/P&gt;&lt;P&gt;    An exception occurred&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;P&gt;Khan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Aug 2010 09:09:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224093#M1524186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-31T09:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Exception Handeling Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224094#M1524187</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;in your code you are catching only exception with type cx_bcs. If you want to also catch an exception with type CX_DOCUMENT_BCS then you have to add additional CATCH statement. For more info check ABAP documentation for statement CATCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Aug 2010 09:35:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224094#M1524187</guid>
      <dc:creator>mvoros</dc:creator>
      <dc:date>2010-08-31T09:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Exception Handeling Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224095#M1524188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to catch an exception with type CX_DOCUMENT_BCS, But same error comes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that I tried like below and it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
      RAISE EXCEPTION TYPE cx_send_req_bcs
        EXPORTING
         ERROR_TYPE = bcs_exception-&amp;gt;error_type.

    CATCH cx_bcs INTO bcs_exception.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I write Raise statement before Catch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please share you comments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Khan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Aug 2010 11:22:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224095#M1524188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-31T11:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Exception Handeling Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224096#M1524189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lx_root  TYPE REF TO cx_root.

..........

TRY.
   ...........
    CATCH cx_root INTO lx_root.
       RAISE EXCEPTION ......
          CLEANUP.
          ...............
ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See how you go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Sougata.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Aug 2010 11:29:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224096#M1524189</guid>
      <dc:creator>Sougata</dc:creator>
      <dc:date>2010-08-31T11:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Exception Handeling Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224097#M1524190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Sep 2010 05:25:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224097#M1524190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-01T05:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Exception Handeling Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224098#M1524191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Khan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CATCH cx_bcs INTO bcs_exception.
      RAISE EXCEPTION TYPE cx_send_req_bcs
        EXPORTING
          error_type = bcs_exception-&amp;gt;error_type.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why have you raised the exception CX_DOCUMENT_BCS ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This exception is already propagated inside the ADD_ATTACHMENT method. (check the implementation of ADD_ATTACHMENT you'll find the &lt;STRONG&gt;RAISE exception type cx_document_bcs&lt;/STRONG&gt; statement)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just need to handle the exception using TRY-CATCH block. No need to raise the exception !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you write this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;RAISE EXCEPTION TYPE cx_send_req_bcs
        EXPORTING
         ERROR_TYPE = bcs_exception-&amp;gt;error_type.
 
    CATCH cx_bcs INTO bcs_exception.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are handling the exception CX_DOCUMENT_BCS with the CATCH statement. Hence you don't get a dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i am clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Sep 2010 09:28:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handeling-error/m-p/7224098#M1524191</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-09-01T09:28:34Z</dc:date>
    </item>
  </channel>
</rss>

