<?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: BCS Exceptions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653071#M1094885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nihi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either you catch the BCS exception within the function module (as shown above) or you forward (THROW) the exception to the calling program. In this case you need to define the exception class as exception of the fm interface.&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>Tue, 28 Oct 2008 10:53:09 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2008-10-28T10:53:09Z</dc:date>
    <item>
      <title>BCS Exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653069#M1094883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;How to catch BCS Exceptions raised by FM in the calling program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried Sy-subrc but unable to do so.&lt;/P&gt;&lt;P&gt;Can anyone sample code for the same&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 07:06:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653069#M1094883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T07:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: BCS Exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653070#M1094884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nihi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA eo_bcs TYPE REF TO cx_bcs.

TRY.
    " write ur code here....
  CATCH cx_bcs INTO eo_bcs.
    " error handling code...
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 10:07:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653070#M1094884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T10:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: BCS Exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653071#M1094885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nihi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either you catch the BCS exception within the function module (as shown above) or you forward (THROW) the exception to the calling program. In this case you need to define the exception class as exception of the fm interface.&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>Tue, 28 Oct 2008 10:53:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653071#M1094885</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-10-28T10:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: BCS Exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653072#M1094886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Uwe and Jose,&lt;/P&gt;&lt;P&gt;I am raising the exception in FM as below. &lt;/P&gt;&lt;P&gt;I am having problem in catching them in the program. &lt;/P&gt;&lt;P&gt;i defined cx_bcs in the FM(Exceptions Tab) too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA eo_bcs TYPE REF TO cx_bcs.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;    " write ur code here....&lt;/P&gt;&lt;P&gt;  CATCH cx_bcs INTO eo_bcs.&lt;/P&gt;&lt;P&gt;  RAISE eo_bcs.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 21:24:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653072#M1094886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T21:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: BCS Exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653073#M1094887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;I am raising the exception from custom FM as below. &lt;/P&gt;&lt;P&gt;i have declared cx_bcd uder exceptions tab too and checked exception classes too..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA eo_bcs TYPE REF TO cx_bcs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;" my process&lt;/P&gt;&lt;P&gt;CATCH cx_bcs INTO eo_bcs.&lt;/P&gt;&lt;P&gt;RAISE eo_bcs.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am calling the FM from my custom program. i am having trouble in coding to catch the exceptions(class-based) raised by the custom FM.&lt;/P&gt;&lt;P&gt;My program is working fine if everythign is alright but getting dump if get any exception from FM.i need to handle those kind of scenarios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does any one help me in this regard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2008 03:58:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653073#M1094887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-29T03:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: BCS Exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653074#M1094888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;One more thing is when i do source extended check i am getting this message..&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The exception CX_BCS is neither caught nor is it declared in the RAISING clause of  "FM_SEND_EMAIL".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what does it indicate! any ideas..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2008 04:05:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653074#M1094888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-29T04:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: BCS Exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653075#M1094889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nihi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You misunderstood the meaning of defining the class-based exception in the fm signature. Have a look at sample report &lt;STRONG&gt;ZUS_SDN_CX_EXCEPTION_RAISE&lt;/STRONG&gt; which demonstrates how to throw and catch class-based exceptions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Custom function module with class-based exception in its signature:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION zus_sdn_cx_exception_raise.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(ID_FLAG) TYPE  BOOLE_D DEFAULT SPACE
*"  RAISING
*"      CX_BCS   " &amp;lt;&amp;lt;&amp;lt; Flag  'Exceptn. Class' checked
*"----------------------------------------------------------------------


  IF ( id_flag = 'X' ).
    " Simulate exception raised by class cl_bcs
    RAISE EXCEPTION TYPE cx_send_req_bcs
      EXPORTING
        error_type = cx_send_req_bcs=&amp;gt;allready_released.
  ENDIF.

  " NOTE: Here we do not catch the exception but throw it,
  "       i.e. the class-based exception is defined at the
  " fm signature which causes the exception to be propagated
  " to the caller.


ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is the sample report:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZUS_SDN_CX_EXCEPTION_RAISE
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Thread: BCS Exceptions
*&amp;amp; &amp;lt;a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1104287"&amp;gt;&amp;lt;/a&amp;gt;
*&amp;amp;---------------------------------------------------------------------*

REPORT  zus_sdn_cx_exception_raise.


DATA: go_error    TYPE REF TO cx_bcs.

PARAMETERS:
  p_flag  TYPE boole_d  DEFAULT ' '.



START-OF-SELECTION.

BREAK-POINT.

  TRY.
      CALL FUNCTION 'ZUS_SDN_CX_EXCEPTION_RAISE'
        EXPORTING
          id_flag = p_flag.

    CATCH cx_bcs INTO go_error.
      MESSAGE 'Exception Raised -&amp;gt; Thrown -&amp;gt; Caught' TYPE 'I'.
      LEAVE PROGRAM.
  ENDTRY.

  MESSAGE 'No exception raised' TYPE 'S'.

END-OF-SELECTION.
&lt;/CODE&gt;&lt;/PRE&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>Wed, 29 Oct 2008 04:33:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653075#M1094889</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-10-29T04:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: BCS Exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653076#M1094890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;God Bless Uwi..&lt;/P&gt;&lt;P&gt;Learnt lesson and resolved my long standing issue. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2008 05:58:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-exceptions/m-p/4653076#M1094890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-29T05:58:07Z</dc:date>
    </item>
  </channel>
</rss>

