cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Avoid dump in RFC

Former Member
0 Likes
2,759

Hi!

I have a RFC but sometimes i have a dump because connection problems.

How can avoid this dump? I need to use TRY CATCH statment, but has any way to get a generic exception?

Thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member

Hallo,

as you can see here http://help.sap.com/saphelp_nw74/helpdata/en/48/99b3f3ee2b73e7e10000000a42189b/content.htm, you can use the standard exception SYSTEM_FAILURE and COMMUNICATION_FAILURE to avoid RFC dump:

CALL FUNCTION 'Z_TEST'

   DESTINATION 'AAAAAAA'

   EXCEPTIONS

     system_failure        = 1

     communication_failure = 2

     OTHERS                = 3.

IF sy-subrc <> 0.

   WRITE 'Error'.

ENDIF.

Marco

ThangaPrakash
Active Contributor
0 Likes

Hello Rodrigo,

Try to use the below concept used inside the function module "BW_RFCDEST_GET".

* RFC-Dest. check

*... Try a RFC-ping to check the RFC-destination

     CALL FUNCTION 'RFC_PING' DESTINATION l_rfcdest

       EXCEPTIONS

         system_failure        = MESSAGE l_rfc_mess

         communication_failure = MESSAGE l_rfc_mess

         OTHERS                = 3.

* no access to BW

     IF sy-subrc <> 0.

       IF l_rfc_mess IS INITIAL.

         MESSAGE e628 RAISING rfc_ping_failed.

       ELSE.

         MESSAGE e629 WITH l_rfc_mess RAISING rfc_ping_failed.

       ENDIF.

     ENDIF.


Regards,

Thanga

RaymondGiuseppi
Active Contributor
0 Likes

Using a sharp solution like CATCH CX_ROOT ?

Regards,

Raymond

Former Member

How?

I tried this:

TRY.

CALL FUNCTION 'ZMYRFC' DESTINATION 'ABC'.

CATCH CX_ROOT.

WRITE 'ERROR IN RFC'.

ENDTRY.

But dump occurs.