Establishing an RFC Connection from an R/2 System

Direct communication from an R/2 System (IBM or SNI environments) to an SAP gateway is not possible. An RFC connection from R/2 Systems can only be established via a gwhost program which is delivered with the SAP gateway software. This program will connect to the RFC server program via the SAP gateway specified.

How you can configure the gwhost programs depends on the environment (IBM-host or SNI-host).

The RFC syntax in ABAP in R/2 Systems is always the same.

Call from an ABAP program:

CALL FUNCTION "ABC" DESTINATION "RFCEXTERNAL"

IMPORT...
EXPORT...
TABLES...
EXCEPTIONS...

The destination "RFCEXTERNAL" identifies an entry in the RFCD table.

Tables:

Table RFCD

Destination

Client

User

Password

S

Argument in Table XCOM

RFCEXTERNAL

000

TEST

xxxxxxxx

E

RFCEXT

The argument "RFCEXT" identifies an entry in the table XCOM.

Table XCOM

R/2 in an IBM environment (with CICS)

Symbolic destination

Logical Unit (LU)

Transaction Program (TP)

RFCEXT

LU02

GWRFCSRV

LU02 is a four-byte identifier defined in a CICS environment which represents an SNA LU6.2 in CICS. This LU6.2 must be defined in the IBM host and on the external computer with a LU6.2-supported SNA product.

R/2 in an SNI environment

Symbolic destination

Logical Unit (LU)

Transaction Program (TP)

Type

RFCEXT

 

GWRFCSRV

H

Type H must be set for communication in BS2000 via TCP-IP (component 083). Information about the LU is not needed.

GWHOST Configuration

R/2 in an IBM Environment (with CICS)

On the external computer, a "local program" (also called"remotely attachable" or "remotely invokable" program on some SNA products) named GWRFCSRV must be defined in the SNA configuration.

GWRFCSRV is a softlink (on a UNIX platform) or copy (PC platform) of the ‘gwhost’ program which is included in the delivery of an R/3 System.

After GWRFCSRV was started by the installed SNA LU6.2, GWRFCSRV tries to establish a connection to the RFC server program via the SAP gateway. For this purpose, an entry in the sideinfo file must exist for this program:

sideinfo for GWRFCSRV

DEST =

GWRFCSRV

 

GWHOST =

<host name of the SAP gateway,

e.g. hs0311>

GWSERV =

<service name of the SAP gateway,

e.g. sapgw53>

PROTOCOL =

<E (or R): server will be started by (or is already registered at) the SAP gateway>

 

LU =

<host name of the RFC server program,

e.g. hs0311>

TP =

<name of the RFC server program,

e.g. /rfctest/srfcserv>

Because of this complete entry, a corresponding entry in the sideinfo file for the SAP gateway is not required.

This sideinfo file must be in the work directory of the GWRFCSRV program:

R/2 in an SNI Environment

From within an R/2 System, an RFC connection will not be established via the SAP gateway running on BS2000. It must first connect to a ‘gwhost’ program and then work with an RFC server program via another SAP gateway running on any other supported platforms.

This ‘gwhost’ program is always running as a SAPGWHO-task on BS2000 and waits for an RFC request from the R/2 System. The destination defined in the XCOM table as described above will be sent to this program, and it will connect to the RFC server system/program as defined in the sideinfo file.

This ‘gwhost’ program can only provide one RFC connection at a time. Therefore, you have to configure the number of parallel running ‘gwhost’ programs while installing and configuring the SAPGWHO-jobs for working with more than one RFC connection at one time.

sideinfo for ‘gwhost’ programs

DEST =

GWRFCSRV

 

GWHOST =

<host name of the SAP gateway,

e.g. hs0311>

GWSERV =

<service name of the SAP gateway,

e.g. sapgw53>

PROTOCOL =

<E (or R): server will be started by (or is already registered at) the SAP gateway>

 

LU =

<host name of the RFC server program,

e.g. hs0311>

TP =

<name of the RFC server program,

e.g. /rfctest/srfcserv>

Because of this complete entry, a corresponding entry in the sideinfo file for the SAP gateway is not required.

For more details, see the SAP gateway installation guide.

Starting an RFC Server Program

From within an R/2 System (IBM), an RFC server program can only be started by an SAP gateway. See the configurations section of Establishing an RFC Connection from an R/3 System for details on how to start an RFC server program via the SAP gateway.

By using the registering feature of the SAP gateway (from Release 3.0C onwards), RFC server programs can be started before, register at this SAP gateway and then wait for RFC call requests from R/2 Systems (IBM or SNI host) via the gwhost program.

In this case, the entry for this gwhost program in the sideinfo file must have protocol type R instead of E (PROTOCOL=R). See The SAPRFC.INI File for more details.