Escolar Documentos
Profissional Documentos
Cultura Documentos
Integration Technologies
Authored by: Kevin Wilson
(kevin.wilson@sapgenie.com)
Date: 6/1/2002
Page 1 /24
TABLE OF CONTENTS
CHAPTER 1 SAP CONNECTORS 3 1.1 SAP .NET CONNECTOR ---------------3 1.2 SAP JAVA CONNECTOR --------------3 1.3 SAP DCOM CONNECTOR -------------3 1.4 SAP BUSINESS CONNECTOR -------3 1.5 RFC LIBRARY -----------------------------3 CHAPTER 2 .NET CONNECTOR 4 2.1 OVERVIEW----------------------------------4 CHAPTER 3 JAVA CONNECTOR 5 3.1 OVERVIEW----------------------------------5 CHAPTER 4 DCOM CONNECTOR 6 4.1 OVERVIEW----------------------------------6 4.2 FEATURES----------------------------------6 4.3 TECHNOLOGY-----------------------------6 4.4 ARCHITECTURE---------------------------7 4.5 TRANSACTIONAL MODEL-------------7 4.6 RESOURCE POOLING-------------------8 4.7 THE OBJECT BUILDER-----------------9 4.8 PROGRAMMING CLIENTS FOR BAPIS IN VB..................................................................11 CHAPTER 5 COM4ABAP 13 5.1 OVERVIEW---------------------------------13 CHAPTER 6 BUSINESS CONNECTOR 14 6.1 OVERVIEW---------------------------------14 6.2 ARCHITECTURE-------------------------14 6.3 HARDWARE REQUIREMENTS------15 6.4 SOFTWARE REQUIREMENTS------15 6.5 BUSINESS CONNECTOR-------------16 6.6 SAP BC INTEGRATOR-----------------19 CHAPTER 7 RFC LIBRARY 22 7.1 OVERVIEW---------------------------------22 APPENDIX A. GLOSSARY 23
Page 2 /24
1.1
The SAP .NET Connector offers developers the possibility to expose BAPIs and remotelyenabled function modules to any .NET application (inside-out). It is also possible to access .NET components from any mySAP.com application (outside-in).
1.2
The SAP Java Connector (SAP JCo) is a toolkit that allows a Java application to communicate with any SAP system. It combines an easy to use API with unprecedented flexibility and performance. The package supports both, Java to SAP System as well as SAP System to Java calls.
1.3
The DCOM Component Connector is a means for technical interoperability of SAP Components (written in ABAP or ABAP Objects) and COM Components (written in VB, Java, C++, Cobol, Delphi or any other COM-compliant language) on the basis of Microsofts Distributed Component Object Model (DCOM).
1.3.1 COM4ABAP
com4abap is a multi-thread server that can expose any COM automation interface to an ABAP program and also offers semi-automatic type conversion between ABAP and COM data types. In particular, it allows you to address components that do not have their own user interface.
1.4
The SAP Business Connector (SAP BC) allows you to highly automate and extend your business processes over the Internet using open and non-proprietary standards. Thus the SAP BC seamlessly integrates different IT architectures with SAP Systems. The SAP BC provides bidirectional, real-time as well as asynchronous communication to and from a SAP System. The SAP BC is a main part of the SAP Internet Initiative.
1.5
RFC LIBRARY
The RFC Library offers an interface to a SAP System. The RFC Library is the most commonly used and installed component of existing SAP Software. This interface provides the opportunity to call any RFC Function in a SAP System from an external application. Moreover, the RFC Library offers the possibility to write a RFC Server Program, which is accessible from any SAP System or external application. Most SAP Connectors use the RFC Library as communication platform to SAP Systems.
Page 3 /24
At run-time the SAP .NET Connector will perform and manage all necessary communication between the .NET application and the SAP server. Transparent for the application both SOAP or SAP RFC can be used as communication protocols. Transactional RFC or queued RFC are supported. For communication security you can use Kerberos, X.509 certificates or Microsoft Passport. Availability Currently, the SAP .NET Connector is a beta product. The release of the final product is planned for the middle of 2002. The SAP .NET Connector works with all SAP application servers starting with release 3.1I, which means access to .NET applications for all existing SAP R/3 systems as well as for the new Web Application Server.
Page 4 /24
Page 5 /24
4.2
FEATURES
Create proxy objects that allow you to address BAPIs from within an external program Create proxy objects that allow you to address remote function modules from within an external program, using either synchronous, transactional, or queued RFC
Use the generic RFC server Com4Abap to address COM components easily from an ABAP program The SAP DCOM Connector is an early-binding tool, which gives you strong typing at compile time. This also improves runtime performance, since your components do not have to retrieve type information from the R/3 System at this time. The components also provide automatic type mapping between ABAP and automation data types (including conversion of ABAP internal tables into ADO Recordsets). Using the the SAP DCOM Connector and MTS allows you to create distributed applications without having to install the SAP DLL or COM component on each client machine. The components that you create using the Object Builder can be used in the following environments: Visual C++ Visual Basic and VBA Java (Microsoft VM) Active Server Pages VB Script Java Script
4.3
TECHNOLOGY
The Distributed Component Object Model (DCOM) enables COM software components to communicate directly over a network in a reliable, secure, and efficient manner. DCOM is designed for use across multiple network transports, including Internet protocols such as TCP and HTTP. DCOM is based on the Open Software Foundation's DCE-RPC spec and will work with both Java applets and ActiveX components through its use of the Component Object Model (COM). DCOM is a fast, native object transport for Windows NT and Windows 95. The Microsoft Transaction Server (MTS) is based on COM and uses DCOM for component-tocomponent communications across a network. MTS itself is a component-based transaction processing system for developing, deploying, and managing high performance, scalable, and robust enterprise, Internet, and Intranet server applications. The MTS defines an application
Page 6 /24
programming model for developing distributed component-based applications. It also provides a run-time infrastructure for deploying and managing these applications.
4.4
ARCHITECTURE
Using the Object Builder, you can create COM components that expose one or more BAPIs or remotely-enabled function modules. Each BAPI or function module in the component appears as a separate method. The Object Builder also adds certain adminstrative methods to the component. Once you have created a component, you can install it in a Microsoft Transaction Server package. You can then use it in your client applications. If you write your client in a language that supports COM, the program can access the package directly. If you write an HTML client (Web application), you must use Active Server Pages (ASP) to run server-side scripts that can communicate with your COM component.
4.5
TRANSACTIONAL MODEL
A transaction is an inseparable sequence of database operations that transforms the database from one consistent state to another consistent state. These database operations must operate on the "all or nothing" principle they must either all be carried out or all be canceled. When you program using the SAP DCOM Connector, it is important to know how the components you are using behave with respect to transactions. The most important question is whether the changes you make are committed automatically, or whether you have to commit them yourself.
Page 7 /24
4.6
RESOURCE POOLING
If you choose to use the Microsoft Transaction Server (MTS) with the SAP DCOM Connector, it will automatically take care of resource pooling and thread management for you. This section explains which resources can be pooled by the MTS and the benefit that you gain from this.
Page 8 /24
Language A pooled resource can only be reused by an object with the same properties. Thus resource pooling is of considerable importance in Web scenarios, where several users share a single R/3 user, because there will be many requests using the same connection parameters. If the MTS can allocate an existing connection to these requests, the performance of the application will be improved, because you no longer have the overhead associated with creating new RFC connections.
4.7
The Object Builder is the part of the SAP DCOM Connector that you use to generate proxy COM objects for BAPIs and remotely-enabled function modules.
4.7.1 Structure
The Object Builder contains three parts. In the top-left hand corner of the screen, you log onto the R/3 System containing the BAPIs or function modules for which you want to generate proxies. Below this, the list of objects available for selection is displayed in hierarchical form. On the righthand side of the screen, you set the various options for the C++ project that is created during the generation process.
4.7.2 Prerequisites
There must already be a destination that points to the system whose BAPIs or function modules you want to use. You can create this by creating a new destination in the DCOM Connector.
4.7.3 Procedure
1. Select the destination to which you want to log on. Any logon information that has been stored for that destination will automatically appear in the relevant input fields. 2. Fill out any remaining logon details and choose Logon. This connects to the destination. A list of all of the business objects in that system appears. 3. In the COM/MTS group box, enter the name to be assigned to the make file of the C++ project. This name is automatically copied into the Target DLL field as well. 4. Enter a namespace name. The default is the system name, but you can enter any value. It will be the first part of the ProgID of the class. 5. If you want the Object Builder to generate a session object, select the Session Object option. An input field appears, in which a name for the session object is already proposed. 6. Select the RFC type that you want to use. For further information, refer to The Transaction Model. 7. Position the cursor on a business object that you want to include in your COM component and choose Add. Each business object that you select will be a class within the COM object. The BAPIs of the object will be methods of the corresponding class. 8. Choose Build Component DLL. This creates the C++ project and generates the COM component. 9. If you are using Windows 2000 or Windows NT with the Microsoft Transaction Server and want to use the component in the MTS environment, choose Install Component DLL in MTS.
Page 9 /24
2. Compiling and linking the DLL During this process, the following source files are generated:
<project>.rc <project>.idl
<ObjectType>.h <ObjectType>.rgs
Page 10 /24
<project>.tlb <project>.dll
4.8
Use this procedure to program a VB client that calls BAPIs using a session object.
4.8.1 Prerequisites
You must already have created and installed the proxy object and session object.
4.8.2 Procedure
1. 2. 3. 4. 5. 6. Create an instance of the session object. Use the PutSessionInfo method to set the connection parameters for the object. Create instances of the relevant business objects Call the BAPIs that you need Call the CommitWork() method of your session object. Release the objects that you have used.
4.8.2.1 Example
The following program retrieves a list of sales orders from an R/3 System and displays them in a Visual Basic program. It should work with any IDES System with Release 4.0B or higher, as long as you change the logon data in the oSession.PutSessionInfo function. The example is contained in a standard EXE project with a single form called Form1. The component T20Saleslib is a DCOM proxy for the business object SalesOrder plus a corresponding session object. The data grid control is called DataGrid1. The Get Sales Orders function is implemented in the routine cmdGet_Click, and the Exit function is implemented in the cmdExit_Click routine. The Source Code Private Sub cmdGet_Click() Dim oSession As New T20salesLib.SalesorderSessionComponent Dim oOrders As Object Dim oOrderList As ADODB.Recordset Dim oReturn As ADODB.Recordset oSession.PutSessionInfo "T20 [PUBLIC]", "TESTUSER", "LETMEIN", "EN", _"800"
Page 11 /24
Set oOrders = oSession.CreateInstance("T20.SalesOrder.1") oOrders.DimAs "BAPIGETLIST", "SALESORDERS", oOrderList oOrders.DimAs "BAPIGETLIST", "RETURN", oReturn Set oOrderList = oOrders.BapiGetList(CustomerNumber:="0000001000", _ SalesOrganization:="1000", SalesOrders:=oOrders) Set DataGrid1.DataSource = oOrders DataGrid1.Refresh Set oOrders = Nothing Set oSession = Nothing End Sub Private Sub cmdExit_Click() Unload Form1 End Sub
4.8.3.1 Use
You can use this proxy component whenever you need to submit IDOCs from external systems. It thereby eliminates the need to use the C RFC API to do so. You may submit one or more IDOCs in a single call. They should be formatted as a text stream.
4.8.3.2 Structure
The component inherits from the transactional RFC interface of the SAP DCOM Connector (ISAPTRfcConnector). Consequently, it supports transactional RFC. To submit the IDOCs, you use the method SubmitIdoc.
4.8.3.3 Integration
You can use the IDOC RFC proxy in any of the development environments supported by the SAP DCOM Connector
Page 12 /24
CHAPTER 5 COM4ABAP
5.1 OVERVIEW
Addressing external components using ABAP has never been easy. Although SAP has long provided the RFC API, you needed considerable C expertise to get the server to link and compile properly. Multi-threading was the responsibility of the programmer. Furthermore, you had to ensure tha tthe service would be active when invoked from ABAP. For Visual Basic programmers, the situation was even worse, because in order to communicate with the RFC API, you had to convert the data structures back and forth between the C structures and data types you could actually work with in VB. The aim was to provide a generic RFC server for the Windows environment with which you could address any COM automation interface, both your own and proprietary interfaces such as, for example, MS Exchange. The result is com4abap a multi-thread server that can expose any COM automation interface to an ABAP program and also offers semi-automatic type conversion between ABAP and COM data types. In particular, it allows you to address components that do not have their own user interface. com4abap can be run as a W2K/Window NT service, or started as an executable. You must also register it as an RFC destination in the client R/3 System. In ABAP, you program against this destination to create a COM session, in which you can instantiate any registered COM component.
Page 13 /24
6.1
OVERVIEW
SAP Business Connector is a middleware server application based on webMethods B2B Integration Server. SAP Business Connector allows you to extend your business processes over the Internet and integrate non-SAP products using open, nonproprietary technology. SAP Business Connector provides bidirectional synchronous as well as asynchronous communication to and from applications in your mySAP.com landscape, including SAP and nonSAP components and applications as well as Web applications. Calling SAP Business Connector from within an SAP application is no different from calling any other RFC server. The SAP-proprietary RFC format is converted to Extensible Markup Language (XML) or HyperText Markup Language (HTML) so that no SAP software is needed on the other end of the communication line. Since SAP BC uses both synchronous RFC (BAPI) and asynchronous tRFC (ALE) calls you can use both BAPIs and ALE for communication in your landscape.
6.2
ARCHITECTURE
The architecture of SAP Business Connector (SAP BC) is divided into two independent parts: the server itself, which is the processing component, and SAP BC Integrator. SAP BC Integrator is a
Page 14 /24
development tool that lets you create custom functionality for one or more SAP Business Connector instances (It will be discussed in the next chapter).
6.2.1 Platforms
You can run SAP BC on the following platforms: Windows NT and Windows 2000 Linux Solaris AIX HP-UX
6.3
HARDWARE REQUIREMENTS
Minimum Recommended 256 MB Depends on the number of transactions stored in the file system; also depends on the number of additional packages and services Pentium II 233 MHz or equivalent 128 MB 100 MB
6.4
SOFTWARE REQUIREMENTS
To use SAP Business Connector, you must have SAP R/3 3.1G or higher, or you must have a mySAP.com license. Additionally, you need one of the following browsers installed either on the machine where SAP Business Connector is installed or on any machine that can access SAP Business Connector through HTTP: Netscape Navigator or Netscape Communicator 6.x Microsoft Internet Explorer 4.0 or later (5.0 is recommended) If you want to create additional Java services, you need to install a Java Development Kit (JDK). No additional software is needed. SAP Business Connector comes with built-in HTTP and FTP server and client functionality. A version of SAP Business Connector including strong 128-bit encryption is available via SAPNet.
Page 15 /24
6.5
BUSINESS CONNECTOR
SAP R/3
RFCs RFCs RFCs tRFCs
SAP BC Services
1. Select SAP Component and the RFC to execute
BAPIs BAPIs
RFC
IDocs IDocs
tRFC
Message Store
Partner Manager
Rule Rule Rule Rule
Page 16 /24
You can view and manage the transactions that the Partner Manager records in its Message Store. You can resend messages to the Partner Manager for processing, and you can delete transactions.
Load balancing is an optimizing feature that you use with clustered servers running SAP Business Connector. Load balancing allows a server to automatically refer a client request to another server if it is too busy to handle the request itself. To use this feature, you use SAP Business Connector Clustering, which uses a central cluster store to maintain the status of SAP BC services running in the cluster. The store is part of SAP Business Connector Repository.
Page 18 /24
6.5.9 Standards
6.5.9.1 IDoc-XML and RFC-XML
SAP Business Connector is the de facto XML interface to existing SAP component releases. It supports all versions of IDoc-XML and RFC-XML, as specified by the SAP-XML Specification. With the SAP Business Connector SAP-XML interface, you can invoke RFCs via XML and convert IDocs to the SAP-XML format.
6.6
SAP BC INTEGRATOR
SAP BC Integrator is an integrated development environment that you use to create SAP BC services for one or several instances of SAP BC. It provides all the tools you need to build and test SAP BC services, generate stubs for client applications, and create output templates. Some of the most commonly used functional elements of SAP BC Integrator are described below.
6.6.1 Packages
A package is a container that you use to bundle services and related elements, such as specifications, records, schemas, and output templates. When you create a folder, service, specification, record, schema, or output template, you save it in a package. Packages are designed to hold all the components of a logical unit in an SAP BC component. For example, you might group all the services and files specific to a particular marketplace in a single package. After grouping these components into a single package, you can easily manipulate them as a unit.
Page 19 /24
buyer and executes the following series of SAP BC services before submitting it to an internal ordering component: Receives a purchase order submitted by a buyer Logs the order in an audit-trail file Performs a credit check
Posts the order to the ordering system Any SAP BC service can be invoked by a flow service including other flow services. For instance, a flow service might invoke a service that you create or any of the built-in services provided by SAP BC. You create flow services using SAP BC Integrator. SAP BC saves them in XML files.
6.6.5 Debugging
SAP BC Integrator provides a range of tools to assist you during testing and debugging. For example, you can: Test services, specify their input values, and inspect their results. Examine the call stack and the pipeline when an error occurs. Execute services in debug mode, a mode that lets you monitor a flow services execution path and/or execute its steps one at a time.
Temporarily disable steps in a flow and/or specify points where you want to halt execution. Additionally, SAP provides tools for collecting run-time information that can help debug a service. These include tools to: Write arbitrary messages to the server log. Trace the pipeline at run time. Modify and save the contents of the pipeline at a specified point.
Page 20 /24
SAP BC Integrator provides an integrated development environment that you can use to create, compile, and publish Java services. The development environment automatically generates an appropriately structured source file that you simply fill in using the built-in editor. When you save the source file, the development environment automatically compiles it and registers it on the SAP BC server.
Displays the output to the user The client code that SAP BC Integrator generates can serve as a good starting point for your own development.
Page 21 /24
Full compatibility to other RFC Releases. The RFC Library exists in a Unicode and non-Unicode version. Thus, the Unicode RFC Library is forward and backward compatible, i. e. a current Unicode RFC Application can communicate with any non-Unicode RFC Application independently of its release and vice versa. As expected by modern software, the RFC Library is thread safe. This enables the user to write powerful multithreaded RFC Applications. Information about where to find the current version of the RFC Library is described in OSS note 413708.
Page 22 /24
APPENDIX A.
TERM Business Application Programming Interface (BAPI) RFC Server (Listener)
GLOSSARY
DESCRIPTION Business functions in SAP components that are written in the programming language ABAP. BAPIs are formalized RFCs. Systems that are remote to the SAP component commonly use BAPIs to invoke an action on the SAP component. A process that can accept RFCs from SAP components. This allows SAP components to access functions in external systems. In SAP BC terminology, the process is called a Listener. Listeners are one or more threads on SAP Business Connector that wait for incoming requests from SAP components. Listeners are named and register with an SAP gateway to indicate that they are ready to accept requests. Listeners can accept RFC or tRFC requests. SAP terminology for a process that sends RFCs to an SAP component to invoke functions. Protocol for ensuring that an RFC is executed successfully and executed only once on the target system. SAP Business Connector can handle both inbound and outbound tRFCs. Communications method that an SAP component uses to asynchronously invoke a function on a remote system and that a remote system uses to asynchronously invoke a function on an SAP component. The tRFC protocol ensures that an RFC is executed successfully and only once. RFCs are requests that an SAP component sends to invoke functions on remote systems, or calls that remote systems initiate to invoke functions on an SAP component. Communications method that an SAP component uses to synchronously invoke a function on a remote system and that a remote system uses to synchronously invoke a function on the SAP component. SAP Business Connector functions that are named with a hierarchical interface and service syntax. Services can be flow services (interfaces to data sources, XML documents, or HTML Web sites) or services written in Java or C/C++ by you, thirdparty vendors, or SAP AG. Code library provided by SAP that allows third parties to integrate the RFC protocol into applications. SAP Business Connector uses LIBRFC to communicate with the SAP components. EDI-like SAP business document. A process that accepts messages and routes them to a configured location. For example, the Partner Manager can route messages to an SAP system, to SAP BC, or to a remote URL in an XML format. Typically, IDocs are routed through the Partner Manager. A JDBC-compliant database that SAP Business Connector uses to track all transactions that pass through the Partner Manager.
SAP BC Service
LIBRFC
Page 23 /24
Page 24 /24