Skip to Content
avatar image
Former Member

Using FM to create a RFC ABAP Connection automatically


User input two server names or two IP Addresses of the server, then call function module to create the corresponding RFC Connection.

Is that possible? If the answer is yes, which FM shall I use?


Best Regards,


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Oct 10, 2008 at 03:15 AM

    Hello Stephanie

    You may have a look at fm's SCWB_RFC_CREATE_DEST (RFC-enabled) and RFC_MODIFY_R3_DESTINATION.



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 17, 2011 at 01:44 PM

    You can create a RFC destination using RFC_MODIFY_R3_DESTINATION. Refer FM documentation on how to use it. Hope this helps.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 10, 2008 at 02:59 AM

    Hi Stephanie,

    The question you asked really depends on what call is being made to the servers.

    If testing to see if they are available for connection, check transaction SM59.

    IE. Define a connection to the server via TCP/IP specifying the IP or server name address

    Go into debug mode

    Click on the Test Connection button.

    Presently I am without access to an SAP system so I can not tell you the specific function module.

    Hope this helps.

    David Cooper

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      SAP already has the standard reports which can be used for comparision of objects between different system. You can check the report RSVRSREM for example. This can be used as long as the RFC destination is maintained in the source system. If you don't have one, and you want to always create a new RFC connection, then you can use one of the FM's mentioned by other users and extend to use this program.



  • avatar image
    Former Member
    Oct 10, 2008 at 03:30 AM

    Hi Stephanie,

    go through the bellow sample RFC creation process and some documents

    that will be helpful to you.

    Sending system side(SEND--800)


    Create function module by using Tcode SE37 or SE80

    goto attributes select remote function


    Receiving system side(RECE--000)


    goto Tcode SM59

    here select the R/3 Connections-->click on Create Button

    give RFC Desstination : TESTRFC

    Connection Type : 3 for Connecting two systems

    Description : Some meaningful Description

    Press enter

    give Target system Name : SEND

    Language : EN

    Client : 800

    user Name : sapuser

    Password : xxxxxx

    save this connections & click on test connections(f8)

    & Remote logon(f7)---> it will open a session

    with client 800 that is your sending system

    then only your RFC is correct

    create a report in SE38 Tcode

    data : c1 type i.

    data : itab like mara occurs 0 with header line.

    call function 'ZRFCFM' destination 'TESTRFC' --->Function Module 'ZRFCFM' your just create at Sending system




    Here are the steps.

    SM59 Transaction is used for Connection Establishment with Destination.

    When you establish a connection to a client through a destination, the HTTP connection must first be entered in transaction SM59.

    There are two types of HTTP connection in transaction SM59: Call transaction SM59 to display the different RFC destinations.

    The HTTP connection to the external server (connection type G) and the HTTP connection to the R/3 system (connection type H) are different only in their logon procedures. Their technical settings are the same. To display the technical settings, double-click a connection.

    You can choose from three tabs. Under Technical Settings, you can specify the following:

    E Target Host: The host to which you want to connect.

    Note that if you are using HTTPS as a protocol, you have to specify the full host name (with domain).

    E Service No.: Here, you specify the port. The destination host must of course be configured in such a way that the specified port gunderstandsh the corresponding protocol (HTTP or HTTPS). See Parameterizing the ICM and the ICM Server Cache.

    E Path Prefix: At the time when the connection to this destination is initiated, the system inserts this sub-path before ~request_uri.

    E HTTP Proxy Options: Here, you can configure a proxy for HTTP connections: You can determine the proxy host and service, as well as users and passwords for the HTTP connection.

    The tab page Logon/Security will be different depending on whether you have selected a HTTP connection to an external server (connection type G) or a HTTP connection to an R/3 system (connection type H).

    HTTP Connection to an External Server (Connection Type G)

    Choose the connection you want to use. You can choose from the following logon procedures:

    E No Logon: The server program does not request a user or password.

    E Basic Authentication: The server program requests a user and password. Basic Authentication is a standard HTTP method for authenticating users. When a user logs on to the target system, he or she provides a user ID and password as authentication. This information is then sent in a header variable as a Base 64-encoded string to the server, through the HTTP connection.

    E SSL Client Certificate: If you use client certificates for authentication, the client authentication is performed through the Secure Sockets Layer (SSL) protocol. In this case, you must also select the SSL Client PSE of the SAP Web AS that contains the relevant certificate for the authentication. The target system must handle the issuer of the SAP Web AS client certificate as a trusted system.

    Under Logon/Security, you can also activate SSL to ensure that HTTPS is the protocol used (if you select SSL, make sure that the correct port is entered under Technical Settings). In the security transaction STRUST you can determine which type of SSL client is used. (Getting Started with the Trust Manager, Trust Manager).

    The field Authorization for Destination has been implemented as an additional level of protection. We recommend that you specify a user and password for the RFC destination.

    HTTP Connection to an R/3 System (Connection Type H)

    Here, you can specify more settings for authentication in the target system.

    The settings under Technical Settings and Special Options are the same as for connection type G. Under Logon/Security, the connection type H has additional logon procedures. As with external servers, you can activate and deactivate SSL and specify an authorization.

    Because the target system is an SAP system, you can set the client and language for the logon as well as the user name and password. If you check Current User, you have to specify the password.

    The following authentication procedures are available: Basic Authentication, SAP Standard, and SAP Trusted System, and SSL Client Certificate.

    E HTTP Basic Authentication: Logon with user and password

    E SAP Standard: This procedure uses an RFC logon procedure. The RFC Single Sign-On (SSO) procedure is valid within the one system. The same SAP user (client, language, and user name) is used for logon.

    E SAP Trusted System: Trusted RFC logon to a different SAP system (see Trusted System: Maintaining Trust Relationships Between SAP Systems)).

    E SSL Client Certificate: The SSL protocol enables you to use client certificates for the logon.

    Type G/H (SM59)


    When sending a HTTP request, you can use this parameter to specify the maximum response time for the connection.

    HTTP Setting:

    You can use the HTTP version to specify the protocol version of the HTTP request (HTTP 1.0 or 1.1).


    You can use this option to activate the gzip compression for the request body. This can only be activated in HTTP Version 1.1.

    Compressed Response:

    In the standard setting, the SAP Web Application Server sends the Accept Encoding field as a header field with the value gzip, if the application server can handle this compression. This notifies the partner that the caller can handle gzip decompression, and that the partner can send compressed data. If you want to prevent a compressed response being sent, choose the option No.

    HTTP Cookie:

    You can use this option to control the way received cookies are handled.

    You can specify the following for cookies:

    E Accept them automatically

    E Reject them automatically

    E Accept or reject them in a prompt

    E Use a handler for the event IF_HTTP_CLIENT~EVENTKIND_HANDLE_COOKIE to process the cookies in the program.



    Add comment
    10|10000 characters needed characters exceeded