cancel
Showing results for 
Search instead for 
Did you mean: 

How to catch system exception in ABAP proxy code when remote PI system is down?

gopalkrishna_baliga
Participant
0 Kudos

Hi Experts,

  I have a scenario where SAP R/3 system calls PI via ABAP Proxy. This is a Async communication.

  SAP R/3 -------->(ABAP Proxy) PI (JMS)-------> Biztalk.

  Now I want to trigger email from SAP R/3 code when PI system is down or RFC destination for PI is down.

  In my ABAP proxy code (in SAP R/3 system) I have used try-catch block and caught system exception. But this exception is never caught.

  How to change the code to handle the exception? Is there any other alternative way to handle my case?

* Set the Queue
     TRY.
         v_o_async_mess ?= v_o_proxy->get_protocol( if_wsprotocol=>async_messaging ).
         v_o_async_mess->set_serialization_context( c_queue_id ).

* Call the proxy method
         CALL METHOD v_o_proxy->pi_proxy_method
           EXPORTING
             output = x_prxy.
*Commit the transaction
         CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
             wait = c_x.

       CATCH cx_ai_system_fault INTO v_o_fault.
         v_err_msg = v_o_fault->get_text( ).

       CATCH cx_ai_application_fault INTO v_o_app_fault.
         v_err_msg = v_o_app_fault->get_text( ).


  ENDTRY.

Thanks

Gopal

Accepted Solutions (0)

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

IMO, you cannot catch system exceptions. You can catch application exceptions as fault message. YOu can use ccbpm to get both system and application acknowledgements. But in your case proxy cannot be used in ccbpm. Hope that helps.