[Table of Contents] [Index] [Previous] [Next] Configuring RFC Integration

# Configuring RFC Integration

This chapter describes how to configure your BEA eLink Adapter for R/3 installation for integration with SAP's Remote Function Call (RFC) technology. It includes the following sections:

- Configuring the RFC Inbound Server

Using BEA eLink Adapter for R/3, TUXEDO applications can invoke RFC-enabled ABAP/4 functions on R/3 systems. For more information about RFC integration, see Integrating with RFCs in the BEA eLink Adapter for R/3 User Guide.

Note: You need to complete the tasks in this chapter only if you require application integration with RFC technology.

## Configuring the RFC Inbound Server

This section describes how to configure the RFC Inbound server. It includes the following topics:

- Configuring the Inbound Connection for RFC Inbound

- Setting Environment Variables for RFC Inbound

RFC Inbound is a standard TUXEDO server that is defined in the TUXEDO configuration file.

### Configuring the Inbound Connection for RFC Inbound

You must configure the inbound connection for RFC Inbound, including the sideinfo file and environment variables. For more information, see Configuring Inbound Connections in Configuring R/3 Connections.

### Configuring the UBB File for RFC Inbound

RFC Inbound is a standard TUXEDO server that is defined in the UBB file. You must configure this file to specify the server group, server, environment file, and services associated with the RFC Inbound server. See Sample cr3.ubb File for a listing of the sample UBB file that comes with BEA eLink Adapter for R/3.

#### Defining the Server Group

In the SERVERS section of your UBB file, you must first define the server group (such as CR3) to which RFC Inbound belongs. See TUXEDO Initialization File in Configuring TUXEDO for instructions.

#### Defining the RFC Inbound Server

In the SERVERS section of your UBB file, you must define the RFC Inbound server, specifying its server group, server ID, and environment file using the following syntax:

>     SRVGRP=GroupId SRVID=ServerID
>     CLOPT = " –- -i unique_id -e env_filename"

where:

- GroupID is the unique ID of the server group to which the RFC Inbound server belongs.

- ServerID is the unique ID of the RFC Inbound server.

- -i unique_id is the unique ID that identifies the label section in the environment file containing the adapter's environment variables. You would use this when running multiple eLink adapters (for example, RFC Inbound and ALE Outbound) that share this configuration file. If it is not specified, then the unique ID defaults to the process name.

- -e env_filename is the environment file that specifies the detailed configuration information.

Listing 4-1 shows SERVERS settings for RFC Inbound in a sample UBB file for Windows NT:

> Listing 4-1 Sample SERVERS Settings for RFC Inbound Server

>     ##############################################################
>     *SERVERS
>     ##############################################################
>     cr3rfcin
>               SRVGRP=CR3 SRVID=4
>               CLOPT="-o cr3rfcin.log -- -i cr3rfcin -e cr3.env"

#### Defining the RFC Inbound Service

In the SERVICES section of your UBB file, you must define the CR3_RFC_IN service. Listing 4-2 shows SERVICES settings for RFC Inbound in a sample UBB file for Windows NT:

> Listing 4-2 Sample SERVICES Settings for RFC Inbound Server

>     ##############################################################
>     *SERVICES
>     ##############################################################
>     CR3_RFC_IN

### Setting Environment Variables for RFC Inbound

The RFC Inbound server requires particular environment variables that specify connection information to R/3 and the behavior of the server. These environment variables are defined in an environment file that is specified in the TUXEDO initialization file as the ENVFILE parameter for the server.

BEA eLink Adapter for R/3 provides a semi-configured TUXEDO environment file (cr3rfcin.env) for use with the RFC Inbound server. There should a separate environment file specified in the cr3.ubb configuration for each RFC Inbound server. See Sample cr3.ubb File for more information.

#### Environment Variables

You can configure the following environment variables for the RFC Inbound server:

> Table 4-1 Environment Variables for the RFC Inbound Server

