Skip to end of metadata
Go to start of metadata

Related Links:

Description

Courtesy of OLE from the above thread.

This is very useful when calling a Client Proxy.

The SAP help isn't very clear on how to handle system exceptions in an RFC.

I was getting the warning "The exception CX_AI_SYSTEM_FAULT is neither caught nor is declared in the RASING clause of <function>"

when I checked the function in SE37.

DATA: lo_system_ex TYPE REF TO cx_ai_system_fault,
      lo_app_ex TYPE REF TO cx_ai_application_fault,
      l_sys_exc TYPE REF TO cx_ai_system_fault,
      l_app_exc TYPE REF TO cx_ai_application_fault,
      l_exception_msg TYPE string.

TRY.
    CREATE OBJECT l_wsproxy.

    TRY.
        CALL METHOD l_wsproxy->execute_synchronous
          EXPORTING
            output = ****
          IMPORTING
            input  = ****.
      CATCH cx_ai_system_fault INTO l_sys_exc.
      CATCH cx_ai_application_fault INTO l_app_exc.
    ENDTRY.

  CATCH cx_ai_system_fault INTO l_sys_exc.
ENDTRY.
l_exception_msg = l_sys_exc->get_text( ).
WRITE l_exception_msg.
 
  • No labels