cancel
Showing results for 
Search instead for 
Did you mean: 

Catching communication error: syn. RFC->XI->Webservice

robert_lippmann
Explorer
0 Kudos

Hi,

I created a synchronous scenario: RFC in R/3 -> XI -> WebService and returning the result. This is working fine, but if the webservice is not available I get a dump in R/3. Understandable, but I am sure the is a way to catch this exception. But how ?

So far I did not create any exceptions in the RFC.

Help is very appreciated.

Regards,

Robert

Accepted Solutions (0)

Answers (6)

Answers (6)

robert_lippmann
Explorer
0 Kudos

Hi,

Solved it myself. I created the fault message type myself and mapped it back to the RFC exceptions.

Robert

robert_lippmann
Explorer
0 Kudos

Hi,

Thanks for the answers. But it is not working, maybe I did not understand the suggestions. The message is sent to XI and to further to the web service with this call, which is used in an ABAP program. The ABAP program dumps when the service is not available and this I need to avoid.

CALL FUNCTION 'YXI_SHOW_GEN_SALESORDER_STATUS'

      DESTINATION gd_xidest
      EXPORTING
        vbeln        = vbeln
      TABLES
        iteminfo     = iteminfo
        serialinfo   = serialinfo
        trackinginfo = trackinginfo.

I am not using BPM so far, and I would like not to use it. The RFC is of course RFC enabled, otherwise it would not work. The CATCH-statement did not work to avoid dumping.

I was thinking a fault message type would be the right approach, but the web service does not provide one.

Robert

Former Member
0 Kudos

Hey

In your RFC you can do like this when calling the service:

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.

regards Ole

Edited by: Ole on Oct 1, 2008 3:31 PM

Former Member
0 Kudos

Can you utlilise a fault message type in the designer to respond back to R/3 and provide a suitable exception response if an error occurs?

Regards,

Pete

former_member183906
Active Contributor
0 Kudos

Check if your RFC is remote enabled.

This will help you.

http://help.sap.com/saphelp_nw04/helpdata/en/f9/3f69fd11a80b4e93a5c9230bafc767/frameset.htm

Send RFC as background process.

Former Member
0 Kudos

Hi

If you are using BPM then by raising the exception in your scenario ,adding the exception branch in it .

Or you can use fault messages for the synchronous scenario.

reffer the blog ;

Regard's

Chetan Ahuja