Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Catch an exception

Marcal_Oliveras
Active Contributor
0 Likes
913

Hi,

I was getting that error in my program when it call the FM 'ME_PO_CONFIRM':

An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither

handled locally, nor declared in a RAISING clause

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:


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->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.

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?

That's the code that I got now, it works butg I need to catch the real exception:


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->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.

Edited by: Marshal on Jun 9, 2009 4:02 PM

1 REPLY 1
Read only

Marcal_Oliveras
Active Contributor
0 Likes
487

It was a permissions problems with the user