211 6 1MB
English Pages 116 Year 2005
SAS/ACCESS 4.1 Interface to R/3 ®
User’s Guide
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2005. SAS/ACCESS ® 4.1 Interface to R/3: User’s Guide. Cary, NC: SAS Institute Inc. SAS/ACCESS® 4.1 Interface to R/3: User’s Guide Copyright © 2005, SAS Institute Inc., Cary, NC, USA ISBN 1-59047-757-X All rights reserved. Produced in the United States of America. For a hard-copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc. For a Web download or e-book: Your use of this publication shall be governed by the terms established by the vendor at the time you acquire this publication. U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of this software and related documentation by the U.S. government is subject to the Agreement with SAS Institute and the restrictions set forth in FAR 52.227–19 Commercial Computer Software-Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. 1st printing, April 2005 SAS Publishing provides a complete selection of books and electronic products to help customers use SAS software to its fullest potential. For more information about our e-books, e-learning products, CDs, and hard-copy books, visit the SAS Publishing Web site at support.sas.com/pubs or call 1-800-727-3228. SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies.
Contents What’s New v Overview v Details v
Chapter 1
4 How to Use This Document
Introduction Audience 1
Chapter 2
1
1
4 Overview
3
Introduction 3 Getting Started with the SAS/ACCESS Interface to R/3 3 Searching R/3 Metadata 5 Exporting R/3 Metadata to SAS/Warehouse Administrator 7
Chapter 3
4 Accessing and Using R/3 Data
11
Introduction 11 Accessing Data Using Direct Access and ODBC 11 Accessing Data Using the SAS/ACCESS Interface to R/3
Chapter 4
4 Using the SAS/ACCESS Interface to R/3
11
15
Introduction 16 Using the Logon Utility 16 Using the Local Setup Utility 22 Using the Datamodel Explorer 25 Using the List of R/3 Tables 47 Using the List of Descriptors 48 Using the Search Metadata Utility 51 Performing Batch Operations 53
Chapter 5
4 Using the RFC Server
57
Overview of the RFC Server 57 ABAP Function Modules and Programs 57 Using the RFC Server on UNIX 58 Using the RFC Server on Windows NT 60 Using the RFC Server in Batch Mode 62 Using the RFC Macros and Macro Variables 63 Using the R/3 BAPI Connector: Logon Window 74
Chapter 6
4 Using the LIBNAME Statement for SAP
77
Overview of the LIBNAME Engine for SAP 77 LIBNAME Statement Syntax for SAP 77 SAP LIBNAME Engine Options 78 SAS LIBNAME Statement Options for the SAP Engine
87
iv
SAS Data Set Options for the SAP Engine Examples 95
Appendix 1
4 Recommended Reading
Recommended Reading
Glossary Index
99 103
97
97
92
v
What’s New
Overview The new features and enhancements for the SAS/ACCESS Interface to R/3 include the following: 3 two new RFC server options that offer enhanced performance and batch compatibility 3 Unicode support for RFC servers 3 a simplified process for creating an RFC server destination for a small SAP configuration
3 a simplified logon process that does not require CPI-C parameters to be used 3 SAP transport files that simplify the installation of the required ABAP function modules and programs 3 an updated RFC server that supports two operation modes for extracting data from your SAP R/3 system 3 a new SAP LIBNAME engine that enables you to access tables and views from SAP R/3 and SAP BW systems through a connection to the SAS RFC server 3 the ability to use the %CALLRFC macro to call RFC-enabled ABAP functions Note: The changes discussed here are from SAS/ACCESS 9.1 Interface to SAP 9.1 and later. 4 For information about new features in the SAS Data Surveyor for SAP, see the What’s New Section in SAS OnlineDoc.
Details 3 The SAS/ACCESS Interface to R/3 is now called SAS/ACCESS 4.1 Interface to R/3. It adds new features to the version of the SAS/ACCESS Interface to R/3 that shipped with SAS 9.1. 3 SAS/ACCESS 4.1 Interface to R/3 has two new server options: The -B option enables you to increase performance by increasing the minimum buffer size for data transfers.
vi What’s New
The -b option enables batch compatibility so that you can process V8 ACCR3 requests using a V9 RFC server. For more information, see “Using the RFC Server.” 3 SAS/ACCESS 4.1 Interface to R/3 can support Unicode and non-Unicode SAP R/3 servers. The Unicode RFC server can be started from Windows only, but it can support Unicode SAP R/3 and SAS on all platforms. For information about starting a Unicode RFC server, see “Using the RFC Server on Windows NT.” 3 Beginning with 4.1, when creating an RFC server destination for a small SAP configuration, you can omit gateway information. For more information, see “Using the RFC Server in Batch Mode.” 3 SAP transport files that you can use to install the ABAP function modules and programs are now included in the SAS/ACCESS Interface to R/3. It is recommended that you import the SAP transport files rather than installing the ABAP function modules and programs manually. For more information about using SAP transport files and installing ABAP function modules and programs, see the Installation Instructions for SAS/ACCESS Interface to R/3. The new RFC server and RFC dialog server no longer use the following ABAP function modules and programs which were previously used:
3 3 3 3
Z_SAS_BATCH_INTERFACE_4 Z_SAS_READ_TABLE_CPIC ZSASRDTB ZSASRDBT
Note: The transport files for the SAS/ACCESS Interface to R/3 require different ABAP function modules and programs than the transport files for the SAS/ACCESS Interface to SAP BW. Ensure that you use the correct files when you install your application. 4 3 In previous versions of the SAS/ACCESS Interface to R/3, the logon utility required that CPI-C parameters be entered when logging on to your R/3 system. Now, the CPI-C parameters are no longer used when you log on to your R/3 system. The logon utility enables you to access the following windows in which you will need to enter your logon parameters: 3 Logon to R/3 window 3 Advanced Parameters window For more information about the logon process, see “Using the Logon Utility” on page 16. 3 The SAS RFC server has been updated. The RFC server command line syntax has been modified for UNIX and Windows NT. For more information, see “Using the RFC Server on UNIX” on page 58 and “Using the RFC Server on Windows NT” on page 60. 3 The new SAP LIBNAME engine is a read-only engine that enables you to access tables and views from SAP R/3 and SAP BW systems. The SAP LIBNAME engine accesses an SAP system through a connection to the SAS RFC server and is part of the SAS solution to access data in an SAP system. The SAP LIBNAME engine supports new features such as load balancing, user validation at logon, more efficient handling of projections, and server-side joins. Directory processing is also supported. Note: Unlike other LIBNAME engines in SAS, these interfaces are read-only and do not support any forms of data set creation, deletion, or modification. 4 For more information about the new SAP LIBNAME engine, see “Overview of the LIBNAME Engine for SAP” on page 77.
What’s New
vii
3 The new CALLRFC procedure, which is used internally by the %CALLRFC macro, enables you to call RFC enabled ABAP functions. The CALLRFC procedure uses the RFC server to communicate with the SAP system.
viii
What’s New
1
CHAPTER
1 How to Use This Document Introduction Audience 1
1
Introduction SAS/ACCESS® 4.1 Interface to R/3: User’s Guide describes the SAS/ACCESS Interface to R/3 from SAP AG. It provides primary support for the SAS/ACCESS 4.1 Interface to R/3.
Audience This document is intended for applications programmers and other users who are comfortable with their own operating environment and are reasonably familiar with either SAS or with R/3. It is assumed that users are completely unfamiliar with using both of the systems together. The glossary provides definitions of terms that might be new to a user who is unfamiliar with either system. This document provides tutorial instruction for a novice user of the SAS/ACCESS Interface to R/3. After you have mastered the tutorial, you can use this document for reference.
2
3
CHAPTER
2 Overview Introduction 3 Getting Started with the SAS/ACCESS Interface to R/3 3 Searching R/3 Metadata 5 Exporting R/3 Metadata to SAS/Warehouse Administrator 7
Introduction This chapter provides a brief introduction to the SAS/ACCESS Interface to R/3. For more detailed information, consult the references that are listed in “Recommended Reading” on page 97 or contact your SAS Support Consultant.
Getting Started with the SAS/ACCESS Interface to R/3 This section provides a brief tutorial on how to use the SAS/ACCESS Interface to R/3. For more detailed information, consult the additional references that are listed in “Recommended Reading” on page 97 or contact your SAS Support Consultant. To get started with the SAS/ACCESS Interface to R/3: 1 Open a SAS session. 2 Enter %r3access in the command line to start the SAS/ACCESS Interface to R/3.
4
Getting Started with the SAS/ACCESS Interface to R/3
4
Chapter 2
Display 2.1 SAS/ACCESS to R/3 Window
3 Double-click the Logon icon to open the Logon to R/3 window. Display 2.2 Logon to R/3 Window
Existing pre-defined profiles are available from the Profile field drop-down list. To use a pre-defined profile: a Select a profile from the Profile field drop-down list. b Click OK to connect to R/3.
Overview
4
Searching R/3 Metadata
5
If there are no pre-defined profiles, you will need to create one. To create a new profile: a Open the Logon to R/3 window as described earlier. b If you want to save the connection information for later use, enter a name for c d e f
the Profile. Enter a three-digit identification number for the R/3 Client. Enter a valid R/3 User ID. Enter the corresponding R/3 Password for the user ID. Click Advanced in the Logon to R/3 window to display the Advanced Parameters window that is shown in Display 2.3.
Display 2.3 Advanced Parameters Window
g From the TCP/IP tab, enter the RFC server name in the Host field. The
h i j k
default is localhost; a fully qualified domain name might not be required, depending on the DNS configuration for the network. Enter an appropriate port number in the Port field. From the RFC tab, enter the host name in the Host field. Click OK to close the Advanced Parameters window and return to the Logon to R/3 window. If you want to use this log on information later, click Save to save the profile information. Click OK to connect to R/3.
Searching R/3 Metadata The SAS/ACCESS Interface to R/3 provides a robust search capability that you can use to search your metadata for specific information. For example, to search for all tables that contain the word “scrap” in their metadata: 1 From SAS, start the SAS/ACCESS Interface to R/3 to display the SAS/ACCESS to
R/3 window that is shown in Display 2.1. 2 Double-click the Search Metadata icon to display the Data Dictionary Search
Facility window.
6
Searching R/3 Metadata
4
Chapter 2
Display 2.4 Data Dictionary Search Facility Window
3 Click inside the text entry field on the Search String tab, and then enter text to search for, such as the word “scrap”. Click Search . A list of tables will display in
the table in the bottom of the Search String tab as shown in Display 2.5. Display 2.5 Data Dictionary Search Facility Window (Searching for ‘scrap’)
4 Double-click one of the tables in the list. The General Attributes for a List of
Tables window displays to give you more detailed information about the selected table as shown in Display 2.6.
Overview
4
Exporting R/3 Metadata to SAS/Warehouse Administrator
7
Display 2.6 General Attributes for a List of Tables Window
5 Click OK to return to the Data Dictionary Search Facility window.
Exporting R/3 Metadata to SAS/Warehouse Administrator The SAS/ACCESS Interface to R/3 enables you to export metadata from R/3 tables to a warehouse environment in SAS/Warehouse Administrator. To export R/3 metadata: 1 From SAS, open the SAS/ACCESS Interface to R/3 to display the SAS/ACCESS to R/3 window that is shown in Display 2.1. 2 Double-click the Datamodel Explorer icon to display the Datamodel Explorer window.
8
Exporting R/3 Metadata to SAS/Warehouse Administrator
4
Chapter 2
Display 2.7 Datamodel Explorer Window
3 For this example, click the plus sign (+) for the application data models topic in
the Datamodel Explorer. Then, click the plus sign (+) beside the Industry Solutions and Industry Solutions Public Sector subtopics. Single-click ISPS_HR IS-PS Human Resources to select this subtopic.
I Export Metadata I SAS/Warehouse Administrator as shown in Display 2.8 to display the SAS/ACCESS to R/3: Export Metadata to SAS/Warehouse Administrator window.
4 From the main menu of the Datamodel Explorer window, select File
Display 2.8 File Menu for the Datamodel Explorer Window
Overview
4
Exporting R/3 Metadata to SAS/Warehouse Administrator
Display 2.9 SAS/ACCESS to R/3: Export Metadata to SAS/Warehouse Administrator Window
5 From the Data Warehouse Environment drop-down list, select a pre-defined
environment from the SAS/ACCESS to R/3 folder. 6 From the Operational Data Group drop-down list, select an operational data
group from the selected data warehouse environment. The Operational Data Group field is disabled until you select a data warehouse environment. 7 Click OK to export the metadata to the selected data warehouse environment in
SAS/Warehouse Administrator.
9
10
11
CHAPTER
3 Accessing and Using R/3 Data Introduction 11 Accessing Data Using Direct Access and ODBC 11 Accessing Data Using the SAS/ACCESS Interface to R/3 Remote Function Call (RFC) Method 12 Extract Management Method 13 Installation and Setup 13 Data Transfer and Use 13
11
Introduction This chapter describes the methods you can use to access R/3 data: direct access and ODBC, which do not require the use of the interface, and the SAS/ACCESS Interface to R/3. The chapter also includes an overview of the Remote Function Call (RFC) and extract management methods.
Accessing Data Using Direct Access and ODBC There are two methods of accessing data that do not require the SAS/ACCESS Interface to R/3: direct access and ODBC.
3 Direct Access This is a form of transparent access that does not require additional programming or intermediate operations. This form of access is possible because the R/3 system is an Open Systems-compliant application. Direct access uses an intermediate SAS/ACCESS product to the specific database, which can be ORACLE, INFORMIX, ADABAS, or DB/2.
3 ODBC (Open Data Base Connectivity) This method allows direct data access in a PC environment by using the SAS/ACCESS Interface to the ODBC product.
Accessing Data Using the SAS/ACCESS Interface to R/3 You can use the SAS/ACCESS Interface to R/3 to access R/3 data by using two different methods: Remote Function Call (RFC) or extract management.
12
Remote Function Call (RFC) Method
4
Chapter 3
3 Remote Function Call The Remote Function Call method is normally used. It offers online access to the R/3 data.
3 Extract Management The extract management method is the original method that has now largely been superseded. It offers off-line access to the R/3 data that can be useful when
3 there is a poor or slow communication link between SAS and R/3 3 a backup file is required 3 there is a lot of data. Note:
Both methods generate a SAS DATA step.
4
Remote Function Call (RFC) Method The Remote Function Call (RFC) is a SAP AG implementation of the Remote Procedure Call. RFC allows access to R/3 from external applications, such as SAS or other R/3 systems. An overview of the Remote Function Call method for accessing data from R/3 is shown in Figure 3.1. Two modules (ABAP Function and ABAP Report, which are provided with the interface) attach to the R/3 system. Communication between the ABAP Function module and the interface itself uses RFC. On the other side, the interface uses TCP/IP to communicate with the RFC Server. For more details about the RFC Server, see Chapter 5, “Using the RFC Server,” on page 57.
Figure 3.1 system
Remote Function Call (RFC) Method of Accessing Data from the R/3
Accessing and Using R/3 Data
4
Extract Management Method
13
In general, the RFC method consists of generating a SAS DATA step to access the R/3 data, and then it uses the DATA step to create either
3 a data set that is a SAS copy of the R/3 data 3 a View that reads the R/3 data each time it is required.
Extract Management Method The extract management method creates an ABAP query that copies the data from R/3 to an external file. It also creates a SAS DATA step that then reads the external file into SAS. After the R/3 data has been exported to SAS, the data can be held either temporarily for discrete analysis or permanently in a SAS data warehouse. The interface generates all of the necessary programs for both ABAP and SAS (based on the R/3 data dictionary tables). The extract management method to access R/3 data is discussed in the following sections: Installation and Setup; Data Transfer and Use.
Installation and Setup 1 Generate an ABAP report.
Use the descriptor file to create an ABAP report and write it to a text file. The ABAP report is used later to copy the R/3 data to an external intermediate data file. 2 Generate a DATA step. Generate a SAS DATA step to read the intermediate data file. 3 Install the ABAP report in R/3.
This step is independent of the SAS/ACCESS Interface to R/3 and SAS and can be performed simultaneously with Step 2. 4 Install the ABAP text file from Step 1 into R/3.
Data Transfer and Use Note: After installation and setup, you can perform the following steps as many times as required. 4 1 Run the ABAP report in R/3.
Run the installed ABAP report on R/3. This creates the external intermediate data file. 2 Use the DATA step. Use the DATA step to read in or copy the external intermediate data file into SAS. Note: Depending on your situation, it might be possible to simplify or streamline the outlined process. For example, in UNIX a named pipe or other external file can enable ABAP to write data to the external intermediate data file so that SAS can read it simultaneously.
4
14
15
CHAPTER
4 Using the SAS/ACCESS Interface to R/3 Introduction 16 Using the Logon Utility 16 Logon to R/3 Window 16 Logon to R/3 File Menu 18 Logon to R/3 Connections Menu 19 Advanced Parameters Window 19 General Tab 20 TCP/IP Tab 20 RFC Tab 21 Sideinfo File 22 Using the Local Setup Utility 22 Application Setup Window 22 Defaults Tab 23 Data Dictionary Tab 24 Miscellaneous Tab 24 Using the Datamodel Explorer 25 Datamodel Explorer Window 25 Sub Data Models Tab 26 All Entity Types Tab 27 Assigned Tables Tab 28 Attributes Tab 28 Datamodel Explorer Window Menus 29 File Menu 30 View Menu 31 Tools Menu 32 Connections Menu 32 List of Connections Window 33 General Tab 34 RFC Tab 34 TCP/IP Tab 34 More RFC Tab 35 General Attributes for a List of Tables Window Enter Dataset Name Window 39 Enter Catalog Entry Name Window 39 Create Extract Programs Window 40 Attributes for a Table (Edit) Window 42 General Attributes Tab 43 Fields Tab 44 Where Tab 44 Related Tables Tab 44 Select Fields for a Table Window 45
35
16
Introduction
4
Chapter 4
ABAP Where Expression Builder Window 46 Using the List of R/3 Tables 47 List of R/3 Tables Window 47 Using the List of Descriptors 48 List of R/3 Descriptors Window 48 Export Metadata Window 48 Export Metadata to SAS/Warehouse Administrator Window Using the Search Metadata Utility 51 Data Dictionary Search Facility Window 51 Search String Tab 52 Options Tab 52 Performing Batch Operations 53 Source Parameter 54 Passwords 54
49
Introduction The SAS/ACCESS Interface to R/3 is an interactive application that supports data extraction from the R/3 data tables and stores this data in SAS data sets. It simplifies the process of issuing ABAP queries and executing the SAS DATA step for reading the R/3 tables. This chapter outlines the pull-down menus and various windows in the SAS/ACCESS Interface to R/3. Several tasks are included with the window that is most closely associated with that task.
Using the Logon Utility The logon utility is used to connect to the R/3 system. You can save connection settings in profiles and then reuse them at a later time.
Logon to R/3 Window To open the Logon window: 1 Go to the SAS desktop, and open the SAS/ACCESS to R/3 desktop.
Using the SAS/ACCESS Interface to R/3
4
Logon to R/3 Window
17
Display 4.1 SAS/ACCESS to R/3 Desktop
2 Double-click the Logon icon to open the Logon to R/3 window. Display 4.2 Logon to R/3 Window
The Logon to R/3 window has multiple elements that you must specify in order to log on successfully. The following fields are contained in the Logon to R/3 window: Profile
displays the text label that you assign to the profile that is defined in this window and the Advanced Parameters window.
Client
displays the R/3 client identification number. The client ID must be three numeric characters with zeros as filler. For example, 10 will fail but 010 will work.
User ID
displays the R/3 user ID.
18
Logon to R/3 Window
4
Chapter 4
Password
displays the R/3 system password.
Language
determines the human language in which to display the R/3 data. For example, entering the letter E in this field sets the language as English, entering D sets the language as German, and so forth. The text and help screens will display in the chosen language as long as the language support is installed.
The Logon to R/3 window contains the following buttons: OK
logs on to the R/3 system by using the user-supplied information in the fields.
Cancel
closes the Logon to R/3 window without attempting to log on to R/3.
Save
saves the user-specified information from the fields of the Logon to R/3 window in the profile.
Advanced
displays the Advanced Parameters window, which is described in “Advanced Parameters Window” on page 19.
Help
displays the SAS Help for the Logon to R/3 window.
Logon to R/3 File Menu Opening the Logon to R/3 window changes the File menu on the main SAS window and adds a Connections menu. The File menu commands are described as follows: Display 4.3 File Menu of the Logon to R/3 Window
New
clears the fields in the Logon to R/3 window.
Save
saves the user-specified information from the fields of the Logon to R/3 window in the profile.
Save As
displays the Save As window. This window allows you to enter a libref name in which to save the profile.
Using the SAS/ACCESS Interface to R/3
Display 4.4
4
Advanced Parameters Window
19
Save As Window
Delete
deletes the profile that is shown in the Logon to R/3 window.
Import Data
displays the SAS Import Wizard.
Export Data
displays the SAS Export Wizard.
Send Mail
Opens the standard SAS mail window to let you distribute electronic mail from SAS.
Close
closes the Logon to R/3 window and returns you to the SAS/ACCESS to R/3 desktop.
Exit
ends the SAS session and closes all open SAS applications.
Logon to R/3 Connections Menu Opening the Logon to R/3 window also adds the Connections menu. Display 4.5 Connections Menu of the Logon to R/3 Window
The Connections menu contains the following selections: Logon to R/3
logs on to R/3 by using the user-supplied information in the fields.
List Connections
displays the List of Connections window that is shown in Display 4.21 on page 33.
Logoff
disconnects the current logon from R/3.
Advanced Parameters Window The Advanced Parameters window contains three tabs that are used for defining additional R/3 connection information. While all required fields have default values, not
20
Advanced Parameters Window
4
Chapter 4
all of the fields display their default values. This section presents the three tabs and an explanation of their parameters. Click Advanced in the Logon to R/3 window to display the Advanced Parameters window. The Advanced Parameters window contains three tabs: General, TCP/IP, and RFC. Display 4.6 Advanced Parameters Window
The Advanced Parameters window contains the following buttons: OK
closes the Advanced Parameters window and returns you to the Logon to R/3 window, saving your entered information.
Cancel
closes the Advanced Parameters window and returns you to the Logon to R/3 window without saving any change that you might have made to the fields in the window.
Help
displays the SAS Help for the Advanced Parameters window.
General Tab When the Advanced Parameters window displays, the General tab is selected by default. The General tab contains general connection information. The following fields are contained in the General tab of the Advanced Parameters window: Connection Id
displays a text name that you assign for the connection ID. The connection ID is used for filerefs and macros in the SAS program to manage the connection to R/3 and to access the R/3 tables. The name must follow standard SAS syntax.
Remote
displays the remote SAS session. In order to read R/3 tables into SAS DATA sets on a remote SAS session, the connection to R/3 has to be established in the remote SAS session.
Description
displays a text description of the connection profile.
TCP/IP Tab The TCP/IP tab contains network address information. To display the TCP/IP tab, select the TCP/IP tab in the Advanced Parameters window.
Using the SAS/ACCESS Interface to R/3
4
Advanced Parameters Window
21
Display 4.7 TCP/IP Tab of the Advanced Parameters Window
The following fields are contained in the TCP/IP tab in the Advanced Parameters window: Host
specifies the network location of the RFC server. The default is localhost, and a fully qualified domain name is not required. For example, if the RFC server can be reached by using the DNS name rfc.example.com and is on the local area network, the Host field will accept either rfc or rfc.example.com. Numeric addresses are also accepted.
Port
specifies the TCP/IP port to use for communicating with the RFC server. The default port number is 6991.
RFC Tab The RFC tab contains information that the RFC server uses to connect to the SAP R/3 application server. To display the RFC tab, select the RFC tab in the Advanced Parameters window. Display 4.8 RFC Tab of the Advanced Parameters Window
22
Using the Local Setup Utility
4
Chapter 4
The following fields are contained in the RFC tab in the Advanced Parameters window: Host
is used to define the R/3 server to which the RFC server connects. This field does not have a pre-defined default value.
Destination
is a logical name that is used by the sideinfo file. Note: If a destination is set here, the other fields on the RFC tab will be ignored, as the sideinfo file will override them. If you are using sideinfo files to communicate with R/3, enter the correct symbolic destination. The sideinfo file is discussed in “Sideinfo File” on page 22.
Gateway Host
is the gateway host that is used by the RFC server to communicate with the R/3 system. This field defaults to Host.
Gateway Service
is the communication gateway service that is used by R/3.
System Number
is the system number that identifies which R/3 system to access if there is more than one R/3 system that resides on the same host. At times, more than one R/3 system will be operating on the same host. For example, a development or testing R/3 system may be operating on the same host hardware as a production R/3 system. In this case, multiple R/3 systems can be accessed separately by using system numbers. The default value for this field is 0 (zero).
Function
is a SAS function to call as part of the R/3 logon process. You can specify the R/3 function module that is used for RFC.
Sideinfo File The sideinfo file is a text file that you can use to set logon parameters for R/3 users, including the RFC host, system number, gateway service, and gateway host. The placing of the sideinfo file is host- and release-dependent. In general, the sideinfo file defaults to the current directory but can be overridden by an environment variable. You should examine the R/3 system documentation for the specific platform and release level for details. If you are using a sideinfo file, you only need to set the Destination field on the RFC tab in the Advanced Parameters window of the Logon to R/3 utility, and enter the information for the other parameters in the sideinfo file.
Using the Local Setup Utility The local setup utility enables you to display the Application Setup window, which you can use to define various application parameters. You can use the local setup utility to specify the default location from which data is extracted and the default location to which data is stored. The utility also defines several other parameters that determine how the SAP data is extracted and where the extracted metadata is stored in SAS.
Application Setup Window The Application Setup window is used to set parameters for logging on and accessing data using the SAS/ACCESS Interface to R/3. To display the Application Setup window:
Using the SAS/ACCESS Interface to R/3
4
Application Setup Window
23
1 From the SAS desktop, open the SAS/ACCESS to R/3 desktop that is shown in
Display 4.1 on page 17. 2 Double-click the Local Setup icon to open the Application Setup window. You can also display the Application Setup window from the Datamodel Explorer. From the pull-down menu, selectTools I Options I ACCESS to R/3 Display 4.9 Application Setup Window
The buttons available on the Application Setup window are OK
closes the window, saving any entered parameters.
Cancel
closes the window without saving any entered parameters.
Reset
resets the parameters on the window to their defaults.
Help
displays the SAS Help for the Application Setup window.
Defaults Tab The Defaults tab presents default settings to generate the views and save the source. The elements available from the Defaults tab are Host
specifies the target machine on which the extracted data will be saved. Select either -LOCAL- or a remote host (if defined). A remote host is the session ID of a running SAS/CONNECT session. -LOCAL- is the default selection.
Descriptor Library
specifies the location on the selected host in which the descriptors are saved. Select the desired library. SASUSER is the default selection.
SAS Data Library
specifies the location on the selected host in which the SAS view or data file is saved. Select the desired library. SASUSER is the default selection.
Source Library
specifies the location on the selected host in which the source is saved. Select the desired library. SASUSER is the default selection.
Type
specifies whether the extracted SAP BW metadata is stored in a SAS view or a SAS data file. Select either View or Data. View is the default selection.
Replace
determines whether to overwrite the existing view or data file when performing a new extraction. Select Yes to overwrite existing views
24
Application Setup Window
4
Chapter 4
or data sets. Select No to leave existing views or data sets untouched. No is the default selection.
Data Dictionary Tab The Data Dictionary tab enables you to enter values that specify where the extract of the R/3 Data Dictionary is located and how to access it. Display 4.10
Data Dictionary Tab of the Application Setup Window
The elements available from the Data Dictionary tab are Access Type
specifies the location of the data dictionary that contains the SAP source data that you want to extract. Select either Local to the Application (default) or Remote to the Application. If the selected access is Local to the Application, then the Remote Host and Local Copy of the SAS Library fields are disabled.
Remote Host
specifies the remote machine that contains the source data that you want to extract if the data dictionary is remote to the application. The remote host is the session ID of a running SAS/CONNECT session. If the data dictionary is local to the application, this field is disabled.
SAS Library
enables you to select the SAS library that identifies the location of the data dictionary. If you are using a local host, this is the same library to which you extract metadata. If you are using a remote host, then you will specify a SAS library that references the location of the metadata on the remote host. R3LIB is the default selection.
Local Copy of the SAS Library
enables you to select the SAS library that identifies the local copy of the data dictionary. If the data dictionary extract resides on a remote host, the (accessed) information can be stored in a local copy for better performance. If the data dictionary is local to the application, this field is disabled.
Miscellaneous Tab The Miscellaneous tab enables you to define a limit for the number of observations to display when showing SAP data in the Datamodel Explorer.
Using the SAS/ACCESS Interface to R/3
Display 4.11
4
Datamodel Explorer Window
25
Miscellaneous Tab of the Application Setup Window
The element available on the Miscellaneous tab is Limit of observations for Show Data
enables you to define the maximum number of observations to display for a data query. The default value is 100.
Using the Datamodel Explorer The Datamodel Explorer window allows a graphic exploration of the data models of the R/3 database, similar to a tree diagram of a directory’s files and subdirectories. The Datamodel Explorer aids you in navigating through the R/3 data model and its many subordinate data models. The Datamodel Explorer window shows a tree diagram of data models in the R/3 database. The R/3 data model is at the top of the tree, and the subordinate data models branch from it. End nodes on the tree diagram are entities. Each entity type can contain one or more tables. By using the Datamodel Explorer, you can find which table is accessed by the SAS/ACCESS Interface to R/3. After a table is identified, you can
3 modify the field selection 3 set a ABAP WHERE clause on that table 3 create SAS views for that table 3 display table information directly in the Datamodel Explorer 3 display additional meta-information about the identified table. This following section describes the windows of the Datamodel Explorer and their uses.
Datamodel Explorer Window To start the Datamodel Explorer, go to the SAS desktop and open the SAS/ACCESS to R/3 desktop that is shown in Display 4.1 on page 17. Double-click the Datamodel Explorer icon to open the Datamodel Explorer window.
26
Datamodel Explorer Window
Display 4.12
4
Chapter 4
Datamodel Explorer Window
The Datamodel Explorer window opens with the collapsed tree diagram in the left half of the window. When you select a data model from the tree diagram, the Sub Data Models tab displays in the right half of the window as shown in Display 4.13 on page 27. To expand the tree diagram, click the plus sign [+] or double-click the corresponding data model name. The data models can also be opened and closed by clicking with the right mouse button on a data model and selecting Expand or Collapse from the pop-up menu.
Sub Data Models Tab The Sub Data Models tab in the right half of the Datamodel Explorer window shows the name and a short description for all sub data models in the data model that was selected in the tree diagram. Selecting a data model in the left half of the Datamodel Explorer window displays the Sub Data Models tab in the right half of the window.
Using the SAS/ACCESS Interface to R/3
Display 4.13
4
Datamodel Explorer Window
27
Sub Data Models Tab of the Datamodel Explorer Window
All Entity Types Tab The All Entity Types tab in the right half of the Datamodel Explorer window displays a table that describes the entity types within the data model that was selected in the tree diagram. For each entity type, the table displays its name and a short text description as follows: Display 4.14
All Entity Types Tab of the Datamodel Explorer Window
28
Datamodel Explorer Window
4
Chapter 4
Assigned Tables Tab To display the Assigned Tables tab, from the All Entity Types tab, double-click any line item. By selecting an entity type and double-clicking it, the Datamodel Explorer searches for the entity type, expands the tree diagram, and scrolls until the selected entity type is visible and then highlights that entity type. The right half of the Datamodel Explorer window changes to show information about that entity type with two tabs: Assigned Tables and Attributes. The default tab is Assigned Tables as shown below. Display 4.15
Assigned Tables Tab of the Datamodel Explorer Window
The Assigned Tables tab displays the Entity View name and a table that lists the table(s) that the entity type contains.
Attributes Tab To display the Attributes tab, from the All Entity Types tab, double-click any line item and then click the Attributes tab. The Attributes tab will display.
Using the SAS/ACCESS Interface to R/3
Display 4.16
4
Datamodel Explorer Window Menus
29
Attributes Tab of the Datamodel Explorer Window
An attribute is a field of an entity view. The Attributes tab displays a table that contains the name and a short description of the fields in the selected table.
Datamodel Explorer Window Menus The Datamodel Explorer window contains several menus. While four of the menus (Edit, Solutions, Window, and Help) are all part of the standard SAS environment and are fully documented in your SAS reference manuals, four of the menus (File, View, Tools, and Connections) have commands that are specific to the SAS/ACCESS Interface to R/3. This section describes the menu commands that are available from the Datamodel Explorer window.
30
Datamodel Explorer Window Menus
4
Chapter 4
File Menu Display 4.17
File Menu of the Datamodel Explorer Window
The R/3 File menu commands are Properties
displays the General Attributes for a List of Tables window that is shown in Display 4.22 on page 36.
Export Metadata
refines the choice to export to either SAS/Warehouse Administrator or to SAS Datasets. Select SAS/Warehouse Administrator to display the Export Metadata to SAS/Warehouse Administrator window that is shown in Display 4.34 on page 50. Select SAS Datasets to display the Export Metadata window that is shown in Display 4.33 on page 49.
Using the SAS/ACCESS Interface to R/3
4
Datamodel Explorer Window Menus
31
View Menu Display 4.18
View Menu of the Datamodel Explorer Window
The R/3 View menu commands are List of Tables
displays the List of R/3 Tables window that is shown in Display 4.31 on page 47.
List of Descriptors
displays the List of R/3 Descriptors window that is shown in Display 4.32 on page 48.
32
Datamodel Explorer Window Menus
4
Chapter 4
Tools Menu Display 4.19
Tools Menu of the Datamodel Explorer Window
The R/3 Tools menu commands are Create Views
creates SAS data views to the R/3 tables. If the views already exist, a dialog box will prompt you to decide if you want to cancel, overwrite all the currently existing views, or decide on an individual view basis. A data set type of ACCR3 is added to all data sets and views that are created by the SAS/ACCESS Interface to R/3.
Create R/3 Descriptors
creates the R/3 descriptors. You should only use the SAS/ACCESS Interface to R/3 to delete descriptors that were created using the interface. Internal tables track the descriptors, and using external tools to delete descriptors can make the tables inconsistent.
Search Metadata
displays the Data Dictionary Search Facility window that is shown in Display 4.36 on page 52.
Connections Menu Display 4.20
Connections Menu of the Datamodel Explorer Window
The R/3 Connections menu commands are
Using the SAS/ACCESS Interface to R/3
4
List of Connections Window
Logon to R/3
displays the Logon to R/3 window that is shown in Display 4.2 on page 17.
List Connections
displays the SAS/ACCESS to R/3: List of Connections window that is shown in Display 4.21 on page 33.
Logoff
disconnects the current logon profile from the R/3 system.
33
List of Connections Window The List of Connections window displays the current and available user profiles for connecting to the R/3 systems. You can also use the List of Connections window to log on to the systems. To display the List of Connections window: 1 From the SAS/ACCESS to R/3 desktop, start the Datamodel Explorer. 2 From the Datamodel Explorer menu, select Connections
I List Connections
The List of Connections window displays. Display 4.21
List of Connections Window
The drop-down list on the upper left side of the window displays the type of connection that is shown in the connection list box. Click the down arrow icon to view the types of connection: Available connections or Open connections. The connection list box on the lower left side of the window then displays a list of connections for that connection type. When you select Available connections, the following buttons are available: Edit
displays the Logon to R/3 window, which allows you to edit the profiles.
Connect
connects to an R/3 database by using the connection parameters that are selected in the connection list box. If no connection is selected in the connection list box, this button is disabled.
New
displays the Logon to R/3 window that is shown in Display 4.2 on page 17.
Remove
deletes the connection that is selected in the connection list box. If no connection is selected in the connection list box, this button is disabled.
34
List of Connections Window
4
Chapter 4
OK
saves your changes, closes the List of Connections window, and returns you to the Datamodel Explorer window.
Help
displays the SAS Help for the List of Connections window.
When you select Open Connections, the following buttons are available: Disconnect
disconnects the open connection that is selected in the connection list box. If no connection is open, this button is disabled.
OK
saves your changes, closes the List of Connections window, and returns you to the Datamodel Explorer window.
Help
displays the SAS Help for the List of Connections window.
When you select a connection in the connection list box, four tabs are displayed in the right half of the window. The information that is contained in these tabs is similar to the information that is displayed in the Advanced Parameters window. The four tabs are 3 General 3 RFC 3 TCP/IP 3 More RFC. The information that is contained in these tabs is available for viewing only; you cannot edit the information from this window.
General Tab The General tab of the List of Connections window contains the following fields: Connection Id
displays the text label for the connection ID. The label must follow standard SAS syntax.
Remote
displays the remote host if one is specified. In order to read R/3 tables into SAS data sets on a remote SAS session, you must establish the connection to the R/3 session in the remote SAS session.
Profile
displays the connection profile name.
Description
displays a text description of the connection profile.
RFC Tab The RFC tab of the List of Connections window contains the following fields: Client
displays the three-digit R/3 client identification number.
User
displays the R/3 user ID.
Language
displays the language used by the RFC logon.
Host
displays the R/3 server to which the RFC server connects. This field does not have a default value set.
Destination
is a logical name used by the sideinfo file, if one is defined. Note: If a destination is set here, the sideinfo file will override the information entered in the other fields on the RFC tab. 4
TCP/IP Tab The TCP/IP tab of the List of Connections window contains the following fields:
Using the SAS/ACCESS Interface to R/3
4
General Attributes for a List of Tables Window
35
Host
displays the network location of the RFC server. The default is localhost, and a fully qualified domain name is not required. For example, if the RFC server is reachable by using the DNS name rfc.example.com and is on the local area network, the Host field will accept either rfc or rfc.example.com. Numeric addresses are also accepted.
Port
displays the TCP/IP port to use for communicating with the RFC server. The default port number is 6991.
More RFC Tab The More RFC tab of the List of Connections window contains the following fields: Gateway Host
displays the gateway host that is used by the RFC server to communicate with the R/3 system. This field defaults to Host.
Gateway Service
displays the communication gateway service that is used by R/3.
System Number
displays the system number that identifies which R/3 system to access if there is more than one R/3 system that resides on the same host. At times, more than one R/3 system will be operating on the same host, such as a development or testing R/3 system that runs on the same host hardware as a production R/3 system. The default value for this field is 0.
Function
specifies a SAS function to call as part of the R/3 logon process.
General Attributes for a List of Tables Window The General Attributes for a List of Tables window displays the descriptor, SAS Data View, and source entry for selected tables of the data model that you selected in the main window of the Datamodel Explorer. To display the General Attributes for a List of Tables window that is shown in Display 4.22 on page 36, start the Datamodel Explorer, and then select a data model from the tree diagram. Next, 3 select File I Properties or
I List of Tables to display the List of R/3 Tables window that is shown in Display 4.31 on page 47; and then select a table and click Properties .
3 select View or
3 right-click the selected data model, and then select Properties from the pop-up menu.
36
General Attributes for a List of Tables Window
Display 4.22
4
Chapter 4
General Attributes for a List of Tables Window
The window displays all of the tables that are associated with the data model that is selected in the main window of the Datamodel Explorer window. The three columns of the table display the table identifier, the text description of the table, and the table type. The elements available on the General Attributes for a List of Tables window are Use Defaults
resets the values for the selected table to the default values.
Auto Replace
specifies whether you want to automatically overwrite the existing descriptor, data file (either a View or a Data Set), and source library for the selected table with any changes you have made on the General Attributes for a List of Tables window. Select the check box to automatically save changes to the descriptor, data file, and source library and overwrite the existing table information when you click Save . Do not select the check box if you want to be prompted whether to overwrite the existing table information when you click Save .
R/3 Table
displays the table identifier in the Table column on the General Attributes for a List of Tables window. This field cannot be edited.
R/3 Descriptor
enables you to specify a descriptor for the selected table. Click the down arrow to display a pull-down list of previously saved descriptors. Right-click inside the field to display a pop-up menu that enables you to
3 enter a new catalog entry name for the selected descriptor using the Enter Catalog Entry Name window that is shown in Display 4.25 on page 40.
3 save the selected descriptor. 3 load the selected descriptor. 3 delete the selected descriptor. SAS Data File
enables you to
Using the SAS/ACCESS Interface to R/3
4
General Attributes for a List of Tables Window
37
3 enter a new data set name for the selected descriptor using the Enter Dataset Name window that is shown in Display 4.24 on page 39. 3 save the specified SAS data file.
3 delete the specified SAS data file. Click the ellipsis icon to the right of the field to display the Enter Dataset Name window. Right-click inside the field to display a pop-up menu that enables you to save or delete the SAS data files. Source Entry
enables you to 3 enter a new catalog entry name using the Enter Catalog Entry Name window that is shown in Display 4.25 on page 40. 3 save the specified source entry. 3 delete the specified source entry. Click the ellipsis icon to the right of the field to display the Enter Catalog Entry Name window. Right-click inside the field to display a pop-up menu that enables you to save or delete the source entry.
The buttons available on the General Attributes for a List of Tables window are OK
closes the General Attributes for a List of Tables window and returns you to the Datamodel Explorer window.
Cancel
closes the window without saving any changes that you have made.
Help
displays the SAS Help for the General Attributes for a List of Tables window.
Reset
applies default values.
Show
displays the System R/3 table.
More Properties
displays the Attributes for a Table (Edit) window.
New
displays the Enter Catalog Entry Name window.
Delete
deletes the descriptor that is shown in the R/3 Descriptor field.
Save
creates and saves a descriptor of the same name as the selected item in the R/3 Descriptor field. A dialog box displays informing you that the R/3 descriptor has been created. If the descriptor already exists, a dialog box prompts you to replace the existing descriptor file or to cancel the operation.
The General Attributes for a List of Tables window also contains additional R/3 features that are available from the Tools menu.
38
General Attributes for a List of Tables Window
Display 4.23
4
Chapter 4
Tools Menu of the General Attributes for a List of Tables Window
The R/3 Tools menu commands are Create Views
creates SAS data views to the R/3 tables. If the views already exist, a dialog box will prompt you to decide if you want to cancel, overwrite all the currently existing views, or decide on an individual view basis. A data set type of ACCR3 is added to all data sets and views created by the SAS/ACCESS Interface to R/3.
Create R/3 Descriptors
creates the R/3 descriptors that were the base element of the SAS/ACCESS interface to R/3 in previous releases.
Save Source
saves the generated source code to the specified source entry.
Create Extract Programs
displays the Create Extract Programs window that is shown in Display 4.26 on page 41.
Options . Access to R/3
displays the Application Setup window that is shown in “Application Setup Window” on page 22.
Using the SAS/ACCESS Interface to R/3
4
Enter Catalog Entry Name Window
39
Enter Dataset Name Window The Enter Dataset Name window enables you to select or create a data set and specify the host and library associated with the data set. This window also enables you to specify whether the data set will be a view or a data file. Display 4.24
Enter Dataset Name Window
To display the Enter Dataset Name window, from the General Attributes for a List of Tables window, select a table and then select the down arrow icon to the right of the SAS Data File field. The elements available on the Enter Dataset Name window are: OK
closes the window, creating the specified data set.
Cancel
closes the window.
Select
displays a window that is used to browse for a library.
Help
displays the SAS Help for the window.
Host
specifies the host on which the data set will be stored.
Library
specifies the library in which the data set will be saved.
Name
specifies the name for the data set.
Type
specifies the information type for the data set. Valid values are View and Data Set.
Enter Catalog Entry Name Window The Enter Catalog Entry Name window enables you to select or create a SAS catalog entry and specify the host and library associated with the entry. This window also enables you to specify the type of the catalog entry.
40
Create Extract Programs Window
Display 4.25
4
Chapter 4
Enter Catalog Entry Name Window
To display the Enter Catalog Entry Name window, from the General Attributes for a List of Tables window, select a table, and then select the down arrow icon to the right of the Source Entry field. The elements available on the Enter Catalog Entry Name window are: OK
closes the window, creating the specified catalog entry.
Cancel
closes the window.
Select
displays a window that is used to browse for a catalog.
Help
displays the SAS Help for the window.
Host
specifies the host on which the catalog entry will be stored.
Library
specifies the library in which the catalog entry will be saved.
Catalog
specifies the catalog in which the catalog entry will be saved.
Entry
specifies the name for the catalog entry.
Type
displays the information type for the catalog entry. The default is SOURCE.
Create Extract Programs Window The Create Extract Programs window is designed to assist in generating SAS and R/3 programs for extracting data with an intermediate external file. To display the Create Extract Programs window, from the General Attributes for a List of Tables window, select an R/3 table. Then, select Tools and then Create Extract Programs to display the Create Extract Programs window.
Using the SAS/ACCESS Interface to R/3
Display 4.26
4
Create Extract Programs Window
41
Create Extract Programs Window
The elements available on the Create Extract Programs window are: Ok
generates the source and saves it into the specified catalog entries.
Cancel
closes the window.
Help
displays the SAS Help for the Create Extract Programs window.
The two display areas are for defining parameters for creating SAS DATA steps and ABAP source files. The elements available for creating DATA steps are: Create SAS Data Step
enables the fields for creating a DATA step. If this check box is not selected, the associated fields are disabled.
SAS Data File
specifies the name of the resulting SAS data set or SAS data set view. Click the icon to the right of the field to open the Enter Dataset Name window that is shown in Display 4.24 on page 39.
Fileref
specifies the SAS file reference to the intermediate external file. It can also be a PIPE to read directly in the output of an ABAP program. Click the down arrow icon to the right of the field to display a drop-down list of available filerefs.
Save Source into
specifies the four-level name of a SAS catalog in which to save the source code of the SAS DATA step. Click the icon to the right of the field to display the Enter Catalog Entry Name window that is shown in Display 4.25 on page 40.
Browse
displays the SAS data file that is generated from the selections.
Create ABAP Source
enables the fields for creating an ABAP source. If this check box is not selected, the associated fields are disabled.
ABAP Report Name
specifies the name of the ABAP report that is being generated. The filename should begin with the letter Z.
ABAP creates (Filename)
specifies an external filename. Click the icon to the right of the field to display the Save As window.
42
Attributes for a Table (Edit) Window
4
Chapter 4
Display 4.27 Save As - SAS/ACCESS to R/3: Create Extract Programs Window
Save Source into
Browse
specifies the four-level name of a SAS catalog in which to save the source code of the ABAP report. Click the icon to the right of the field to display the Enter Catalog Entry Name window that is shown in Display 4.25 on page 40. displays the generated ABAP program.
Attributes for a Table (Edit) Window The Attributes for a Table (Edit) window provides information about the characteristics of specific tables within the R/3 database. To display the Attributes for a Table (Edit) window, from the General Attributes for a List of Tables window, select an R/3 table. Click More Properties to display the Attributes for a Table (Edit) window. The Attributes for a Table (Edit) window contains four tabs: General Attributes, Fields, Where, and Related Tables.
Using the SAS/ACCESS Interface to R/3
Display 4.28
4
Attributes for a Table (Edit) Window
43
Attributes for a Table (Edit) Window
The buttons on the Attributes for a Table (Edit) window are OK
closes the Attributes for a Table (Edit) window and returns you to the General Attributes for a List of Tables window, saving your changes.
Cancel
closes the Attributes for a Table (Edit) window and returns you to the General Attributes for a List of Tables window without saving any change that you might have made.
Help
displays the SAS Help for the Attributes for a Table (Edit) window.
General Attributes Tab The General Attributes tab of the Attributes for a Table (Edit) window describes the source for the data and the SAS view. The General Attributes tab contains the following elements: R/3 Table
specifies the R/3 table from which to read the data.
R/3 Descriptor
enables you to specify a descriptor for the selected table. Click the down arrow to display a pull-down list of previously saved descriptors. Right-click inside the field to display a pop-up menu that enables you to 3 enter a new catalog entry name for the selected descriptor using the Enter Catalog Entry Name window that is shown in Display 4.25 on page 40. 3 save the selected descriptor. 3 load the selected descriptor. 3 delete the selected descriptor.
SAS Data File
specifies the SAS data view to use with the table. Click the icon to the right of the field to display the Enter Dataset Name window that is shown in Display 4.24 on page 39.
44
Attributes for a Table (Edit) Window
Source Entry
4
Chapter 4
specifies the source to which the DATA step is saved. Click the icon to the right of the field to display the Enter Catalog Entry Name window that is shown in Display 4.25 on page 40.
Reset
resets the drop-down lists to their default settings.
Show Data
shows the data from the R/3 table.
Fields Tab The Fields tab is the default tab that is selected when the Attributes for a Table (Edit) window is displayed. The Fields tab displays the field names and descriptions for the selected table. The table on the Fields tab displays the information for each field in the selected table. For each field in the table, the table and the lower part of the tab display the 3 Field Name 3 Primary Key 3 Description 3 SAS Name 3 Format 3 Informat. You can edit the SAS name, the format, and the informat in the lower part of the tab. During the import process, special characters in the Field Name such as a forward slash (/) are converted to an underscore (_) in the SAS Name. Also, if a numeric field has more than 10 decimal places, the decimal places are omitted from the informat and the affected field is multiplied by 10** (-d) in the data set. The buttons available on the Fields tab of the Attributes for a Table (Edit) window are Select Fields
displays the Select Fields for a table window shown in Display 4.29 on page 45, which allows you to choose which fields of the table are displayed or hidden in this tab.
Apply
saves changes made to the SAS name, the format, and the informat in the lower part of the tab.
Long Desc.
displays the Long Description window, which displays the long description for the selected field.
Where Tab The Where tab enables you to edit or build a clause to query the rows that are extracted from the R/3 table. You can use the SAS/ACCESS Interface to R/3 application to generate an ABAP WHERE clause that the application passes to the R/3 system (along with other parameters like table name, record length, and so on). The buttons available on the Where tab of the Attributes for a Table (Edit) window are Check
checks the syntax of the entered WHERE clause.
Reset
discards any changes made to the WHERE clause.
Clear
removes the WHERE statement from the entry field.
Build
displays the ABAP Where Expression Builder window that is shown in Display 4.30 on page 46.
Related Tables Tab The Related Tables tab of the Attributes for a Table (Edit) window presents a cross-reference of R/3 tables (if any) that share a field with the selected table.
Using the SAS/ACCESS Interface to R/3
4
Attributes for a Table (Edit) Window
45
The Related Tables tab contains two tables: the table on the left half of the tab displays the abbreviation and description for all R/3 system tables that share a field with the selected table. Select a table name in the left-hand table to display a second table on the right half of the tab that displays the field or fields that the two tables have in common. Double-click a table to display the General Attributes for a List of Tables window and the properties for the selected table.
Select Fields for a Table Window To display the Select Fields for a Table window, display the Attributes for a Table (Edit) window, select the Fields tab, and then click Select Fields . The Select Fields for a Table window enables you to select fields for viewing and querying. Display 4.29
Select Fields for a Table Window
The buttons available on the Select Fields for a Table window are OK
closes the Select Fields for a Table window and returns you to the Attributes for a Table (Edit) window, saving your changes.
Cancel
closes the Select Fields for a Table window and returns you to the Attributes for a Table (Edit) window without saving any changes.
Help
displays the SAS Help for the window.
The drop-down list on the left-hand side of the window enables you to select either Show Field Name or Show Field Description. The drop-down list on the right-hand side of the window enables you to specify how the fields are sorted in the Fields and Selected Fields lists. The Selected Fields list shows the fields that will be listed in the General Attributes for a List of Tables window. The Fields list shows the fields
that will not be listed in the General Attributes for a List of Tables window. The four buttons between the Fields and Selected Fields lists are used to move fields between the two list boxes. To move a field from one list box to the other, select the field name, and then click the left arrow or the right arrow button. To move all of the fields in a list box to the other list box, click the left double arrow button or the right double arrow button.
46
ABAP Where Expression Builder Window
4
Chapter 4
ABAP Where Expression Builder Window The ABAP Where Expression Builder window enables you to create queries in ABAP syntax. To display the ABAP Where Expression Builder window, from the General Attributes for a List of Tables window, select an R/3 table. Then, click More Properties to display the Attributes for a Table (Edit) window, as shown in Display 4.28 on page 43, and select the Where tab. From the Where tab, click Build to display the ABAP Where Expression Builder window. Display 4.30
ABAP Where Expression Builder Window
The elements available from the ABAP Where Expression Builder window are Display Text
controls whether the label name or description is displayed in the text entry field. If the check box is selected, the description is displayed. You cannot edit the text description.
R/3 Table Variables list box
displays the available variables for the selected R/3 table. Use these variables to write the WHERE statement.
Logical Operator list box
displays the logical operators for the WHERE statement: equal, less than, greater than, null, and so on.
And/Or
controls the relation of a query clause to the following query clause. By default, And is selected.
OK
closes the window and saves the query.
Cancel
closes the window without saving any changes.
Undo
deletes the last change made in the window.
Clear
clears the current WHERE query.
Reset
resets the query parameters to their previously saved status.
Check Syntax
checks the syntax of the query as currently constructed.
Help
displays the SAS Help for the ABAP Where Expression Builder window.
Apply
controls the insertion of the Where clause. Select on of the valid actions from the pop-up window: Insert before current line,
Using the SAS/ACCESS Interface to R/3
4
List of R/3 Tables Window
47
Insert after current line, Replace current line, Insert at the top, and Append at the bottom.
Using the List of R/3 Tables The List of R/3 Tables window enables you to view all of the R/3 system tables and information about those tables. To display the List of R/3 Tables, go to the SAS Desktop and open the SAS/ACCESS to R/3 desktop that is shown in Display 4.1 on page 17. Double-click the List of R/3 Tables icon to open the List of R/3 Tables window that is shown in Display 4.31 on page 47. To display the List of R/3 Tables window from the Datamodel Explorer, start the Datamodel Explorer, and then select View I List of Tables
List of R/3 Tables Window The List of R/3 Tables window displays a table that lists all of the available R/3 system tables. Display 4.31
List of R/3 Tables Window
The table shows the name, type, and a short text description for every table in R/3. The Table Name field enables you to enter a SAS text label for the name of the table. To display further details for a table, select a table line item from the list, and then click Properties to display the General Attributes for a List of Tables window. You can also double-click a line item to display the General Attributes for a List of Tables window.
48
Using the List of Descriptors
4
Chapter 4
Using the List of Descriptors The List of R/3 Descriptors window enables you to view all of the R/3 descriptors and information about those descriptors. To display the List of R/3 Descriptors, go to the SAS Desktop and open the SAS/ACCESS to R/3 desktop that is shown in Display 4.1 on page 17. Double-click the List of R/3 Descriptors icon to open the List of R/3 Descriptors window that is shown in Display 4.32 on page 48. To display the List of R/3 Descriptors window from the Datamodel Explorer, start the Datamodel Explorer, and then select View I List of Descriptors
List of R/3 Descriptors Window The List of R/3 Descriptors window displays all of the descriptors that are associated with a data model that you selected using the Datamodel Explorer window. In addition to displaying the descriptors, the List of R/3 Descriptors window shows the tables that are related to each of the descriptors and the date on which the descriptor was last updated. Display 4.32
List of R/3 Descriptors Window
Selecting a line item in the table and clicking Properties displays the General Attributes for a List of Tables window that is shown in Display 4.31 on page 47.
Export Metadata Window The Export Metadata window enables you to define parameters for exporting metadata from R/3 tables to a SAS library. To display the Export Metadata window: 1 Start the Datamodel Explorer. 2 Select a data model and entity type.
Using the SAS/ACCESS Interface to R/3
3 Select File
4
Export Metadata to SAS/Warehouse Administrator Window
49
I Export Metadata I SAS Datasets from the pull-down menu.
The Export Metadata window displays. Display 4.33
Export Metadata Window
From the Destination Libname to Export drop-down list, select the library to which you want to export metadata. A data set type of ACCR3 is added to all data sets and views created by the SAS/ACCESS Interface to R/3. Then, select the type of metadata to export and whether to replace existing data sets or create new data sets for the metadata that you are exporting.
Export Metadata to SAS/Warehouse Administrator Window The Export Metadata to SAS/Warehouse Administrator window enables you to define parameters for exporting metadata from R/3 tables to a SAS data warehouse environment. To display the Export Metadata to SAS/Warehouse Administrator window: 1 Start the Datamodel Explorer. 2 Select a data model and entity type.
I Export Metadata pull-down menu.
3 Select File
I SAS/Warehouse Administrator from the
The Export Metadata to SAS/Warehouse Administrator window displays.
50
Export Metadata to SAS/Warehouse Administrator Window
Display 4.34
4
Chapter 4
Export Metadata to SAS/Warehouse Administrator Window
From the Data Warehouse Environment drop-down list, select the environment to which you want to export metadata. To define or view properties for the selected environment, click the ellipses […] button to display the Data Warehouse Environment Properties window, as shown in Display 4.35 on page 51. Then, from the Operational Data Group drop-down list, select the ODD group name, and then select or specify the ODD in the ODD Name field. Then, select the type of metadata to export and whether to replace existing ODDs or create new ODDs for the metadata that you are exporting. The following information is exported from the SAS/ACCESS Interface to R/3 in order to create SAS/Warehouse Administrator operational data definitions (ODDs). An ODD is created from each Entity View and Assigned Table. Any new ODD group that is created in a SAS data warehouse by the SAS/ACCESS Interface to R/3 will have the extended attribute "Access to R/3". Table 4.1 ODD to Warehouse Administrator Correspondences ODD
SAS/Warehouse Administrator
ODD Name
Table/Entity Name
ODD Description
Table/Entity Description
ODD Notes
Table/Entity Long Description
ODD Data Location
SAS Library
ODD Data Location
Table/View Name
Fields are exported to columns in an ODD, which should include the name, short description, format, and informat. If a field has a defined long description, it is exported as a column note. Finally, three extended attributes are created for each ODD: CREATED BY, CVALUE, and DATAMODEL_OR_ENTITY_TYPE. Long descriptions cannot be exported by themselves; they can be exported with table or table column metadata only. Selecting the ellipses button to the right of the Data Warehouse Environment field displays the Data Warehouse Environment Properties window, which enables you to specify or view detailed information about the data warehouse environment.
Using the SAS/ACCESS Interface to R/3
Display 4.35
4
Data Dictionary Search Facility Window
51
Data Warehouse Environment Properties Window
The elements available on the Data Warehouse Environment Properties window are Path
specifies the physical pathname of the directory for the data warehouses in the environment.
Engine
specifies the engine that you want to use to access the environment. The default engine is V8.
Options
specifies any LIBNAME statement options for the environment.
Name
displays the name of the selected data warehouse environment.
Description
displays a description of the environment, if present.
OK
closes the window, saving any entered properties.
Cancel
closes the window without saving any entered properties.
Help
displays the SAS Help for the Data Warehouse Environment Properties window.
Using the Search Metadata Utility The Search Metadata utility allows you to search the entire R/3 database for a given text string. You can optionally limit the search to tables, entities, data models, and other filtering choices.
Data Dictionary Search Facility Window The Data Dictionary Search Facility window allows you to search the R/3 database by using the SAS/ACCESS Interface to R/3. To display the Data Dictionary Search Facility window: 1 From the SAS desktop, open the SAS/ACCESS to R/3 desktop that is shown in Display 4.1 on page 17. 2 Double-click the Search Metadata icon to open the Data Dictionary Search Facility
window.
52
4
Data Dictionary Search Facility Window
Display 4.36
Chapter 4
Data Dictionary Search Facility Window
Note: You can also display the Data Dictionary Search Facility window from the Datamodel Explorer by selecting Tools I Search Metadata from the pull-down menu. 4 The buttons available on the Data Dictionary Search Facility window are Search
performs the search for the entered string and uses the current options.
Reset All
clears the search string from the entry field and resets the parameters on the Options tab to their defaults.
End
closes the Data Dictionary Search Facility window and returns you to the Datamodel Explorer window.
Help
displays the SAS Help for the Data Dictionary Search Facility window.
Select
displays the Datamodel Explorer and expands the tree diagram to show a selected data model or entity type that was found by the query. If a table in the results table is selected when you click Select , the General Attributes for the List of Tables window displays.
Search String Tab The Search String tab enables you to query the data dictionary using a text search string. Use the Search String tab when you are searching the data dictionary for one or more specific data models. Text field
Reset String
specifies a text string with which to search the R/3 system. Searching with a special character such as a forward slash (/) requires single quotation marks around the special character. For example, enter and’/’or to search for the string and/or. clears the text field.
Options Tab The Options tab enables you to set parameters for a query against the data dictionary. Use the Options tab to specify which elements you want to include in the
Using the SAS/ACCESS Interface to R/3
4
Performing Batch Operations
53
search, which fields you want to include in the search, and the number of matches you want to display in the list of results. Display 4.37
Options Tab of the Data Dictionary Search Facility Window
The elements available on the Options tab are Datamodels
searches the data model element for the search string. By default, this check box is selected.
Entity Types
searches the entity element for the search string. By default, this check box is selected.
Tables
searches the table element for the search string. By default, this check box is selected if the window was displayed from the Search Metadata icon on the desktop. However, if the window was displayed from the Datamodel Explorer, the check box is not automatically selected.
Columns
searches the column element for the search string. By default, this check box is not selected.
Set Max. Number
enables you to customize the number of matches to display from the query. If you select this option, enter the maximum number of matches in the entry field to the right of the radio button. The default is 100 matches.
Unlimited
displays all matches for the query.
Name
searches the name field for the search string. By default, this check box is selected.
Description
searches the description field for the search string. By default, this check box is selected.
Case Sensitive
requires that the case match the query specifications.
Performing Batch Operations You can use batch operations to automate processes; for example, you can use them for overnight operations or to simplify connections for end users.
54
Source Parameter
4
Chapter 4
To open the connection for a batch operation, use the following: %r3connb(profile=profile-name, libref=SAS-libref, function=OPEN);
profile-name
specifies the name of the profile that is used to save the info in the Logon to R/3 window.
SAS-libref
specifies the SAS library where the profile was saved. If this parameter is not specified, the profile will be looked for in the SAS libraries WORK, SASUSER, and R3LIB (in that order).
function=OPEN
opens the connection.
To close the connection, use the following: %r3connb(profile=profile-name, libref=SAS-libref, function=CLOSE);
or %r3connb(id=connection-id, function=CLOSE);
profile-name
specifies the name of the profile that is used to save the info in the Logon to R/3 window.
SAS-libref
specifies the SAS library where the profile was saved. If this parameter is not specified, the profile will be looked for in the SAS libraries WORK, SASUSER, and R3LIB (in that order).
function=CLOSE
disconnects from the R/3 system.
connection_id
specifies the connection ID.
Source Parameter Previous versions of the SAS/ACCESS Interface to R/3 included the use of a source parameter in the batch connection. For backward compatibility, use of the source parameter as described below is still supported, although not recommended. Submit the following macro in SAS to set up the connection for batch: %r3connb (source = libref.catalog.entry.SOURCE );
If operating in batch mode, disconnect before exiting by issuing the following command in SAS: %r3connb (source = libref.catalog.entry.SOURCE, function = close);
Passwords In batch processing, all parameters to log on to an R/3 system are generally stored in permanent SAS catalog entries. If you do not want to store all parameters, particularly the user ID, password, and client, you can use the following SAS code to prompt the user for this information. In this scenario, all other connection information—the function module name, the gateway host, or the gateway service—have to be entered in the Application Setup window when you create the SAS DATA step view. /*----------------------------------------------------*/ /* This SAS program demonstrates how to prompt a user */ /* for the R/3 user ID, password, client, and */ /* language information. */ /* The remote processing is enclosed in comments. */ /*----------------------------------------------------*/
Using the SAS/ACCESS Interface to R/3
*--- reset password ---*; %let pwd=; *--- set the message text ---*; %let message=Please enter the R/3 logon parameter; *--- prompt the user for the parameters ---*; %macro secure; %global usr pwd cli lng; %window R3 columns=80 rows=15 #2 @5 message 50 protect=yes #4 @5 "User : " usr 10 required=yes #6 @5 "Password: " pwd 10 display=no required=yes #8 @5 "Client : " cli 3 required=yes #10 @5 "Language : " lng 1 required=yes; %display R3; %mend secure; %secure; /* === for remote processing =======================
*/
*--- macro to pass macro variables to ---*; *--- a remote SAS session ---*; %macro syslput(macvar,macval,remote=); %let str=%str(rsubmit &remote ;); %nrstr(%let) %str(&macvar = &macval ; endrsubmit;); &str ; %mend syslput; *--- pass macro variables to the remote SAS session ---*; %syslput(usr,&usr); %syslput(pwd,&pwd); %syslput(cli,&cli); %syslput(lng,&lng); *--- submit the code to the remote SAS session ---*; rsubmit; === end of remote processing =========================== */ *--- a temporary catalog entry for the connection ---*; *--- parameters ---*; %let source=work.r3conn.conn1.source; *--- the connection id ---*; *--- ATTENTION: This has to be the same connection ID ---*; *--- as the one that was used to create the views. ---*; %let cconn=conn1; *--- the host/port where the RFC server program ---*; *--- is running ---*; %let tcphost=cafe7.eur.sas.com;
4
Passwords
55
56
Passwords
4
Chapter 4
%let port=6991; *--- set the R/3 host parameter ---*; %let hst=hostname; *--- save the parameters to the temporary catalog ---*; *--- entry ---*; proc display c=sapr3.sr3dbi.savconnb.scl; run; *--- connect to the R/3 system ---*; %r3connb(source=&source); *--- use the Data Step view you have created with the ---*; *--- SAS/ACCESS Interface to R/3 ---*; *--- close the connection to the R/3 system ---*; %r3connb(source=&source, function=close); /* === for remote processing ================================== endrsubmit; === end of remote processing ================================ */ *--- end of sample program ---*;
57
CHAPTER
5 Using the RFC Server Overview of the RFC Server 57 ABAP Function Modules and Programs 57 Using the RFC Server on UNIX 58 Using the RFC Server on Windows NT 60 Using the RFC Server in Batch Mode 62 Using the RFC Macros and Macro Variables 63 Using the R/3 BAPI Connector: Logon Window 74
Overview of the RFC Server The RFC server is part of the SAS/ACCESS Interface to R/3 as described in Chapter 3, “Accessing and Using R/3 Data,” on page 11. The RFC server is a component of the SAP LIBNAME engine that provides access to the data in SAP R/3 and SAP BW systems. The RFC server also supports calling ABAP RFC functions. The RFC server uses the TCP/IP protocol for communication with the SAP LIBNAME engine. For more information about the SAP LIBNAME engine, see “Overview of the LIBNAME Engine for SAP” on page 77. The RFC server has the following features: 3 It runs independently of SAS as a background process on the SAS host, the R/3 host, and another machine entirely. 3 It can be configured to listen on any TCP/IP port (default 6999). 3 It can have more than one concurrent instance on a given machine (but each instance must have a unique port number). Each instance can communicate with many SAP R/3 or SAP BW system servers. 3 It can process requests from multiple SAP application servers. 3 It can support Unicode and non–Unicode SAP R/3 servers. The Unicode RFC server can be started from Windows only, but it can support Unicode SAP R/3 and SAS on all platforms. See “Using the RFC Server on Windows NT” on page 60 for information on starting a Unicode RFC server.
ABAP Function Modules and Programs Some of the ABAP function modules and programs that were available in the SAS/ACCESS Interface to R/3, Release 8.2, are no longer used in version 9 and later of the SAS/ACCESS Interface to R/3. These function modules and programs were used by the RFC server and the dialog RFC server that were included in the software prior to these releases. The new RFC server and RFC dialog server no longer use the following ABAP function modules and programs:
58
Using the RFC Server on UNIX
3 3 3 3
4
Chapter 5
Z_SAS_BATCH_INTERFACE_4 Z_SAS_READ_TABLE_CPIC ZSASRDTB ZSASRDBT
Version 9 and later of the SAS/ACCESS Interface to R/3 also include SAP transport files that you can use to install the ABAP function modules and programs. It is recommended that you import the SAP transport files rather than installing the ABAP function modules and programs manually. For more information about installing ABAP function modules and programs using version 9 and later of the SAS/ACCESS Interface to R/3, refer to the Installation Instructions for SAS/ACCESS Interface to R/3. Note: The transport files for the SAS/ACCESS for R/3 contain different ABAP function modules and programs than the transport files for the SAS/ACCESS Interface to SAP BW. Make sure you use the correct files when installing your application. 4
Using the RFC Server on UNIX In a UNIX environment, the SAS RFC server for SAP is installed in the !SASROOT/ saspgm/dbi/bin directory. You must add this directory to the PATH environment variable and add the location of the shared libraries to the appropriate environment variable. For more detailed information about how to set up the environment variables, see Installation Instructions for SAS/ACCESS Interface to R/3. To start the SAS RFC server in a UNIX environment, use the following command sasrfc_server [-d 0|1|2|3|4|5|6] [-n name] [-p port] [-w workdir] [-N namespace] [-V variant] [-help] [-c dialog_compat_port] [-b "-p port-number -V variant_name -R report_name"] [-B number_of_bytes]
where optional parameters are enclosed in brackets [ ]. To stop the RFC server in a UNIX environment, use the following command sasrfc_server [-k] [-p port]
where optional parameters are enclosed in brackets [ ]. The options for the SAS RFC server command for UNIX are as follows: -d n specifies whether to run the server as a daemon process or as an application and specifies the diagnostic level. The server is run as a daemon process when you specify -dn where n=0 or when you do not specify the -dn option. After successful initialization, all messages are routed to syslog. When you specify the -dn option where n= any number between 1 and 6, the program runs as an application and messages are routed to standard error. Higher diagnostic levels route more detailed messages to standard error. -k stops the service. -n name
Using the RFC Server
4
Using the RFC Server on UNIX
59
specifies the name of the service. This option is used to distinguish multiple daemon processes. For example, a test service might be started as -n test. -p port identifies the port number on which the service listens. The default port number is 6999. -w workdir specifies the working directory. For example, if your working directory is named tmp, specify the option as follows: -w /tmp. -N namespace specifies the namespace for ABAP functions and programs that are used by SAS. The default value is /SAS/. If the ABAP programs are installed in the customer namespace rather than in the /SAS/ namespace, then this parameter identifies where the ABAP programs are installed. -V variant specifies the R/3 report variant that is assigned to this server. You must assign a report variant for each RFC server that accesses an R/3 application server in batch mode. The variant parameter G_DEST specifies a unique destination to call back to the RFC server. -help specifies that you want to display command line Help. -c dialog_compat_port identifies the option that, when specified, runs the RFC server in V8 compatibility mode on the port indicated by the dialog_compat_port parameter. The port number must be different than the one used for the V9 requests. If the -c option is omitted, no dialog compatibility will be available. -b “-p port_number –V variant_name –R report_name” enables batch compatibility so that you can process V8 ACCR3 requests while you are using a V9 RFC server. You must use the double quotation marks in the batch compatibility option in order to separate the batch compatibility parameters from the V9 parameters that use the same syntax. The port parameter is optional. If omitted, the port number defaults to 6995. The report variant parameter is required and must be a valid variant of the report. The report parameter is optional and normally is omitted. If the report parameter is omitted, then report_name defaults to /SAS/ZSASV8COMPAT. The values in port_number, variant_name, and report_name must be different from the values used by V9 and different from the values used by dialog compatibility. -B number_of_bytes sets the minimum buffer size for data transfers in batch and dialog modes. The number of bytes should be greater than 10000 and no more than eight digits, or it will be ignored. If the –B option is omitted, the default is 10000 bytes. If you specify a value for the G_BUFMAX parameter that is less than the value of –B in batch mode, then the –B value is used. For example, to start the SAS RFC server as a daemon process with the name of test on port number 6991, use the following command: sasrfc_server -n test -p 6991
60
Using the RFC Server on Windows NT
4
Chapter 5
The following example command shows how to display command line Help: sasrfc_server
To start the SAS RFC server with debug level 4 on port number 6991, use the following command: sasrfc_server -d 4 -p 6991
To stop a SAS RFC server that is running on port number 6991, use the following command: sasrfc_server -k -p 6991
Using the RFC Server on Windows NT In a Windows NT environment, the SAS RFC server and the Unicode RFC server for SAP are installed in the !SASROOT\access\sasexe directory. To start or stop the SAS RFC server using a command line in the Windows NT environment, use the following command: sasrfc_server [-i n] [-r] [-s] [-k] [-t n] [-d n] [-n name[,desc]] [-p port] [-N namespace] [-V variant] [-help] [-c dialog_compat_port] [-b "-p port-number -V variant_name -R report_name"] [-B number_of_bytes]
To start or stop the Unicode RFC server using a command line in the Windows NT environment, use the following command. Note that the Unicode RFC server is used to access Unicode SAP systems, and it cannot be used to access non-Unicode SAP systems. sasrfc_serveru [-i n] [-r] [-s] [-k] [-t n] [-d n] [-n name[,desc]] [-p port] [-N namespace] [-V variant] [-help] [-c dialog_compat_port] [-b "-p port-number -V variant_name -R report_name"] [-B number_of_bytes]
The options for the SAS RFC server command and the options for the Unicode RFC server on Windows NT are as follows: –i n installs the program as a Windows service and specifies the startup option for a new service. Startup options are n=2
starts the service automatically
n=3
starts the service on demand
n=4
disables the service.
–r removes the program from the Service Manager. –s starts the service. –k stops the service. –t n sets the startup option for an existing service. Startup options are n=2
starts the service automatically
n=3
starts the service on demand
Using the RFC Server
n=4
4
Using the RFC Server on Windows NT
61
disables the service.
-d n specifies the diagnostic level. When you specify the -d n option where n= any number between 1 and 6, the program runs as an application and messages are routed to standard error. Higher diagnostic levels route more detailed messages to standard error. –n name,desc specifies the name and description of the service. –p port specifies the port number on which the server listens. The default port number is 6999. -N namespace specifies the namespace for ABAP functions and programs that are used by SAS. The default value is /SAS/. If the ABAP programs are installed in the customer namespace rather than in the /SAS/ namespace, then this parameter identifies where the ABAP programs are installed. -V variant specifies the R/3 report variant that is assigned to this server. You must assign a report variant for each RFC server that accesses an R/3 application server in batch mode. The variant parameter G_DEST specifies a unique destination to call back to the RFC server. –help specifies that you want to display command line Help. -c dialog_compat_port identifies the option that, when specified, runs the RFC server in V8 compatibility mode on the port indicated by the dialog_compat_port parameter. The port number for a 9.1 request must be different than the one used for the version 9 requests. If the -c option is omitted, no dialog compatibility will be available. -b “-p port_number –V variant_name –R report_name” enables batch compatibility so that you can process V8 ACCR3 requests while you are using a V9 RFC server. You must use the double quotation marks in the batch compatibility option in order to separate the batch compatibility parameters from the V9 parameters that use the same syntax. The port parameter is optional. If omitted, the port number defaults to 6995. The report variant parameter is required and must be a valid variant of the report. The report parameter is optional and normally is omitted. If the report parameter is omitted, then report_name defaults to /SAS/ZSASV8COMPAT. The values in port_number, variant_name, and report_name must be different from the values used by V9 and different from the values used by dialog compatibility. -B number_of_bytes sets the minimum buffer size for data transfers in batch and dialog modes. The number of bytes should be greater than 10000 and no more than eight digits, or it will be ignored. If the –B option is omitted, the default is 10000 bytes. If you specify a value for the G_BUFMAX parameter that is less than the value of –B in batch mode, then the –B value is used. For example, if you want to start the RFC server with a debug level of 1 on port number 6991, use the command below. Note that the following examples also work using Unicode server command sasrfc_serveru.
62
Using the RFC Server in Batch Mode
4
Chapter 5
sasrfc_server -d 1 -p 6991
To install the RFC server as a service with automatic startup on port 6991 and use the name test and a description of ’Test RFC server’, use the following command: sasrfc_server -i 2 -n ‘‘test,Test RFC server’’ -p 6991
To uninstall the server that was started in the previous example, use the following command: sasrfc_server -r -n ‘‘test’’
Using the RFC Server in Batch Mode The 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 employed 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 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 the database table(s). When operating in batch mode, the RFC server creates and releases an SAP job to execute this ABAP program. The RFC server then waits for the job that is running the ABAP program to start and to recall the RFC server. Finally, the resulting data stream (that the RFC server receives from the SAP system) is passed on to the LIBNAME engine. LIBNAME or data set option: BATCH | BATCH_MODE | BATCHMODE= 0|1|Y|N Indicates whether the 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 RFC server, an RFC destination and a variant for ABAP program /SAS/Z_SAS_READ must be set up for each RFC server instance. Before the RFC server can execute requests as a batch job the following steps must be performed: 1 Create an RFC server destination. For each 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 RFC server on an SAP gateway. If two RFC servers are used to read data from one SAP application server, two RFC destinations must be set up on that SAP application server. If gateway information is omitted from the SM59 destination, the batch job is constrained to run on the R/3 server mentioned in the SAS LIBNAME statement for the request.
Using the RFC Server
4
%CALLRFC
63
If explicit gateway information is entered in the SM59 destination information, the batch job is run on any eligible R/3 server as determined by the SAP site batch configuration. Omitting the gateway information is typically done 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 allocated by the SAP batch system. 2 Create a variant of ABAP program /SAS/Z_SAS_READ. After defining the destination for the RFC server, you will need to make the RFC destination known to the ABAP program. This is done by creating a variant for the ABAP program / SAS/Z_SAS_READ. The concept of variants provides a way of parameterizing ABAP programs. For each defined destination, a variant needs to be created that references the destination. Variants are client dependent. 3 Start the RFC server with the variant. For more information about using the RFC server and particularly the sasrfc server option, see “Using the RFC Server on UNIX” on page 58 and “Using the RFC Server on Windows NT” on page 60. For further information about the setup of RFC server destinations and variants, see the Installation Instructions to SAS/ACCESS Interface to R3.
Using the RFC Macros and Macro Variables The SAS/ACCESS Interface to R/3 includes several SAS macros and SAS macro variables that enable you to communicate with the RFC server. The following SAS macros and SAS macro variables are available: %CALLRFC enables you to call a specified R/3 function. For more information about using the %CALLRFC macro, see “%CALLRFC” on page 63. %R3CONNB enables you to use a profile to log on to the R/3 system for batch processing. For more information about using the %R3CONNB macro, see “%R3CONNB” on page 68. %R3CONNC enables you to log on to the R/3 system when performing batch processing. For more information about using the %R3CONNC macro, see “%R3CONNC” on page 69. %R3CONNE enables you to log off of the R/3 system when performing batch processing. For more information about using the %R3CONNE macro, see “%R3CONNE” on page 71. RFC_LOGON_INFO enables you to you to specify the logon information and connection parameters that are used in the %CALLRFC macro. For more information about using the RFC_LOGON_INFO macro variable, see “RFC_LOGON_INFO” on page 72.
%CALLRFC Calls a specified RFC-enabled R/3 function module
64
%CALLRFC
4
Chapter 5
Type:
autocall macro
See also:
“Using the R/3 BAPI Connector: Logon Window” on page 74 “RFC_LOGON_INFO” on page 72
Syntax %CALLRFC( EXPORTING IMPORTING INTABLES OUTTABLES USING )
Details %CALLRFC is a SAS macro that allows you to call any RFC-enabled R/3 function module that you specify. Function modules that are called using this macro must
3 be RFC-enabled 3 be synchronous 3 have no user interaction. The parameters for %CALLRFC are as follows: EXPORTING
passes field values or structures to the specified R/3 function module. The EXPORTING parameters are declared as import parameters in the function interface and are defined as follows:
3 p1=value1 ... pn=valuen These parameters are passed as field values to the specified R/3 function module.
3 p1.n1=value p1.n2=value2 ... pn.vn=valuen These parameters are passed as elements of a structured parameter (a complex parameter that contains fields). HOST
specifies the network location of the RFC server. The default is localhost.
IMPORTING
passes field values or structures from the specified R/3 function module back to SAS. The IMPORTING parameters are defined as follows:
3 p1=var1 ... pn=varn The p1 ... pn parameters are export parameters declared in the function interface. The var1 ... varn parameters are SAS macro variables that are used to pass the values from the RFC server back to SAS. The macro variables must be defined before the function call is submitted.
3 p1=dataset1 pn=datasetn Parameters that are written into a data set require a two-level data set name. Writing parameters into data sets can be useful for structured parameters. INTABLES
passes references to input SAS data sets. The INTABLES parameters are defined as follows:
Using the RFC Server
4
%CALLRFC
65
3 p1=dataset1 ... pn=datasetn The SAS data sets are converted into internal tables and are passed to the specified function module. Note: The variable names in the SAS data set must match the field names of the internal table as they are defined in the function interface.
4
OUTTABLES
specifies references to output SAS data sets. The OUTTABLES parameters are defined as follows:
3 p1=dataset1 ... pn=datasetn Internal tables passed back to SAS from the specified function module are converted into SAS data sets. PORT
specifies the TCP/IP port to use for communicating with the RFC server. The default port number is 6999.
USING
specifies alternate connection parameters when you log on to the R/3 system. By default, the %CALLRFC macro uses the connection parameters that are defined in the RFC_LOGON_INFO variable. However, if you want to use an alternate set of connection parameters, create a variable that contains those parameters and reference that variable in the USING parameter. Note: The alternate logon variable must be defined before the function call is submitted. 4
Note: If an error occurs while the %CALLRFC macro is executing, the macro variables &SYSRC and/or &SYSERR contain nonzero values. (See “Example 4” on page 67.) The ABAP function module might also contain parameters to return error conditions to the calling program. These return codes can be written into a SAS macro variable and checked in the SAS program. (See “Example 5” on page 67.) 4
Using The following macro variables are used with the %CALLRFC macro:
3 RFC_LOGON_INFO defines the R/3 BAPI connection parameters that are required to access the SAP R/3 system. You can specify these connection parameters by using the RFC_LOGON_INFO macro string or by using the R/3 BAPI Connector window, which is automatically displayed if you do not use the RFC_LOGON_INFO macro string when you submit your %CALLRFC macro statement. The following connection parameters are required:
3 3 3 3 3 3
CLIENT USER PASSWD (or PASSWDX) LANG HOST PORT
Note: If any of the required values are missing, the user is prompted to provide the missing information. 4
66
%CALLRFC
4
Chapter 5
The RFC_LOGON_INFO macro variable also requires some connection information. The connection parameters should be defined as follows: 3 If you use the saprfc.ini, specify the DEST value. 3 If you use a specific application server, specify the ASHOST and SYSNR values. 3 If you use Load Balancing, specify the MSHOST, R3NAME, and GROUP values. Note: Load Balancing is available only if the CALLRFC executable has been linked using Release 4.0 or higher of the RFCSDK.
4
For more information about defining the RFC_LOGON_INFO variable, see “RFC_LOGON_INFO” on page 72. For more information about using the R/3 BAPI Connector window, see “Using the R/3 BAPI Connector: Logon Window” on page 74.
Example 1 The following example shows how to use the %CALLRFC macro to read data from an SAP R/3 system into a SAS data set: %callrfc(RFC_SYSTEM_INFO IMPORTING RFCSI_EXPORT=WORK.RFCSI_EXPORT);
In this example, the %CALLRFC macro calls the RFC-enabled function module named RFC_SYSTEM_INFO and writes the system information output to the SAS data set WORK.RFCSI_EXPORT.
Example 2 The following example shows how to specify the logon parameters for the %CALLRFC macro using the RFC_LOGON_INFO: %let RFC_LOGON_INFO=CLIENT=010 USER=TestUser PASSWD=USERPWD LANG=E HOST=localhost PORT=6999 ASHOST=HostName SYSNR=02; %callrfc(RFC_SYSTEM_INFO IMPORTING RFCSI_EXPORT=WORK.RFCSI_EXPORT);
In this example, TestUser is connecting to a specific application server to read data from the R/3 system into a temporary SAS data set named WORK.RFCSI_EXPORT.
Example 3 The following example demonstrates how to use SAS dates in the function call: %let MRETURN=; %callrfc(BAPI_COSTCENTER_GETLIST EXPORTING CONTROLLINGAREA=1000 DATE=%sysfunc(date (), yymmddn8.) IMPORTING RETURN=MRETURN OUTTABLES COSTCENTER_LIST=WORK.COSTCENTER_LIST);
In this example, the %CALLRFC macro is used to call the function module named BAPI_COSTCENTER_GETLIST. The function call reads the list of cost centers for controlling area 1000 for the current date and writes the output list into a temporary SAS data set named WORK.COSTCENTER_LIST. The return code of the function call is written to the SAS macro variable MRETURN. Note that the macro variable is defined before the %CALLRFC macro is used.
Using the RFC Server
4
%CALLRFC
67
Example 4 The following example illustrates how to use the &SYSRC and &SYSERR macro variables to check for errors that occur while the %CALLRFC macro is executing: %macro example4; %callrfc(INVALID_FUNCTION_CALL); %if %eval(&sysrc) ne 0 or %eval(&syserr) ne 0 %then %do; %put An error occurred while calling the function. %put sysrc=&sysrc syserr=&syserr; %end; %mend; %example4;
In this example, a new macro named %EXAMPLE4 is created. %EXAMPLE4 uses the SAS macro variables &SYSRC and &SYSERR to check return codes from the %CALLRFC macro. The new macro also generates an error message if errors occurred.
Example 5 The following example shows how to use the parameters in the function module to check for errors that occurred during the execution of the %CALLRFC macro: %macro example5; %global bapi_return; /* create the input data set */ data WORK.IDRANGE; sign=’I’; option=’BT’; low=’0000000000’; high=’9999999999’; output; run; %callrfc(BAPI_CUSTOMER_GETLIST IMPORTING RETURN=BAPI_RETURN INTABLES IDRANGE=WORK.IDRANGE OUTTABLES ADDRESSDATA=WORK.ADDRESSES); %if %substr(&bapi_return,1,1)=E or %substr(&bapi_return,1,1)=W %then %do; %put An error occurred while calling the BAPI_CUSTOMER_GETLIST function.; %put bapi_return=&bapi_return; %end; %else %do; proc print data=WORK.ADDRESSEs; run; %end; %mend; %example5;
In this example, a new macro named %EXAMPLE5 is created to retrieve a list of customers from the R/3 system. The range of customer numbers to be retrieved is specified in the SAS data set WORK.IDRANGE. This data set is then used as the input
68
4
%R3CONNB
Chapter 5
table in the function call. The information for customers between customer number 0000000000 and 9999999999 will be read into the SAS data set WORK.ADDRESSES. The function parameters contain return codes and messages from the BAPI_CUSTOMER_GETLIST function. The structure of the return parameter is defined in the function interface. In this example, the first character in the return string contains the message type. E indicates an error message and W indicates a warning message.
%R3CONNB Connects to or disconnects from an R/3 system using a profile Type:
batch macro
Syntax %R3CONNB(PROFILE=value, LIBREF=value, FUNCTION=open | close, ID=value, SOURCE=value)
Details The %R3CONNB macro allows you to log on to and log off of the R/3 system using parameters stored in the data set LIBREF.R3CONN under the profile name. Profiles that connect to and disconnect from the R/3 system can be used for batch operation, such as overnight processing, and to simplify the logon process for end users. The parameters for %R3CONNB are as follows: PROFILE
identifies the name of the profile that contains the information used in the Logon to R/3 window.
LIBREF
identifies the SAS library containing the LIBREF.R3CONN data set. This data set contains the logon parameters defined for the profile.
FUNCTION
specifies whether you want to open or close the connection to the R/3 system. Valid values are
3 OPEN 3 CLOSE ID
specifies the connection ID that is associated with the profile. Note: This parameter was defined for previous versions of this macro and is supported in this release for backward compatibility. However, it is recommended that this parameter not be used. 4
SOURCE
specifies the logon parameters that are defined in SOURCE type catalog entries. Although the SOURCE parameter is supported in this version, logon parameters should now be defined in profiles that are stored in a SAS data set. Note: This parameter was defined for previous versions of this macro and is supported in this release for backward compatibility. However, it is recommended that this parameter not be used. 4
Using the RFC Server
4
%R3CONNC
69
Example 1 The following example shows how to use the %R3CONNB macro to connect to the R/3 system using a profile: %r3connb(PROFILE=BatchUser, LIBREF=batch, FUNCTION=open);
In this example, the profile BatchUser is used to connect to the R/3 system. The BatchUser profile uses the connection parameters stored in the BATCH.R3CONN data set.
Example 2 The following example shows how to use the %R3CONNB macro to disconnect from the R/3 system by using a profile: %r3connb(PROFILE=BatchUser, LIBREF=batch, FUNCTION=close);
The BatchUser profile was used to connect to the R/3 system. This example demonstrates how to use the %R3CONNB macro to close the BatchUser profile’s connection to the R/3 system.
%R3CONNC Connects to an R/3 system Type: batch macro See also: “%R3CONNE” on page 71
Syntax %R3CONNC(CCONN=value, HOST=value, PORT=value, USR=value, PWD=value, CLI=value, LNG=value, HST=value, DST=value, SNA=value, R3=value, SYS=value, GWS=value, GWH=value, FUNC=value, CPICUSR=value, CPICPWD=value, CPICCLI=value, CPICLNG=value, CPICDST=value, CPICFRM=value, DEBUG=value, REMSESS=value)
Details The %R3CONNC macro allows you to connect to an R/3 system. This macro can be used to log on to the R/3 system during batch operation. The parameters for %R3CONNC are as follows: CCONN
specifies the connection identifier to be used when connecting to the R/3 system.
HOST
specifies the name of the TCP/IP host to be used when connecting to the RFC server.
PORT
specifies the TCP/IP port to be used when connecting to the RFC server.
USR
specifies the R/3 user ID to be used when connecting to the R/3 system.
70
%R3CONNC
4
Chapter 5
PWD
specifies the encoded R/3 password to be used when connecting to the R/3 system.
CLI
specifies the R/3 client to be used with the R/3 system.
LNG
specifies the R/3 logon language to be used with the R/3 system.
HST
specifies the R/3 host name to be used when connecting to the R/3 system.
DST
specifies the R/3 destination name to be used when using the SIDEINFO file to specify connection parameters.
SNA
specifies whether the RFC server connects to an R/2 system. Valid values are
3 Y — RFC server connects to an R/2 system. 3 blank — RFC server is not connecting to an R/2 system. R3
specifies whether the RFC server is connecting to an R/3 system. Valid values are
3 Y — RFC server is connecting to an R/3 system. 3 blank — RFC server is not connecting to an R/3 system. SYS
specifies the R/3 system number. This parameter can be specified here or in the SIDEINFO file.
GWS
specifies the TCP service of the SAP gateway. This parameter can be specified here or in the SIDEINFO file.
GWH
specifies the name of the host on which the SAP gateway is running. This parameter can be specified here or in the SIDEINFO file.
FUNC
specifies the R/3 function module to be used.
CPICUSR
specifies the R/3 user identifier for CPIC.
CPICPWD
specifies the encoded R/3 password for CPIC.
CPICCLI
specifies the R/3 client for CPIC.
CPICLNG
specifies the R/3 logon language for CPIC.
CPICDST
specifies the destination for CPIC communication (as defined in the TXCOM table in the R/3 system).
CPICFRM
specifies the form for CPIC.
DEBUG
specifies whether you want to use the trace option. Valid values are
3 Y — Use the trace option. 3 blank — Do not use the trace option. REMSESS
specifies the SAS/CONNECT remote session ID to be used when connecting to the R/3 system.
Note: The SIDEINFO file provides the connection parameters required for the RFC server to communicate with the R/3 system. The SIDEINFO file is not needed if you specify all connection parameters in the %RCONNC macro. 4
Example 1 The following example shows how to use the %R3CONNC macro to connect to an R/3 system when you specify a specific application server:
Using the RFC Server
4
%R3CONNE
71
%r3connc(CCONN=IDES, USR=USER1, PWD=D27A927AD9E768, CLI=800, LNG=EN, HST=HostName1, SYS=02, CPICUSR=CPICUSER, CPICPWD=6FD3E4BAC4);
In this example, USER1 is connecting to an R/3 system on an application server named HostName1 with a system number of 02.
Example 2 The following example shows how to use the %R3CONNC macro to connect to an R/3 system and an RFC server that runs on a specified application server: %r3connc(CCONN=IDES, USR=USER1, PWD=D27A927AD9E768, CLI=800, LNG=EN, HOST=HostName2, PORT=6998, HST=HostName1, SYS=02, CPICUSR=CPICUSER, CPICPWD=6FD3E4BAC4);
In this example, SAS connects to an R/3 application server (HostName1) with the system number of 02 using an RFC server running on a separate host (HOSTNAME2) on port 6998.
Example 3 The following example shows how to use the %R3CONNC macro and a SIDEINFO file to connect to an R/3 system identified by a logical destination: %r3connc(CCONN=IDES, USR=USER1, PWD=D27A927AD9E768, CLI=800, LNG=EN, DST=SYSTEM1, CPICUSR=CPICUSER, CPICPWD=6FD3E4BAC4);
In this example, USER1 is connecting to an R/3 system. The R/3 system is identified by a logical destination (SYSTEM1), and the connection information is defined in the SIDEINFO file.
%R3CONNE Disconnects from an R/3 system Type: batch macro See also: “%R3CONNC” on page 69
Syntax %R3CONNE(CCONN=value, REMSESS=value)
Details The %R3CONNE macro allows you to disconnect from the R/3 system. This macro can be used to log out of the R/3 system during batch operation. The parameters for %R3CONNE are as follows: CCONN
specifies the connection identifier that is associated with the current session.
72
RFC_LOGON_INFO
4
Chapter 5
REMSESS
specifies the SAS/CONNECT remote session identifier that is associated with the current remote session.
Example The following example shows how to use the %R3CONNE macro to disconnect from an R/3 system: %r3conne(CCONN=IDES);
In this example, the %R3CONNE macro is used to terminate the R/3 connection with an ID of IDES.
RFC_LOGON_INFO Defines the connection parameters that are required to access the SAP R/3 system Type:
optional macro variable
Applies to:
%CALLRFC macro
See also:
“%CALLRFC” on page 63 “Using the R/3 BAPI Connector: Logon Window” on page 74
Syntax %let RFC_LOGON_INFO=ID=value ID=value ... ID=value Note:
Values are case-sensitive. IDs are not.
4
Details RFC_LOGON_INFO is a macro variable that is used with the %CALLRFC macro. The RFC_LOGON_INFO variable uses the following parameters: Parameter ID
Description
TYPE
identifies the type of RFC server. Valid values are 2 - identifies an R/2 server 3 - (default) identifies an R/3 server E - identifies an external server.
CLIENT
is a required value that identifies the SAP logon client.
USER
is a required value that specifies the SAP user logon ID.
PASSWD
is a required value that identifies the SAP logon password. This value is not required if a PASSWDX value is specified.
LANG
is a required value that identifies the SAP logon language. Specify the 1-byte SAP language (E for English, D for German, etc.) 2-byte ISO language (EN for English, DE for German, etc.)
Using the RFC Server
Parameter ID LCHECK
4
RFC_LOGON_INFO
73
Description specifies the logon check option at OPEN time. Valid values are 0 - logon without check 1 - (default) logon with check.
TRACE
specifies the RFC trace option. Valid values are 0 - (default) without trace 1 - with trace.
DEST
identifies the logical destination in the saprfc.ini file, if applicable. When you use an R/2 RFC server, you must also define this destination in the SIDEINFO file for the SAP gateway. This value is required when you use the saprfc.ini.
GWHOST
specifies the host name of the SAP gateway if you use an R/2 or external RFC server.
GWSERV
identifies the service of the SAP gateway if you use an R/2 or external RFC server.
MSHOST
specifies the host name of the message server if you use Load Balancing. This value is required if you use Load Balancing.
R3NAME
specifies the name of the R/3 system if you use Load Balancing. This value is required if you use Load Balancing.
GROUP
specifies the name of the group of application servers if you use Load Balancing. This value is required if you use Load Balancing.
ASHOST
identifies the host name of the specific application server to be used. This value is required if you use a specific application server.
SYSNR
identifies the R/3 system number if you use a specific application server and do not use Load Balancing. This value is required if you use a specific application server.
ABAP_DEBUG
specifies the ABAP debugger option. Valid values are 0 - (default) run without the ABAP debugger 1 - run with the ABAP debugger. Note: If you use the ABAP_DEBUG option, the SAP GUI must be installed.
PASSWDX
identifies the SAS-encrypted SAP logon password.
Example 1 The following example shows how to specify logon information for the %CALLRFC macro using the RFC_LOGON_INFO macro variable: %let RFC_LOGON_INFO CLIENT=010 USER=USER1 PASSWD=USERPWD LANG=E MSHOST=HostName R3NAME=BIN GROUP=Public; %callrfc(RFC_SYSTEM_INFO IMPORTING RFCSI_EXPORT=WORK.RFCSI_EXPORT);
In this example, USER1 is connecting to a server that uses Load Balancing to read R/3 data into a temporary data set called WORK.RFCSI_EXPORT.
74
Using the R/3 BAPI Connector: Logon Window
4
Chapter 5
Example 2 The following example shows how to specify logon information for the %CALLRFC macro using the RFC_LOGON_INFO macro variable: %let RFC_LOGON_INFO=CLIENT=010 USER=USER1 PASSWD=USERPWD LANG=E ASHOST=HostName SYSNR=02; %callrfc(RFC_SYSTEM_INFO IMPORTING RFCSI_EXPORT=WORK.RFCSI_EXPORT);
In this example, USER1 is connecting to a specific application server to read R/3 data into a temporary data set called WORK.RFCSI_EXPORT.
Using the R/3 BAPI Connector: Logon Window The R/3 BAPI Connector: Logon window is automatically displayed if you do not use the RFC_LOGON_INFO macro string when you submit your %CALLRFC macro statement. The R/3 BAPI Connector: Logon window enables you to define the R/3 BAPI connection parameters that are required to access the SAP R/3 system.
Display 5.1 R/3 BAPI Connector: Logon Window
For more information about the %CALLRFC macro, see “%CALLRFC” on page 63. For more information about using the RFC_LOGON_INFO macro string, see “RFC_LOGON_INFO” on page 72. The following fields are available on the R/3 BAPI Connector: Logon window: Client
enables you to identify the SAP logon client. This field is required.
User
enables you to identify the SAP user logon ID. This field is required.
Password
enables you to enter the SAP user password. This field is required.
Language
enables you to specify the SAP logon language. Specify the 1–byte SAP language (E for English, D for German, and so on) or the
Using the RFC Server
4
Using the R/3 BAPI Connector: Logon Window
75
2–byte ISO language (EN for English, DE for German, and so on). This field is required. Destination
enables you to identify the logical destination of the saprfc.ini file, if applicable. When you use an R/2 RFC server, you must also define this information in the sideinfo file for the SAP gateway. This field is required if you use the saprfc.ini. For more information about the sideinfo file, see “Sideinfo File” on page 22.
Host
enables you to identify the application server host. This field is required if a specific application server will be used.
System number
enables you to identify the R/3 system number if you are using a specific application server and are not using Load Balancing. This field is required if you use a specific application server.
Gateway host
enables you to identify the host name of the SAP gateway if you use an R/2 or external RFC server.
Gateway service
enables you to identify the service of the SAP gateway if you use an R/2 or external RFC server.
The following buttons are available on the R/3 BAPI Connector: Logon window: OK
submits the R/3 BAPI connection parameters that you entered and attempts to log on to the R/3 system.
Cancel
closes the R/3 BAPI Connector: Logon window without submitting the connection paramaters and attempting to logon to the R/3 system.
Help
displays the SAS Help for the window.
76
77
CHAPTER
6 Using the LIBNAME Statement for SAP Overview of the LIBNAME Engine for SAP 77 LIBNAME Statement Syntax for SAP 77 SAP LIBNAME Engine Options 78 SAS LIBNAME Statement Options for the SAP Engine 87 SAS Data Set Options for the SAP Engine 92 Examples 95 Example 1 — Accessing the SAP Server From a Local Host 95 Example 2 — Changing the User Logon Language 96 Example 3 — Defining an SAP Destination from the SAP Logon Utility Example 4 — Defining an SAP Destination from the saprfc.ini File 96
96
Overview of the LIBNAME Engine for SAP The SAP LIBNAME engine is a read-only engine that allows you to access tables and views from SAP R/3 and SAP BW systems. The SAP LIBNAME engine accesses an SAP system through a connection to the SAS RFC server and is part of the SAS solution to access data in a SAP system. When a connection to the SAP system is successfully established and you are logged on to the system, the RFC server sends system information back to the LIBNAME engine. The 9.1 SAP LIBNAME engine supports new features such as load balancing, user validation at log on, more efficient handling of projections, and server-side joins. Directory processing is also supported. Note: Unlike other library engines, these interfaces are read-only and do not support any forms of data set creation, deletion, or modification. 4
LIBNAME Statement Syntax for SAP LIBNAME libref R3 ; libref
specifies a valid SAS name that serves as an alias to associate SAS with the SAP tables and view. It is any SAS name when you are assigning a new libref.
R3
explicitly specifies the R/3 library engine.
names one or more options honored by the R/3 engine, delimited with blanks.
The SAP LIBNAME statement assigns a library and allows the SAP engine to establish the connection to the SAP system. It checks (by default) the logon information
78
SAP LIBNAME Engine Options
4
Chapter 6
including: user, password, language, and client. This is done by establishing the connection to the RFC server and sending the logon information to the RFC server. A user specifies a LIBNAME statement for the engine, and then can use that libref throughout SAS, wherever a libref is valid.
SAP LIBNAME Engine Options The following LIBNAME options apply to the SAP LIBNAME Engine. ABAPFM=“ABAPFM= abap_function_name ”on page 78 ABAPPROG=“ABAPPROG= abap_program ”on page 79 ASHOST=“ASHOST= application_server_host” on page 79 BATCH=“BATCH= 0|1|Y|N ”on page 79 CLIENT=“CLIENT= client” on page 80 DESTINATION=“DESTINATION= destination” on page 80 GROUP=“GROUP= application_server_group ”on page 80 GWHOST=“GWHOST= gateway_host_name ”on page 81 GWSERV=“GWSERV= gateway_service ”on page 81 HOST=“HOST= rfc_server_host” on page 81 IEEE_REVERSE=“IEEE_REVERSE= Y|N” on page 82 INENCODING =“INENCODING = code_page” on page 82 LANGUAGE =“LANGUAGE = language” on page 82 MAX_TABLE_JOINS =“MAX_TABLE_JOINS = number ”on page 83 MSHOST=“MSHOST= message_server_host ”on page 83 NUMC_SAS_TYPE =“NUMC_SAS_TYPE = N|C|$” on page 83 PASSWORD=“PASSWORD= password” on page 84 PASSWORDX=“PASSWORDX= encrypted-password” on page 84 PORT=“PORT= rfc_server_port ”on page 85 R3NAME=“R3NAME= system_name ”on page 85 RFC_STRING=“RFC_STRING= additional_rfc_options ”on page 85 SAPLOGON_ID=“SAPLOGON_ID= saplogon_id” on page 86 SYSNR=“SYSNR= system_number” on page 86 TRACE=“TRACE= 0 |1|Y|N” on page 86 USER=“USER= user” on page 87
ABAPFM= abap_function_name Indicates the name of the ABAP function module that the RFC server uses internally Valid in:
SAS/ACCESS LIBNAME statement for SAP /SAS/Z_SAS_DIALOG
Default value:
Syntax ABAPFM | ABAPFUNCTION | ABAPFUNC = abap_function_name
Using the LIBNAME Statement for SAP
4
BATCH= 0|1|Y|N
79
Indicates the name of the ABAP function module that the RFC server uses internally. The default value for this option is /SAS/Z_SAS_DIALOG and is set by the RFC server.
ABAPPROG= abap_program Indicates the name of the ABAP program that the RFC server uses internally Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value: /SAS/Z_SAS_READ
Syntax ABAPPROG | ABAPREPORT |ABAPPROGRAM = abap_program Indicates the name of the ABAP program that the RFC server uses internally. The default value for this option is /SAS/Z_SAS_READ and is set by the ABAP function module.
ASHOST= application_server_host Indicates the host name or IP address of a specific SAP application server Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value: none
Syntax ASHOST| HST |RFCHOST |R3HOST = application_server_host Indicates the host name or IP address of a specific SAP application server.
BATCH= 0|1|Y|N Indicates whether the RFC server should use SAP batch jobs for the data extracts Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value: N
Syntax BATCH | BATCH_MODE | BATCHMODE = 0|1|Y|N
80
CLIENT= client
4
Chapter 6
Y
specifies that the RFC uses batch jobs to extract R/3 data. N
specifies that the RFC uses dialog processes to extract R/3 data. Indicates whether the RFC server should use SAP batch jobs for the data extracts. The default value for this option is N.
CLIENT= client Specifies the SAP logon parameter client Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value:
SAP system default
Syntax CLIENT| CLI | RFCCLIENT | RFCCLI = client Indicates the SAP logon parameter client. Examples for a client are 000 or 800. The default value for this option is the SAP system default. When accessing the SAP R/3 system or the SAP BW system via the LIBNAME engine, you must specify valid logon information including client, user name, password, and language. The RFC server performs a logon check at OPEN time.
DESTINATION= destination Indicates the destination in saprfc.ini if working with saprfc.ini SAS/ACCESS LIBNAME statement for SAP Default value: none Valid in:
Syntax DESTINATION | DEST| DST | DSTN = destination Indicates the destination in saprfc.ini if working with saprfc.ini. If the RFC server is an R/3 system, then this destination must also be defined in the SIDEINFO file for the SAP gateway.
GROUP= application_server_group Indicates the name of the group of SAP application servers Valid in:
SAS/ACCESS LIBNAME statement for SAP
Using the LIBNAME Statement for SAP
4
HOST= rfc_server_host
Default value: none
Syntax GROUP= application_server_group Indicates the name of the group of SAP application servers if using load balancing.
GWHOST= gateway_host_name Indicates the host name of the SAP gateway SAS/ACCESS LIBNAME statement for SAP Default value: none Valid in:
Syntax GWHOST |GATEWAY_HOST = gateway_host_name Indicates the host name of the SAP gateway.
GWSERV= gateway_service Indicates the service of the SAP gateway Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value: none
Syntax GWSERV| GATEWAY_SERVICE = gateway_service Indicates the service of the SAP gateway.
HOST= rfc_server_host Indicates the host of the RFC server to be used to connect to the SAP system Valid in:
SAS/ACCESS LIBNAME statement for SAP localhost
Default value:
Syntax HOST | RFC_SERVER_HOST | RFC_SERVER | SASRFC_SERVER | SASRFC_SERVER_HOST = rfc_server_host
81
82
IEEE_REVERSE= Y|N
4
Chapter 6
Indicates the host of the RFC server to be used to connect to the SAP system. The default value for this option is localhost.
IEEE_REVERSE= Y|N Indicates whether floating point numbers are byte reversed SAS/ACCESS LIBNAME statement for SAP Default value: Y or N depending on platform Valid in:
Syntax IEEE_REVERSE = Y|N
Y
Indicates that floating point numbers are byte reversed. N
Indicates that floating point numbers are not byte reversed. Indicates whether floating point numbers are byte reversed. The default value for this option is Y for an R/3 application server on Windows NT, and N for the other platforms.
INENCODING = code_page Indicates the code page SAS/ACCESS LIBNAME statement for SAP Default value: none Valid in:
Syntax INENCODING = code_page Indicates the code page. The code page identifies characters and symbols that can be printed, displayed on terminals, and used in SAP programs.
LANGUAGE = language Indicates the SAP logon parameter language SAS/ACCESS LIBNAME statement for SAP Default value: SAP system default Valid in:
Using the LIBNAME Statement for SAP
4
NUMC_SAS_TYPE = N|C|$
83
Syntax LANGUAGE | LANG | LNG |RFCLANG |RFCLNG = language Indicates the SAP logon parameter language. The value for language is either the 2-byte ISO-language key or the 1-byte SAP language. Examples for the language include EN, DE or E, D. The default value for this option is the SAP system default. When accessing the SAP R/3 system or the SAP BW system via the LIBNAME engine, you must specify valid logon information including client, user name, password and language. The RFC server performs a logon check at OPEN time.
MAX_TABLE_JOINS = number Indicates the number of tables that can be used in a left-outer join or an inner join in ABAP Open SQL SAS/ACCESS LIBNAME statement for SAP Default value: 25 Valid in:
Syntax MAX_TABLE_JOINS | MAX_TABLES_JOIN | MAX_TABLES_JOINS |MAX_TABLE_JOIN = number Indicates the number of tables that can be used in a left-outer join or an inner join in ABAP Open SQL. The default value for this option is 25.
MSHOST= message_server_host Indicates the host name of the message server SAS/ACCESS LIBNAME statement for SAP Default value: none Valid in:
Syntax MSHOST= message_server_host Indicates the host name of the message server (if using load balancing).
NUMC_SAS_TYPE = N|C|$ Indicates the SAS type for ABAP type NUMC Valid in:
SAS/ACCESS LIBNAME statement for SAP
84
PASSWORD= password
4
Chapter 6
Default value:
C
Syntax NUMC_SAS_TYPE | NUMC_SASTYPE | NUMC_TYPE |NUMC = N|C|$
N
Number C
Character $
Character Indicates the SAS type for ABAP type NUMC. The default is C.
PASSWORD= password Indicates the SAP logon parameter password Valid in:
SAS/ACCESS LIBNAME statement for SAP none
Default value:
Syntax PASSWORD | PASSWD |PWD |PW|PASS = password Indicates the SAP logon parameter password. When accessing the SAP R/3 system or the SAP BW system via the LIBNAME engine, you must specify valid logon information including client, user name, password and language. The RFC server performs a logon check at OPEN time.
PASSWORDX= encrypted-password Indicates the SAP logon parameter password in an encrypted form SAS/ACCESS LIBNAME statement for SAP Default value: none Valid in:
Syntax PASSWORDX | PASSWDX |PWDX |PWX | PASSX= encrypted password Indicates the SAP logon parameter password in an encrypted form. It uses the encryption type that is used in the SAS/ACCESS Interface to R/3, Version 8. It is supported for compatibility with the Version 8 connection profile.
Using the LIBNAME Statement for SAP
4
RFC_STRING= additional_rfc_options
PORT= rfc_server_port Indicates the port number of the RFC server to be used to connect to the SAP system Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value: 6999
Syntax PORT | RFC_SERVER_PORT | RFCSERVERPORT | SASRFC_SERVER_PORT | SASRFCSERVERPORT = rfc_server_port Indicates the port number of the RFC server to be used to connect to the SAP system. The default value for this option is 6999.
R3NAME= system_name Indicates the name of the R/3 system Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value: none
Syntax R3NAME= system_name Indicates the name of the R/3 system (if using load balancing).
RFC_STRING= additional_rfc_options Indicates additional logon or connection parameters for the RfcOpenEx() call Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value: none
Syntax RFC_STRING | RFCSTRING | RFC_OPTIONS_EXT | RFCOPENEX | ADDITIONAL_RFC_OPTIONS = additional_rfc_options Indicates additional log on or connection parameters for the RfcOpenEx() call. The RFC server uses the RfcOpenEx() call to log on to the SAP system. With this option, parameters that are not LIBNAME options can be passed to the RfcOpenEx() call.
RFC_STRING Example RFC_STRING = "ABAP_DEBUG=1"
85
86
SAPLOGON_ID= saplogon_id
4
Chapter 6
Note: When using RFC_STRING="ABAP_DEBUG=1", the ABAP debugger is invoked to debug the ABAP programs used by the engine. The SAP GUI on the RFC server host is required to use the ABAP_DEBUG=1 option. 4
SAPLOGON_ID= saplogon_id Indicates the string defined for SAPLOGON on 32-bit Windows SAS/ACCESS LIBNAME statement for SAP Default value: none Valid in:
Syntax SAPLOGON_ID= saplogon_id Indicates the string defined for SAPLOGON on 32-bit Windows.
SYSNR= system_number Indicates the R/3 system number SAS/ACCESS LIBNAME statement for SAP Default value: none Valid in:
Syntax SYSNR |SYS |SYSTEM |SYSNO = system_number Indicates the R/3 system number. It is the 2-byte code that identifies the system on the host. For example: 00 or 01.
TRACE= 0 |1|Y|N Indicates whether the RFC server should trace the requests SAS/ACCESS LIBNAME statement for SAP Default value: 0 Valid in:
Syntax TRACE= 0 |1|Y|N
0
Using the LIBNAME Statement for SAP
4
SAS LIBNAME Statement Options for the SAP Engine
87
Specifies that RFC trace is switched off. 1
Specifies that RFC trace is switched on. Y
Specifies that RFC trace is switched on. N
Specifies that RFC trace is switched off. Indicates whether the RFC server should trace the requests. If the trace option is switched on, the RFC server writes log information into a file. The RFC library logs messages in the file dev_rfc. The default value for this option is 0.
USER= user Indicates the SAP logon parameter user. Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value: none
Syntax USER | USR |RFCUSER |USERNAME |USERID= user When accessing the SAP R/3 system or the SAP BW system via the LIBNAME engine, you must specify valid logon information including the client, user name, password, and language. The RFC server performs a logon check at OPEN time.
SAS LIBNAME Statement Options for the SAP Engine The following list describes the SAP interface support for SAS /ACCESS LIBNAME options and presents default values where applicable. For further information, refer to the SAS/ACCESS 9.1 for Relational Databases: Reference. CONNECTION=“CONNECTION= LIBNAME Option” on page 88 CONNECTION_GROUP=“CONNECTION_GROUP= LIBNAME Option” on page 88 DBGEN_NAME=“DBGEN_NAME= LIBNAME Option” on page 88 DBPROMPT=“DBPROMPT= LIBNAME Option” on page 89 DBSASLABEL=“DBSASLABEL= COMPAT | NONE | DBMS ”on page 89 DEFER=“DEFER= LIBNAME Option” on page 90 DIRECT_SQL=“DIRECT_SQL= LIBNAME Option” on page 90 MULTI_DATASRC_OPT=“MULTI_DATASRC_OPT= LIBNAME Option” on page 90 REREAD_EXPOSURE=“REREAD_EXPOSURE= LIBNAME Option” on page 91 SPOOL=“SPOOL= LIBNAME Option” on page 91
88
CONNECTION= LIBNAME Option
4
Chapter 6
CONNECTION= LIBNAME Option Specifies whether operations against a single libref share a connection to the DBMS, and whether operations against multiple librefs share a connection to the DBMS Valid in:
SAS/ACCESS LIBNAME statement
DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata, SAP
DBMS support: Default value:
DBMS-specific. The default value for SAP is SHAREDREAD
Syntax CONNECTION= SHAREDREAD | UNIQUE | GLOBALREAD | For more information about the CONNECTION= option, see the LIBNAME statement for relational databases in the SAS/ACCESS 9.1 for Relational Databases: Reference.
CONNECTION_GROUP= LIBNAME Option Causes operations against multiple librefs to share a connection to the DBMS. Also causes operations against multiple pass-through facility CONNECT statements to share a connection to the DBMS Valid in:
SAS/ACCESS LIBNAME statement
DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata
DBMS support: Default value:
none
Syntax CONNECTION_GROUP= connection-group-name For more information about the CONNECTION_GROUP= option, see the LIBNAME statement for relational databases in the SAS/ACCESS 9.1 for Relational Databases: Reference.
DBGEN_NAME= LIBNAME Option Specifies whether to automatically rename DBMS columns containing characters that SAS does not allow, such as $, to valid SAS variable names Valid in:
SAS/ACCESS LIBNAME statement
DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata
DBMS support:
Using the LIBNAME Statement for SAP
4
DBSASLABEL= COMPAT | NONE | DBMS
89
Default value: DBMS
Syntax DBGEN_NAME= DBMS | SAS For more information about the DBGEN_NAME= option, see the LIBNAME statement for relational databases in the SAS/ACCESS 9.1 for Relational Databases: Reference.
DBPROMPT= LIBNAME Option Specifies whether SAS displays a window that prompts the user to enter DBMS connection information prior to connecting to the DBMS in interactive mode Valid in:
SAS/ACCESS LIBNAME statement
DB2 UNIX/PC, Informix, ODBC, Oracle, Microsoft SQL Server, SYBASE, Teradata
DBMS support:
Default value: NO
Syntax DBPROMPT=YES | NO For more information about the DBPROMPT= option, see the LIBNAME statement for relational databases in the SAS/ACCESS 9.1 for Relational Databases: Reference.
DBSASLABEL= COMPAT | NONE | DBMS Indicates to the engine what column labels the application expects to be returned Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value: COMPAT
Syntax DBSASLABEL= COMPAT | NONE
COMPAT
specifies that the column labels are compatable with the engine’s behavior in previous SAS releases. The SAP engine returns the short descriptive text for the columns of the SAP table. It reads the column label from the SAP data dictionary. This is the default value.
NONE
specifies that no column label information is returned.
90
DEFER= LIBNAME Option
4
Chapter 6
For more information about the DBPROMPT= option, see the LIBNAME statement for relational databases in the SAS/ACCESS 9.1 for Relational Databases: Reference.
DEFER= LIBNAME Option Specifies when the connection to the DBMS occurs SAS/ACCESS LIBNAME statement DBMS support: DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata Default value: NO Valid in:
Syntax DEFER= NO | YES For more information about the DEFER= option, see the LIBNAME statement for relational databases in the SAS/ACCESS 9.1 for Relational Databases: Reference.
DIRECT_SQL= LIBNAME Option Enables you to specify whether generated SQL is passed to the DBMS for processing SAS/ACCESS LIBNAME statement DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata Default value: YES
Valid in:
DBMS support:
Syntax DIRECT_SQL= YES | NO | NONE | NOGENSQL | NOWHERE |NOFUNCTIONS |NOMULTOUTJOINS For more information about the DIRECT_SQL= option, see the LIBNAME statement for relational databases in the SAS/ACCESS 9.1 for Relational Databases: Reference.
MULTI_DATASRC_OPT= LIBNAME Option Used in place of DBKEY to improve performance when processing a join between two data sources SAS/ACCESS LIBNAME statement DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata Default value: NONE
Valid in:
DBMS support:
Using the LIBNAME Statement for SAP
4
SPOOL= LIBNAME Option
91
Syntax MULTI_DATASRC_OPT=NONE |IN_CLAUSE For more information about the MULTI_DATASRC_OPT= option, see the LIBNAME statement for relational databases in the SAS/ACCESS 9.1 for Relational Databases: Reference.
REREAD_EXPOSURE= LIBNAME Option Specifies whether the SAS/ACCESS engine behaves like a random access engine for the scope of the LIBNAME statement Valid in:
SAS/ACCESS LIBNAME statement
DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata
DBMS support:
Default value: NO
Syntax REREAD_EXPOSURE= NO | YES For more information about the REREAD_EXPOSURE= option, see the LIBNAME statement for relational databases in the SAS/ACCESS 9.1 for Relational Databases: Reference.
SPOOL= LIBNAME Option Specifies whether SAS creates a utility spool file during read transactions that read data more than once Valid in:
SAS/ACCESS LIBNAME statement
DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata
DBMS support:
Default value: YES
Syntax SPOOL= YES | NO For more information about the SPOOL= option, see the LIBNAME statement for relational databases in the SAS/ACCESS 9.1 for Relational Databases: Reference.
92
SAS Data Set Options for the SAP Engine
4
Chapter 6
SAS Data Set Options for the SAP Engine The following list describes the SAP interface support for SAS /ACCESS data set options and presents default values where applicable. For further information, refer to the SAS/ACCESS 9.1 for Relational Databases: Reference BATCH=“BATCH= 0|1|Y|N ”on page 92 DBCONDITION=“DBCONDITION= Data Set Option” on page 92 DBGEN_NAME=“DBGEN_NAME= Data Set Option” on page 93 DBKEY=“DBKEY= Data Set Option” on page 93 DBMASTER=“DBMASTER= Data Set Option” on page 94 NULLCHAR=“NULLCHAR= Data Set Option” on page 94 NULLCHARVAL=“NULLCHARVAL= Data Set Option” on page 94 REREAD_EXPOSURE=“REREAD_EXPOSURE= Data Set Option” on page 95
BATCH= 0|1|Y|N Indicates whether the RFC server should use SAP batch jobs for the data extracts Valid in:
SAS/ACCESS LIBNAME statement for SAP
Default value:
N
Syntax BATCH | BATCH_MODE | BATCHMODE = 0|1|Y|N
Y
RFC uses batch jobs to extract R/3 data. N
RFC uses dialog processes to extract R/3 data. Indicates whether the RFC server should use SAP batch jobs for the data extracts. The default value for this option is N. Note:
The BATCH= option is SAP specific.
4
DBCONDITION= Data Set Option Specifies criteria for subsetting and ordering DBMS data Valid in:
DATA and PROC steps (when accessing DBMS data using SAS/ACCESS
software) DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata
DBMS support:
Using the LIBNAME Statement for SAP
4
DBKEY= Data Set Option
93
Default value: none
Syntax DBCONDITION="DBMS-SQL-query-clause" For more information about the DBCONDITION= option, see the data set options for relational databases section in the SAS/ACCESS 9.1 for Relational Databases: Reference.
DBGEN_NAME= Data Set Option Specifies whether to rename columns automatically when they contain characters that SAS does not allow Valid in:
DATA and PROC steps (when accessing DBMS data using SAS/ACCESS
software) DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata Default value: DBMS
DBMS support:
Syntax DBGEN_NAME=DBMS | SAS For more information about the DBGEN_NAME= option, see the data set options for relational databases section in the SAS/ACCESS 9.1 for Relational Databases: Reference.
DBKEY= Data Set Option Can improve performance when processing a join that involves a large DBMS table and a small SAS data set or DBMS table (by specifying a key column to optimize DBMS retrieval) Valid in:
DATA and PROC steps (when accessing DBMS data using SAS/ACCESS
software) DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata Default value: none
DBMS support:
Syntax DBKEY=(column-1 ) For more information about the DBKEY= option, see the data set options for relational databases section in the SAS/ACCESS 9.1 for Relational Databases: Reference.
94
DBMASTER= Data Set Option
4
Chapter 6
DBMASTER= Data Set Option Used to designate which table is the larger table when you are processing a join that involves tables from two different types of databases Valid in:
DATA and PROC steps (when accessing DBMS data using SAS/ACCESS
software) DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata
DBMS support: Default value:
none
Syntax DBMASTER=YES For more information about the DBMASTER= option, see the data set options for relational databases section in the SAS/ACCESS 9.1 for Relational Databases: Reference.
NULLCHAR= Data Set Option Indicates how SAS character missing values are handled during insert, update, DBINDEX=, and DBKEY= processing Valid in:
DATA and PROC steps (when accessing DBMS data using SAS/ACCESS
software) DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata
DBMS support: Default value:
SAS
Syntax NULLCHAR= SAS | YES | NO For more information about the NULLCHAR= option, see the data set options for relational databases section in the SAS/ACCESS 9.1 for Relational Databases: Reference.
NULLCHARVAL= Data Set Option Defines the character string that replaces SAS character missing values during insert, update, DBINDEX=, and DBKEY= processing Valid in:
software)
DATA and PROC steps (when accessing DBMS data using SAS/ACCESS
Using the LIBNAME Statement for SAP
4
Example 1 — Accessing the SAP Server From a Local Host
95
DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata
DBMS support:
Default value: a blank character
Syntax NULLCHARVAL=’character-string’ For more information about the NULLCHARVAL= option, see the data set options for relational databases section in the SAS/ACCESS 9.1 for Relational Databases: Reference.
REREAD_EXPOSURE= Data Set Option Specifies whether the SAS/ACCESS engine behaves like a random access engine for the scope of the LIBNAME statement Valid in:
SAS/ACCESS LIBNAME statement
DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle, Microsoft SQL Server, SYBASE, Teradata
DBMS support:
Default value: NO
Syntax REREAD_EXPOSURE= NO | YES For more information about the REREAD_EXPOSURE= option, see the LIBNAME statement for relational databases section in the SAS/ACCESS 9.1 for Relational Databases: Reference.
Examples
Example 1 — Accessing the SAP Server From a Local Host In this example, the RFC server has been started on the local host on port 6998. You want to access the SAP system on sapr3srv.sup.com. The system number for the system is 03. You specify the entire set of user information, for example, client, user, password, and language. libname mylib r3 user=TEST password=MYPASS client=800 language=EN ashost=sapr3srv.sup.com sysnr=03 host=localhost port=6998;
Note: If the RFC server has been started on the SAS system host on port 6999, you do not need to define the host or port because 6999 is the default. 4
96
Example 2 — Changing the User Logon Language
4
Chapter 6
Example 2 — Changing the User Logon Language In this example, the RFC server has been started on betaguys on port 6994. You want to access the BW system on whjapp01 and the system number is 06. This time you want to log on using the German language. If you log on using that language, the column labels will all be in German. libname bwides r3 user=Test password=pwd client=800 language=DE ashost=whjapp01 sysnr=06 host=betaguys port=6994;
Example 3 — Defining an SAP Destination from the SAP Logon Utility In this example, the RFC server is running on the local host on port 6999. This is the default. The SAP system you want to access is defined as SI9 in the SAP logon utility. libname mylib r3 user=test password=secret client=800 language=E saplogon_id=SI9;
Example 4 — Defining an SAP Destination from the saprfc.ini File In this example, the RFC server is running on the local host on port 6999. This is the default. The SAP system you want to access is defined by the logical destination bwides in the file saprfc.ini. libname mylib r3 user=test password=secret client=800 language=EN destination=bwides;
97
APPENDIX
1 Recommended Reading Recommended Reading
97
Recommended Reading Here is the recommended reading list for this title: 3 Doing More with SAS/ASSIST 3 Getting Started with the SAS System 3 SAS/AF Procedure Guide
3 3 3 3 3 3 3 3 3
SAS/FSP Procedures Guide SAS Language Reference: Concepts SAS Language Reference: Dictionary SAS Macro Language: Reference SAS/Warehouse Administrator Metadata API Reference SAS/Warehouse Administrator User’s Guide Step-by-Step Programming with Base SAS Software Getting Started with SAS/ASSIST SAS® Companion that is specific to your operating environment.
For a complete list of SAS publications, see the current SAS Publishing Catalog. To order the most current publications or to receive a free copy of the catalog, contact a SAS representative at SAS Publishing Sales SAS Campus Drive Cary, NC 27513 Telephone: (800) 727-3228* Fax: (919) 677-8166 E-mail: [email protected] Web address: support.sas.com/pubs * For other SAS Institute business, call (919) 677-8000. Customers outside the United States should contact their local SAS office.
98
99
Glossary ABAP
Advanced Business Applications Programming. ABAP is a fourth-generation programming language that is used for developing SAP R/3 client/server applications. Communications Interface
an interface through which various types of R/3 communication can occur. R/3 communicates with all systems that comply with Open Systems architecture. The Communications Interface enables users to work transparently with data from any one of several database management systems in any one of several operating environments. The Communications Interface also enables users to run R/3 in multiple operating environments. CPI-C
Common Programming Interface-Communications. An application-level interface for direct program-to-program communication. CPI-C is not used in 9.1 and later versions of the SAS/ACCESS Interface to R/3. data dictionary
in R/3 applications, a central repository that stores metadata about the data sources, such as a database that contains information about company expenses and company profits or a database that contains human resources information. The data dictionary also stores information about the applications that use the data sources. data model
a collection of data that is relevant to a particular facet of a specific business, such as finance or materials management. A data model can contain other data models. A data model is used to organize potentially complex relationships between entity types and other data models. DATA step
a group of statements in a SAS program that begins with a DATA statement and ends with either a RUN statement, another DATA statement, a PROC statement, the end of the job, or the semicolon that immediately follows lines of data. The DATA step enables you to read raw data or other SAS data sets and to use programming logic to create a SAS data set, to write a report, or to write to an external file. Database Interface
in SAP R/3, a logical application layer that is used to transport data between one or more physical databases and the R/3 applications. The R/3 Database Interface
100 Glossary
translates R/3 SQL statements into pure SQL statements and enables R/3 to access data that is in other database formats. entity
in SAP R/3 applications, an abstract or physical object, such as ’’Mr. Brown’’ or ’’Division Management Subsystem’’ that represents the smallest collection of data that has meaning within a business. An entity is categorized according to its entity type properties. See also entity type. entity type
in R/3 applications, a category of entities that have the dame definable characteristics. The definable characteristics are called attributes. Multiple entity types can be grouped into a single table. See also entity. ERP (Enterprise Resource Planning) system
an integrated application that controls day-to-day business operations such as inventory, sales, finance, human resources, and distribution. From the warehousing perspective, ERP systems differ from standard databases in that they have predefined data models that must be understood in order to successfully extract the data. format
a pattern that SAS uses to determine how the values of a variable should be written or displayed. SAS provides a set of standard formats and also enables you to define your own formats. library reference
See libref. libref
a name that is temporarily associated with a SAS data library. For example, in the name SASUSER.ACCOUNTS, the name SASUSER is the libref. You assign a libref with a LIBNAME statement or with an operating system’s command. observation
a row in a SAS data set. All of the data values in an observation are associated with a single entity such as a customer or a state. Each observation contains one data value for each variable. ODD
an operational data definition. A metadata record that provides access to a data source. ODDs are used for loading data into data stores in your warehouse. PROC step
a group of SAS statements that call and execute a procedure. A PROC step usually takes a SAS data set as input. R/3
an enterprise resource planning (ERP) system that has been developed by SAP AG for use in client/server environments. RFC
Remote Function Call. The RFC is the SAP AG implementation of a remote procedure call. RFCs enable external applications such as SAS and R/3 systems to access SAP BW and R/3 systems. SAS data library
a collection of one or more SAS files that are recognized by SAS and that are referenced and stored as a unit. Each file is a member of the library. SAS data set
a file whose contents are in one of the native SAS file formats. There are two types of SAS data sets: SAS data files and SAS data views. SAS data files contain data
Glossary 101
values in addition to descriptor information that is associated with the data. SAS data views contain only the descriptor information plus other information that is required for retrieving data values from other SAS data sets or from files whose contents are in other software vendors’ file formats. sideinfo file
a text file that can be used to set logon parameters, such as RFC host, system number, gateway service, and gateway host, for R/3 users. variable
a column in a SAS data set. Each column contains data values that describe a single characteristic for all observations. view
a definition of a virtual data set. The definition is named and stored for later use. A view contains no data; it merely describes or defines data that is stored elsewhere.
102
Index 103
Index A ABAP Function module 12 name specification 79 ABAP function modules and programs RFC server 57 ABAP Open SQL number of tables 83 ABAP program name RFC server 79 ABAP Report module 12 ABAP type NUMC SAS type for 84 ABAP Where Expression Builder window 46 ABAPFM= option LIBNAME statement for SAP 79 ABAPPROG= option LIBNAME statement for SAP 79 Advanced Parameters window 19 General tab 20 RFC tab 21 sideinfo file 22 TCP/IP tab 20 All Entity Types tab 27 Application Setup window 22 Data Dictionary tab 24 Defaults tab 23 Miscellaneous tab 24 ASHOST= option LIBNAME statement for SAP 79 Assigned Tables tab 28 Attributes for a Table (Edit) window 42 Fields tab 44 General Attributes tab 43 Related Tables tab 44 Select Fields for a Table window 45 Where tab 44 Attributes tab 28
B BAPI connection parameters 74 BATCH= data set option 92 batch jobs for data extracts 79, 92 batch mode RFC server in 62 batch operations 53 passwords 54
source parameter 54 BATCH= option LIBNAME statement for SAP 79
C %CALLRFC macro 64 catalog entries 39 CLIENT= option LIBNAME statement for SAP 80 code page 82 connecting to R/3 systems 69 CONNECTION= option LIBNAME statement for SAP 88 connection parameters 72 CONNECTION_GROUP= option LIBNAME statement for SAP 88 Connections menu Datamodel Explorer window 32 Logon to R/3 window 19 Create Extract Programs window 40
D data access methods 11 direct access 11 extract management method 12, 13 ODBC 11 parameters for 22 R/3 11 Remote Function Call (RFC) 12 data dictionary local copy of 24 location of 24 search facility 51 Data Dictionary Search Facility window 51 Options tab 52 Search String tab 52 Data Dictionary tab 24 data extracts batch mode 79, 92 data models entity types for 27, 28 data set options for SAP engine 92 data sets creating or selecting 39
Datamodel Explorer 25 ABAP Where Expression Builder window 46 Attributes for a Table (Edit) window 42 Create Extract Programs window 40 Enter Catalog Entry Name window 39 Enter Dataset Name window 39 General Attributes for a List of Tables window 35 List of Connections window 33 starting 25 Datamodel Explorer window 25 All Entity Types tab 27 Assigned Tables tab 28 Attributes tab 28 Connections menu 32 File menu 30 menus 29 Sub Data Models tab 26 DBCONDITION= data set option 93 DBGEN_NAME= data set option 93 DBGEN_NAME= option LIBNAME statement for SAP 89 DBKEY= data set option 93 DBMASTER= data set option 94 DBMS passing generated SQL to 90 DBMS columns labels 89 renaming 89, 93 DBMS connections prompts for 89 timing of 90 DBMS data subsetting and ordering 93 DBPROMPT= option LIBNAME statement for SAP 89 DBSASLABEL= option LIBNAME statement for SAP 89 Defaults tab 23 DEFER= option LIBNAME statement for SAP 90 descriptor library 23 descriptors creating 32 for list of tables 35 list of 48 DESTINATION= option LIBNAME statement for SAP 80 direct access method 11
104
Index
DIRECT_SQL= option LIBNAME statement for SAP 90 disconnecting from R/3 systems 71
of SAP application server 79 of SAP gateway 81 HOST= option LIBNAME statement for SAP 82
E encrypted password for SAP logon parameter 84 engine options LIBNAME statement for SAP 78 Enter Catalog Entry Name window 39 Enter Dataset Name window 39 entity types Assigned Tables tab 28 attributes of 28 for data models 27, 28 Export Metadata to SAS/Warehouse Administrator window 49 Export Metadata window 48 exporting metadata parameters for 48 to SAS/Warehouse Administrator 7, 49 extract management method 12, 13 data transfer and use 13 installation and setup 13 extract programs creating 40 extracted rows querying 44
F Fields tab 44 File menu Datamodel Explorer window 30 Logon to R/3 window 18 floating point numbers 82 functions calling R/3 function modules 64 for logon 22
G General Attributes for a List of Tables window 35 General Attributes tab 43 General tab Advanced Parameters window 20 List of Connections window 34 generated SQL passing to DBMS 90 GROUP= option LIBNAME statement for SAP 81 GWHOST= option LIBNAME statement for SAP 81 GWSERV= option LIBNAME statement for SAP 81
H host name for message server 83
I IEEE_REVERSE= option LIBNAME statement for SAP 82 INENCODING= option LIBNAME statement for SAP 82 IP address of SAP application server 79
J joins number of tables 83 performance and 91, 93 table size 94
L LANGUAGE= option LIBNAME statement for SAP 83 LIBNAME statement for SAP 77 engine options 78 examples 95 LIBNAME options 87 syntax 77 libraries 23 local copy of data dictionary 24 location of data dictionary 24 List of Connections window 33 General tab 34 More RFC tab 35 RFC tab 34 TCP/IP tab 34 List of Descriptors 48 Export Metadata to SAS/Warehouse Administrator window 49 Export Metadata window 48 List of R/3 Descriptors window 48 List of R/3 Descriptors window 48 List of R/3 Tables window 47 local setup utility 22 Application Setup window 22 logon function 22 logon parameter client 80 logon parameters 22 Logon to R/3 window 4, 16 Connections menu 19 File menu 18 logon utility 16 Advanced Parameters window 19 Logon to R/3 window 16 Logon window R/3 BAPI Connector 74
M macro variables for RFC 63 RFC_LOGON_INFO 72 macros %CALLRFC 64 for RFC 63 %R3CONNB 68 %R3CONNC 69 %R3CONNE 71 MAX_TABLE_JOINS= option LIBNAME statement for SAP 83 menus Datamodel Explorer window 29 Logon to R/3 window 18, 19 message server host name 83 metadata exporting to SAS/Warehouse Administrator 49 parameters for exporting 48 searching 5, 51 storage for 23 Miscellaneous tab 24 missing values 94, 95 More RFC tab 35 MSHOST= option LIBNAME statement for SAP 83 MULTI_DATASRC_OPT= option LIBNAME statement for SAP 91
N NULLCHAR= data set option 94 NULLCHARVAL= data set option 95 NUMC_SAS_TYPE= option LIBNAME statement for SAP 84
O observations number to display 24 ODBC (Open Data Base Connectivity) Options tab 52 ordering DBMS data 93
11
P PASSWORD= option LIBNAME statement for SAP 84 passwords for batch operations 54 SAP logon parameter 84 SAP logon parameter, encrypted form PASSWORDX= option LIBNAME statement for SAP 84 performance joins and 91, 93 PORT= option LIBNAME statement for SAP 85 profiles 16 connecting/disconnecting with 68
84
7,
Index 105
creating 5 displaying 33 predefined 4 text descriptions of text labels for 17
SQL number of tables in joins 83 passing generated SQL to DBMS 90 Sub Data Models tab 26 subsetting DBMS data 93 SYSNR= option LIBNAME statement for SAP 86 system name 85 system number 22, 86
RFC_STRING= option LIBNAME statement for SAP 85 rows querying extracted rows 44
20
S Q queries creating in ABAP syntax of extracted rows 44 parameters for 52
46
R R/3 3, 16 accessing data with 11 connecting to R/3 systems 69 disconnecting from R/3 systems 71 getting started with 3 starting 3 system name 85 system number 22, 86 R/3 BAPI Connector: Logon window 74 %R3CONNB macro 68 %R3CONNC macro 69 %R3CONNE macro 71 R3NAME= option LIBNAME statement for SAP 85 random access engine SAS/ACCESS engine as 91, 95 read transactions utility spool file 91 Related Tables tab 44 Remote Function Call (RFC) 12 remote SAS sessions 20 REREAD_EXPOSURE= data set option 95 REREAD_EXPOSURE= option LIBNAME statement for SAP 91 RFC (Remote Function Call) 12 RFC server 57 ABAP Function module name 79 ABAP function modules and programs 57 ABAP program name 79 batch jobs for data extracts 79, 92 batch mode 62 host for connecting to SAP 82 macros and macro variables 63 network location of 21 on UNIX 58 on Windows NT 60 port number 85 R/3 BAPI Connector: Logon window 74 tracing requests 86 RFC tab Advanced Parameters window 21 List of Connections window 34 RFC_LOGON_INFO macro variable 72 RfcOpenEx() call additional logon or connection parameters 85
SAP application servers group name of 81 host name or IP address 79 SAP destination defining from SAP logon utility 96 defining from saprfc.ini file 96 SAP engine data set options for 92 SAP gateway host name of 81 service of 81 SAP LIBNAME Engine 78 SAP logon parameter client 80 language for 83 password 84 password, encrypted form 84 user name 87 SAP logon utility defining SAP destination from 96 SAP server accessing from local host 95 SAP transport files 58 SAPLOGON string defined for 86 SAPLOGON_ID= option LIBNAME statement for SAP 86 saprfc.ini file defining SAP destination from 96 destination indication 80 SAS/ACCESS engine as random access engine 91, 95 SAS/ACCESS Interface to R/3 See R/3 SAS sessions remote 20 SAS/Warehouse Administrator exporting metadata to 7, 49 Search Metadata utility 51 Data Dictionary Search Facility window Search String tab 52 searching metadata 5, 51 Select Fields for a Table window 45 setup Application Setup window 22 local setup utility 22 sideinfo file 22 source entry 35 source library 23 source parameter 54 SPOOL= option LIBNAME statement for SAP 91
T tables Assigned Tables tab 28 attributes for 35, 42 fields 44, 45 list of 35, 47 number of tables in joins 83 querying extracted rows 44 related tables 44 size of, for joins 94 TCP/IP tab Advanced Parameters window 20 List of Connections window 34 Tools menu 32 TRACE= option LIBNAME statement for SAP 86 transport files 58 tutorial 3
U UNIX RFC server on 58 user logon language changing 96 USER= option LIBNAME statement for SAP 87 utility spool file for read transactions 91
V 51
View menu 31 views creating 32 default settings 23 for list of tables 35
W WHERE expressions creating in ABAP syntax Where tab 44 Windows NT RFC server on 60
46
Your Turn If you have comments or suggestions about SAS/ACCESS 4.1 Interface to R/3: User’s Guide, please send them to us on a photocopy of this page, or send us electronic mail. For comments about this book, please return the photocopy to SAS Publishing SAS Campus Drive Cary, NC 27513 E-mail: [email protected] For suggestions about the software, please return the photocopy to SAS Institute Inc. Technical Support Division SAS Campus Drive Cary, NC 27513 E-mail: [email protected]