Application Development 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: 

Is there any function Module available?

Former Member
0 Kudos

Hi,

Could you please tell me whether the function module is available for the scenario below.

If we pass RFC Name to the function module it should return success or failure message for the particular target server maintained in the RFC.

We need to check with the help of RFC we just need to know whether the particular target server is running fine or not?

Please help me in this regard.

Thanks & Regards,

Swathi

8 REPLIES 8

amit_khare
Active Contributor
0 Kudos

Welcome to SCN.

Try RFC_CHECK_DESTINATION

P.S. Use Proper Subject line.

Read rules of engagements.

Search forum before posting the query.

Former Member
0 Kudos

Try below FMs

RFC_CHECK_DESTINATION

RFC_CHECK_DESTINATION_ID

TREX_RFC_CODEPAGE_CONV_CHECK

TREX_RFC_CONNECTION_CHECK

TREX_RFC_CONNECT_CHECK_LOCAL

IWB_SHE_RFCDESTINATION_CHECK

Former Member
0 Kudos

In fact you can try to execute any function module with proper destination and catch exceptions. For this purpose there's an empty function module

CALL FUNCTION 'RFC_PING' DESTINATION l_dest
                  EXCEPTIONS
                    communication_failure = 1  MESSAGE message_ucts
                    system_failure        = 2  MESSAGE message_ucts
                    OTHERS                = 3. "#EC *

you can use it and if you have exception it means that something is wrong with the destination server.

Also FM - RFC_VERIFY_DESTINATION is a good function to do it.

Former Member
0 Kudos

This message was moderated.

0 Kudos

>

> Hi,

> See this Link..

> [http://help.sap.com/saphelp_nw04/helpdata/en/22/042537488911d189490000e829fbbd/content.htm]

> Regards,

> NNR.

Can u tell how this link is going to help when the OP is looking for a specific FM,

Don't post just for the sake of posting.

кu03B1ятu03B9к

Former Member
0 Kudos

Hi Swathi,

Check this function module:

RFC_CHECK_DESTINATION_ID

Hope it helps

Regards

Mansi

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Swathi,

Actually there is a program available that can check an RFC destination (regardsless of what type it is). In fact within transaction SM59, behind the "Connection Test" button this report is runned and the results shown on screen.

I have made a small ABAP objects method to encapsulate this.

This method has an interface and ABAP code:

-->INTERFACE:
import: RFCDEST  TYPE RFCDEST (OPTIONAL) - Destination to test
change: REACHED  TYPE BOOLEAN            - Is destination active?
change: DETAILS  TYPE RFCSI              - RFC system info (see FM RFC_SYSTEM_INFO)

-->ABAP CODE:
METHOD reach_rfc_destination .
* Test RFC destination connection (all types)
*
  DATA:
    loc_rfcsi TYPE rfcsi.

* Answer is unknown at the start of the method
  CLEAR:
    loc_rfcsi,
    reached.                  " In this way it is always set to GC_FALSE

* Only if an RFC Destination is supplied
  IF  rfcdest IS SUPPLIED
  AND rfcdest NE space.

*   Clear memory area before call
*   so no details about previous RFC test calls do exist
    FREE MEMORY ID '%_rfctest'.

*   Remote test call
    SUBMIT rsrfctes
      WITH dest = rfcdest AND RETURN.                    "#EC CI_SUBMIT

*   Collect possible RFC information
    IMPORT rfcsi TO loc_rfcsi FROM MEMORY ID '%_rfctest'.

*   Reached
    IF loc_rfcsi IS INITIAL.
*     Answer is not reached
      reached = gc_false.
    ELSE.
*     Answer is reached
      reached = gc_true.
      details = loc_rfcsi.
    ENDIF.
  ENDIF.

* Housekeeping
  CLEAR:
    loc_rfcsi,
    sy-subrc.

ENDMETHOD.

This will supply you with gc_false (=constant value with space) or with gc_true (=constant value with X).

When gc_true the destination is OK and reachable.

Regards,

Rob.