<?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 Catch an exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-exception/m-p/5723396#M1298567</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;I was getting that error in my program when it call the FM 'ME_PO_CONFIRM':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither &lt;/P&gt;&lt;P&gt;handled locally, nor declared in a RAISING clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to solve that I tried the following TRY-CATCH structure, but what's my surprise that the exception is not catched yet and I get the same error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TRY.
      CALL FUNCTION 'ME_PO_CONFIRM'
        EXPORTING
          document_no = l_pedido
          item        = lt_item
          itemx       = lt_itemx
        IMPORTING
          return      = lt_return.

    CATCH CX_SY_REF_IS_INITIAL INTO lo_cx_ref_is_initial.

    CALL METHOD lo_cx_ref_is_initial-&amp;gt;if_message~get_text
      receiving RESULT = l_pi_fault_data-fault_text.

    RAISE EXCEPTION TYPE ZPI_CX_LO_MT_CONF_ERROR
      EXPORTING standard = l_pi_fault_data.

ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally I catched the CX_ROOT exception and now the it's catched, and the program doesn't produce a dump, but I need to catch CX_SY_REF_IS_INITIAL and not CX_ROOT... what can I do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's the code that I got now, it works butg I need to catch the real exception:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TRY.
      CALL FUNCTION 'ME_PO_CONFIRM'
        EXPORTING
          document_no = l_pedido
          item        = lt_item
          itemx       = lt_itemx
        IMPORTING
          return      = lt_return.

    CATCH CX_ROOT INTO lo_cx_root.

    CALL METHOD lo_cx_root-&amp;gt;if_message~get_text
      receiving RESULT = l_pi_fault_data-fault_text.

    RAISE EXCEPTION TYPE ZPI_CX_LO_MT_CONF_ERROR
      EXPORTING standard = l_pi_fault_data.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Marshal on Jun 9, 2009 4:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Jun 2009 14:01:42 GMT</pubDate>
    <dc:creator>Marcal_Oliveras</dc:creator>
    <dc:date>2009-06-09T14:01:42Z</dc:date>
    <item>
      <title>Catch an exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-exception/m-p/5723396#M1298567</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;I was getting that error in my program when it call the FM 'ME_PO_CONFIRM':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither &lt;/P&gt;&lt;P&gt;handled locally, nor declared in a RAISING clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to solve that I tried the following TRY-CATCH structure, but what's my surprise that the exception is not catched yet and I get the same error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TRY.
      CALL FUNCTION 'ME_PO_CONFIRM'
        EXPORTING
          document_no = l_pedido
          item        = lt_item
          itemx       = lt_itemx
        IMPORTING
          return      = lt_return.

    CATCH CX_SY_REF_IS_INITIAL INTO lo_cx_ref_is_initial.

    CALL METHOD lo_cx_ref_is_initial-&amp;gt;if_message~get_text
      receiving RESULT = l_pi_fault_data-fault_text.

    RAISE EXCEPTION TYPE ZPI_CX_LO_MT_CONF_ERROR
      EXPORTING standard = l_pi_fault_data.

ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally I catched the CX_ROOT exception and now the it's catched, and the program doesn't produce a dump, but I need to catch CX_SY_REF_IS_INITIAL and not CX_ROOT... what can I do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's the code that I got now, it works butg I need to catch the real exception:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TRY.
      CALL FUNCTION 'ME_PO_CONFIRM'
        EXPORTING
          document_no = l_pedido
          item        = lt_item
          itemx       = lt_itemx
        IMPORTING
          return      = lt_return.

    CATCH CX_ROOT INTO lo_cx_root.

    CALL METHOD lo_cx_root-&amp;gt;if_message~get_text
      receiving RESULT = l_pi_fault_data-fault_text.

    RAISE EXCEPTION TYPE ZPI_CX_LO_MT_CONF_ERROR
      EXPORTING standard = l_pi_fault_data.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Marshal on Jun 9, 2009 4:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2009 14:01:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-exception/m-p/5723396#M1298567</guid>
      <dc:creator>Marcal_Oliveras</dc:creator>
      <dc:date>2009-06-09T14:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-exception/m-p/5723397#M1298568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It was a permissions problems with the user&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 13:59:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-exception/m-p/5723397#M1298568</guid>
      <dc:creator>Marcal_Oliveras</dc:creator>
      <dc:date>2009-07-30T13:59:09Z</dc:date>
    </item>
  </channel>
</rss>

