Show TOC

Background documentationRfcOpenExt Locate this document in the navigation structure

 

Note Note

Better use the call RfcOpenEx.

End of the note.

The following function opens an RFC connection. All parameters are passed as single fields:

Syntax Syntax

  1. RFC_HANDLE  SAP_API   RfcOpenExt(char*	destination,
  2. 	RFC_MODE	mode,
  3. 	char*	hostname,
  4. 	int	sysnr,
  5. 	char*	gateway_host,
  6. 	char*	gateway_service,
  7. 	char*	client,
  8. 	char*	user,
  9. 	char*	password,
  10. 	char*	language,
  11. 	int	trace);
End of the code.

RFC opens the connection using the given options, and returns a handle for the connection established.

The input parameters to this function carry the same information as that sent to RfcOpen, but not packed in structures. Instead, individual fields are sent. At any given time, some of these fields are empty, depending on the value of mode:

  • RFC_MODE_R3ONLY

    The fields hostname, sysnr, gateway_host, and gateway_service have valid information in them.

  • RFC_MODE_CPIC

    Only the fields gateway_host, and gateway_service have valid information in them.

This function is defined in SAPRFC.H.

Return Values:
  • Returns a handle to the RFC connection (RFC_HANDLE) or

  • Returns RFC_HANDLE_NULL

Function Parameters:
  • destination

    name of destination

  • mode

    connection mode (RFC_MODE)

  • hostname

    hostname of target system

  • sysnr

    system number (0-99)

  • gateway_host

    gateway hostname or NULL

  • gateway_service

    gateway service or NULL

  • client

    signon data: client

  • user

    signon data: user

  • password

    signon data: password

  • language

    signon data: language

  • trace

    If the field trace contains a non-zero value, the outgoing and incoming RFC data are written to a trace file dev_rfc in the current directory. A trace file is also written on the target system. On SAP systems, you can view this file using the utility program RSRFCTRC.

More Information

Note Note

If you call RfcOpenExt with an invalid password, the function does not immediately fail. However, the subsequent call to RfcCallExt (or

RfcCallReceiveExt) will fail.

End of the note.