Task / Variable | Value | Description
--- | --- | ---
Adapter Label Section |  |
[SERVER=AdapterID] | Adapter ID | Defines the label section containing the adapter environment variables. The unique AdapterID is the value of the –i flag on the CLOPT line in the UBB file. If not specified, then the default value is the process name. Required.
Connecting to R/3 |  |
`CR3_DESTINATION` | System Name | The destination switch in the sideinfo file that defines the R/3 application server to connect to. Default is undefined. Required.
`CR3_CLIENT` | Client Number | R/3 login client number. Default is undefined. Required.
`CR3_USER` | User | R/3 login user. Default is undefined. The user must be of type CPIC. Required.
`CR3_PASSWORD` | Password | R/3 login user password. Default is undefined. Required.
`CR3_LANGUAGE` | Language | R/3 login language. Default is E for English. Required.
SIDE_INFO | Path and File | Full path to the sideinfo file, which defines the R/3 connection information that is used by the RFC library. If not specified, then the sideinfo file must reside in the same directory as the RFC Inbound executable. Optional.
`CR3_EXIT_R3_CONNECT_LOSS` | Y or N | If set to Y, RFC Inbound exits when it detects that it has lost the RFC connection to R/3. If set to N or unspecified, then RFC Inbound will not exit but instead will try to restore the connection upon the next service call. Optional.
Response Buffer Size |  |
CR3_RESPONSE_BUFFER_SIZE `` | Size (bytes) | Defines the starting size of the FML32 response buffer. If not specified, then the default starting size is 10,000 bytes. Optional.
Defining Callable RFCs |  |
`SERVICE_LIST` | List of services to be advertised | Comma-delimited list containing the names of TUXEDO services that RFC Inbound will advertise. Required.
`[SERVICE=``Service Name``]` | Service name | Service name for each service in the SERVICES_LIST environment variable. Signifies the start of the service configuration definition. Required.
`CR3_RFC_NAME` | RFC Name | Name of the ABAP/4 function to execute when the associated service is invoked. Required.
`CR3_EXPORT_PARAMS` | Export parameters to be returned | Comma-delimited list containing the names of the RFC's export parameters to be returned in the FML32 response buffer. Optional.
`CR3_EXPORT_TABLES` | Export tables to be returned | Comma-delimited list containing the names of the RFC's export tables to be returned in the FML32 response buffer. Optional.
Logging |  |
`CR3_TRACE` | Y or N | If set to Y, then RFC Inbound logs detailed tracing information during processing. If set to N or unspecified, RFC Inbound does not log trace information. Optional.

#### Sample Environment File (cr3rfcin.env)

Listing 4-3 shows the settings for the sample cr3rfcin.env file:

> Listing 4-3 Sample Environment File

>     CR3_DESTINATION=<R/3 System Name>
>     CR3_CLIENT=<R/3 Client ID>
>     CR3_USER=<R/3 User>
>     CR3_PASSWORD=<R/3 Password>
>     CR3_LANGUAGE=E
>     SIDE_INFO=<your eLink app directory>\sideinfo
>     CR3_EXIT_R3_CONNECT_LOSS=N
>     CR3_TRACE=Y
>     SERVICES_LIST=service_1,service_2,service_3
>     [SERVICE=service_1]
>     CR3_RFC_NAME=RFCName1
>     CR3_EXPORT_PARAMS=ExportParam1,ExportParam2
>     CR3_EXPORT_TABLES=ExportTable1
>     [SERVICE=service_2]
>     CR3_RFC_NAME=RFCName2
>     CR3_EXPORT_PARAMS=ExportParam1,ExportParam2
>     CR3_EXPORT_TABLES=ExportTable1
>     [SERVICE=service_3]
>     CR3_RFC_NAME=RFCName3
>     CR3_EXPORT_PARAMS=ExportParam1,ExportParam2
>     CR3_EXPORT_TABLES=ExportTable1

#### Specifying the Adapter Label

