Using the SAS RFC Server in Batch Mode

The SAS RFC Server can perform batch mode processing of RFC calls to the SAP system. Users who submit interactive RFC calls to the SAP system might encounter time-out limitations. This occurs when interactive SAP jobs exceed the default processing time-out limit of 10 minutes.
By allowing batch mode processing of RFC calls to the SAP system, time-out limitations for interactive SAP dialog processes are resolved. Batch mode processing is often used to reduce the use of dialog processes and to reduce the impact of extractions—a SAS program reading the tables and views of the SAP system by means of the SAP LIBNAME engine—on the SAP system. Batch processes usually run at a lower priority. Batch mode processes of RFC calls can also help control the number of simultaneous extractions.
The ABAP program that is normally generated (by another ABAP program) executes a requested read and join operation on one or more database tables. When operating in batch mode, the SAS RFC Server creates and releases an SAP job to execute this ABAP program. The SAS RFC Server then waits for the job that is running the ABAP program to start and to recall the SAS RFC Server. Finally, the resulting data stream (that the SAS RFC Server receives from the SAP system) is passed on to the SAP LIBNAME engine.
LIBNAME or data set option: BATCH | BATCH_MODE | BATCHMODE= 0|1|Y|N
Indicates whether the SAS RFC Server should use SAP batch jobs for the data extracts.
Y
RFC uses batch jobs to extract R/3 data
N
RFC uses dialog processes to extract R/3 data
The default value for this option is N.
To submit batch requests to the SAS RFC Server, you must set up an RFC destination and a variant for the /SAS/Z_SAS_READ ABAP program for each SAS RFC Server instance. Before the SAS RFC Server can execute requests as a batch job, follow these steps.
  1. Create a SAS RFC Server destination. For each SAS RFC Server that accesses an SAP system, a destination must be set up on that SAP system. The program ID and the gateway information defined in the destination are used to register the SAS RFC Server on an SAP gateway. If you use two SAS RFC Servers to read data from one SAP application server, you must set up two RFC destinations on that SAP application server. If you omit gateway information from the SM59 destination, the batch job can run only on the R/3 server that is defined in the SAS LIBNAME statement for the request. If you enter explicit gateway information in the SM59 destination information, the batch job runs on any eligible R/3 server as determined by the SAP site batch configuration. Omitting gateway information is typically used in small SAP configurations such as test, QA, and single-server systems. In production environments, it is preferable to have the jobs run on a server that the SAP batch system allocates.
  2. Create a variant of ABAP program /SAS/Z_SAS_READ. After defining the destination for the SAS RFC Server, you need to make the RFC destination known to the ABAP program by creating a variant for the ABAP program. The concept of variants provides a way of parameterizing ABAP programs. For each defined destination, you must create a variant that references the destination. Variants are client-dependent.
  3. Start the SAS RFC Server with the variant. For more information about using the SAS RFC Server and particularly the sasrfc_server option, see Using the SAS RFC Server on UNIX and Using the SAS RFC Server on Windows.
For more information about the setup of SAS RFC Server destinations and variants, see Installation Instructions—SAS/ACCESS Interface to R3.