You can specify an optional adapter label in the environment file to define a label section containing the adapter's environment variables. You would use this when running multiple eLink adapters (for example, RFC Inbound and ALE Outbound) that share this configuration file. The unique AdapterID corresponds to the value of the –i flag on the CLOPT line in the UBB file. See Defining the RFC Inbound Server for more information.

#### Setting Up the Inbound Connection to R/3

To set up the inbound connection to R/3, you must set environment variables and configure the sideinfo file. See Configuring Inbound Connections in Configuring R/3 Connections for more information.

#### Exiting if the Connection is Lost

You can configure RFC Inbound to exit if it detects a lost connection to R/3 by setting the CR3_EXIT_R3_CONNECT_LOSS environment variable to Y, as shown in the following example:

>     CR3_EXIT_R3_CONNECT_LOSS=Y

If you do not specify this environment variable or if you set it to N, then RFC Inbound will try to restore the connection to R/3 instead upon the next service call.

#### Specifying the Initial Size of the Response Buffer

You can configure the initial size, in bytes, of the response buffer that RFC Inbound allocates for exported parameters by setting the CR3_RESPONSE_BUFFER_SIZE environment variable, as shown in the following example:

CR3_RESPONSE_BUFFER_SIZE=15000

If you do not specify this environment variable, then RFC Inbound sets the initial size of the response buffer to 10,000 bytes. You would increase this to improve performance for RFC calls that return very large volumes of data.

#### Configuring RFCs

To execute an ABAP/4 function on R/3, the calling application prepares an FML32 request buffer that contains the applicable RFC import parameters and import tables. The calling application invokes the TUXEDO service associated with the RFC, passing in the request buffer. RFC Inbound makes the remote function call on R/3, passing the import parameters to R/3. RFC Inbound receives the results and returns them in an FML32 response buffer to the calling application. You configure environment variables to control this process.

For each ABAP/4 function that you want to execute remotely using RFC Inbound, you must specify a label in the environment file that identifies the name of the TUXEDO service associated with this RFC ([SERVICE=ServiceName]). For each service, you must specify the following attributes (in environment variables):

- Name of the RFC to execute when this service is invoked (CR3_RFC_NAME).

- Export parameters, if any, to return in the FML32 response buffer (CR3_EXPORT_PARAMS).

- Export tables, if any, to return in the FML32 response buffer (CR3_EXPORT_TABLES).

In addition, you must specify a list of all services to be advertised to calling applications (SERVICES_LIST). RFC Inbound reads and processes this list, and then advertises the service names, aliasing them to the CR3_RFC_IN service.

##### Defining the List of Services to Advertise

You must specify the list of services (a comma-delimited series) that RFC Inbound advertises in the SERVICES_LIST environment variable, as shown in the following example:

>     SERVICES_LIST=service_1,service_2,service_3

##### Defining Each Advertised Service

For each service specified in the SERVICES_LIST, you must specify a service label and define the name of the RFC to execute as well as the contents of the FML32 response buffer (export parameters and export tables) that you want RFC Inbound to return to the calling application, as shown in the following example:

>     [SERVICE=service_1]
>     CR3_RFC_NAME=RFCName1
>     CR3_EXPORT_PARAMS=ExportParam1,ExportParam2
>     CR3_EXPORT_TABLES=ExportTable1

Note: It is the developer's responsibility to ensure that the names of export parameters and export tables are spelled exactly as they appear in the ABAP/4 function definition.

#### Configuring Trace Output to the RFC Inbound Log

You can configure RFC Inbound to write detailed trace information to the log by setting the CR3_TRACE environment variable to Y, as shown in the following example:

>     CR3_TRACE=Y

If you set this to N or do not specify it, RFC Inbound writes no trace information to the log.

You can redirect stdout by changing the value of the –o flag on the CLOPT line in the UBB file. See Defining the RFC Inbound Server for more information.

[Table of Contents] [Index] [Previous] [Next]