SAP Business Connector SAP Adapter Guide
SAP SYSTEM
Release 4.7
SAP® AG Neurottstr. 16 D-69190 Walldorf
SAP AG SAP Business Connector SAP Adapter Guide
Copyright ©Copyright 2003 SAP AG. All rights reserved. No part of this description of functions may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft®, WINDOWS® and EXCEL®, NT® and SQL-Server® are registered trademarks of Microsoft Corporation. IBM®, OS/2®, DB2/6000®, AIX®, OS/400® and AS/400® are registered trademarks of IBM Corporation. OSF/Motif® is a registered trademark of Open Software Foundation. ORACLE® is a registered trademark of ORACLE Corporation, California, USA. webMethods® is a registered trademark of webMethods Incorporated, Virginia, USA. INFORMIX®-OnLine for SAP is a registered trademark of Informix Software Incorporated. UNIX® and X/Open® are registered trademarks of SCO Santa Cruz Operation. SAP®, R/2®, R/3®, RIVA®, ABAP/4®, SAPaccess®, SAPmail®, SAPoffice®, SAP-EDI®, SAP Business Workflow®, SAP EarlyWatch®, SAP ArchiveLink®, R/3 Retail®, ALE/WEB®, SAPTRONIC® are registered trademarks of SAP AG. All rights reserved.
SAP Business Connector ii SAP AG SAP Business Connector SAP Adapter Guide
Typographical Conventions
Type Style Description
Interface Text Words or characters that appear on the screen. This includes field names, screen titles, pushbuttons, menu names, and menu options.
Document Title Cross-references to other documentation.
User Entry Words and characters that you enter exactly as they appear in the documentation.
NAME Names of elements in the SAP System. These include program names, transaction codes, table names, ABAP key words, file names, and directories.
Name File names, path names, program names, user names, parameters, file contents and operating system output.
KEY Keys on the keyboard. These include the function keys, e.g. F2, or the ENTER key.
Icon Description
A note. Notes contain important information, e.g. exceptions or special cases.
An example. Examples illustrate complex procedures or the syntax for user entries.
A caution. Cautions help users avoid errors which can, for example, lead to loss of data.
Hints and Tips.
SAP Business Connector iii SAP AG SAP Business Connector SAP Adapter Guide
Contents
Chapter 1: Introduction...... 1-1 Welcome! ...... 1-2 Related Documentation...... 1-2 Chapter 2: Product Overview ...... 2-1 What is the SAP Business Connector? ...... 2-2 Functional Highlights ...... 2-2 Complete SAP System Integration ...... 2-3 Integrating SAP Systems over the Internet...... 2-3 Routing IDocs, RFCs and BAPIs ...... 2-3 Support for IDoc- and RFC-XML ...... 2-4 Support of BizTalk XML envelopes for BAPI and RFC calls ...... 2-4 Support of Unified Error Handling of BAPIs and RFCs on XML Level ...... 2-4 Built-in BAPI Tools ...... 2-4 Message Store...... 2-5 Architecture and Components ...... 2-6 Basic Concepts ...... 2-6 Invoking Business Logic...... 2-8 Routing Messages through the Partner Manager...... 2-9 Chapter 3: Installation and Setup ...... 3-1 System Requirements ...... 3-2 Sizing…...... 3-2 CPU……...... 3-2 Disc Space ...... 3-2 Questions on sizing...... 3-2 Installation Size...... 3-3 Transaction Store...... 3-3 Log files...... 3-4 Memory...... 3-5 Questions on Sizing ...... 3-5 Initial consumption ...... 3-5 Consumption per session ...... 3-5 Consumption for RFC Listeners ...... 3-6
SAP Business Connector iv SAP AG SAP Business Connector SAP Adapter Guide
Payload ...... 3-6 Miscellaneous...... 3-7 Encryption ...... 3-7 IDoc Packets...... 3-7 Connection Pool...... 3-8 Security ...... 3-8 Configuring SAP BC Server as a Windows NT service...... 3-8 Chapter 4: Calling an SAP System from SAP BC Services...... 4-1 Overview ...... 4-2 General Settings...... 4-2 Defining SAP Servers ...... 4-3 Testing the Connection to SAP Servers ...... 4-9 Testing that the SAP Server will Execute an RFC...... 4-10 Creating an SAP BC Service that Executes an RFC...... 4-11 Creating an Outbound Map...... 4-12 Searching for maps without reference ...... 4-14 Using optional tables in outbound maps...... 4-15 Testing the Function Module...... 4-16 Testing that the SAP Server will Execute an RFC-XML ...... 4-17 Posting an RFC-XML Document from an HTTP Client ...... 4-18 Creating an SAP BC Service that Executes a BAPI...... 4-19 Starting to Browse...... 4-19 Displaying a List of Business Objects in the System...... 4-20 Displaying a Business Object ...... 4-20 Displaying a BAPI ...... 4-21 Displaying a BAPI Parameter ...... 4-22 Displaying a Key Field ...... 4-23 Generating XML Calls for a BAPI ...... 4-23 Posting a BAPI from an HTTP client...... 4-25 Chapter 5: Calling SAP BC Services from SAP System...... 5-1 Overview ...... 5-2 Creating an RFC Destination on an SAP System ...... 5-2 Register SAP Business Connector as an RFC destination ...... 5-2 Configuring an RFC Listener in SAP Business Connector Server...... 5-4 Managing RFC Trace Information ...... 5-6 Testing the RFC Listener...... 5-6
SAP Business Connector v SAP AG SAP Business Connector SAP Adapter Guide
Monitoring information for RFC Listeners ...... 5-6 Viewing and deleting RFC Trace Files and SAP Log Files ...... 5-6 Performance output information in the SAP Log File ...... 5-7 jARM (Java Application Responsetime Measurement) ...... 5-8 Monitoring Information via Passport and DSR ...... 5-10 Mapping Inbound RFCs to SAP BC Services...... 5-12 Creating a Function Module in an SAP System...... 5-12 Creating an Inbound Map ...... 5-13 Testing the Product Retrieval Function...... 5-15 Sending an RFC from an SAP System to SAP BC...... 5-16 The SBCHEADER Table ...... 5-17 Generating a record for a structure...... 5-21 Working with different code pages ...... 5-22 To receive data from http, ftp, email or file ...... 5-22 To send out data via http, ftp, email or save it to file ...... 5-22 To encode data from SAP Systems...... 5-22 Chapter 6: The Partner Manager...... 6-1 Introduction ...... 6-2 Overview of the Partner Manager...... 6-2 Components of a Routing Rule...... 6-3 Using Wildcards as Routing Criteria ...... 6-5 Routing Rule Precedence...... 6-5 Establishing Routing Rules ...... 6-9 When a Routing Rule Is Not Defined...... 6-15 Managing Routing Rules...... 6-16 Displaying Routing Rules...... 6-16 Updating Routing Rules...... 6-17 Disabling Routing Rules...... 6-17 Deleting Routing Rules ...... 6-18 Editing a Routing Service ...... 6-18 Guidelines to Follow When Editing a Routing Service ...... 6-18 Updating the Flow Associated with a Routing Rule...... 6-19 Example of Updating a Flow for FTP or Email Transport ...... 6-19 Example of Digitally Signing a Message...... 6-20 Managing Transactions in the Message Store...... 6-21 Viewing Transactions in the Message Store...... 6-21
SAP Business Connector vi SAP AG SAP Business Connector SAP Adapter Guide
Deleting Transactions from the Message Store ...... 6-23 Automatic Cleanup of the Message Store ...... 6-24 Configuration Parameters for the Partner Manager...... 6-25 Chapter 7: Setting up Routing for BAPIs ...... 7-1 Inbound Call to an SAP System ...... 7-2 Setting Up the SAP Business Connector and the BAPI Transport...... 7-2 Posting BAPI-based XML to the SAP Business Connector...... 7-3 Posting RFC Based IFR-compatible XML Messages...... 7-4 Transaction Control...... 7-4 BAPI XML Transaction Commit ...... 7-4 Synchronous Calls ...... 7-4 Asynchronous Calls to SAP Systems...... 7-6 Outbound Call from an SAP System...... 7-7 Overview ...... 7-7 Setting Up Routing Rules for the XML Transport ...... 7-8 RFC Based XML Messages Using IFR Format...... 7-10 Dynamic Routing Using the XML Transport ...... 7-10 Example: Calling a BAPI Synchronously from an SAP System ...... 7-11 Example: Calling a BAPI Asynchronously from an SAP System ...... 7-14 Chapter 8: Routing IDocs and XML messages to the Partner Manager ...... 8-1 Introduction ...... 8-2 Sending IDocs with ALE from an SAP System to SAP BC...... 8-2 Posting IDoc- and RFC-XML (XRFC) Documents ...... 8-5 Posting an IDoc-XML Document from an HTTP Client ...... 8-5 Posting an IDoc via FTP ...... 8-6 Posting an IDoc in an email message ...... 8-6 Posting an IDoc from a Web Browser...... 8-7 Transmitting IDocs between two Business Connectors...... 8-7 Posting arbitrary XML documents ...... 8-8 Mapping IDocs to Other Formats ...... 8-10 Creating a Routing Rule that points to a Flow Service ...... 8-11 Obtaining a Record Definition for Your IDoc...... 8-12 Mapping the data in an IDoc...... 8-16 Pre-Routing Mechanisms for content based routing with IDocs...... 8-21 Using the ALE Monitoring Features via the SAP BC...... 8-25 Introduction ...... 8-25
SAP Business Connector vii SAP AG SAP Business Connector SAP Adapter Guide
IDoc Trace ...... 8-26 Status Update via ALEAUD IDoc...... 8-27 Status Update via SYSTAT01 IDoc ...... 8-28 Improving the Performance of the Partner Manager...... 8-29 Chapter 9: Coding Client Applications and Services ...... 9-1 Overview ...... 9-2 Invoking RFCs from SAP Business Connector Server...... 9-2 Calling SAP Services from Java Services ...... 9-2 Receiving IDocs from an SAP System...... 9-3 Accessing and Modifying Fields in IDocs ...... 9-3 Converting an IDoc to XML...... 9-3 Constructing an IDoc with the SAP Java IDoc Library ...... 9-3 Sending IDocs to an SAP System ...... 9-6 Transaction Features for HTTP and SAP-XML...... 9-6 Chapter 10: Security...... 10-1 Product Availability...... 10-2 SAP BC Configuration...... 10-2 SAP Business Connector Developer ...... 10-2 Java Client Code...... 10-2 Initializing the Security Settings in the SAP BC ...... 10-3 User Authentication between SAP BC and an SAP System...... 10-3 Authentication Through User Name and Password ...... 10-3 Authentication Through X.509 Certificate ...... 10-3 Authentication when SAP BC acts as RFC-Server ...... 10-7 Using SAP BC with the SAP Cryptographic Library for SNC ...... 10-8 Authorization Profiles for the SAP Logon User...... 10-10 Authorization Configuration in the SAP Environment...... 10-10 Installing SAP BC according to your Security Policy ...... 10-10 References...... 10-11 Chapter 11: Managing the DDIC Cache...... 11-11 Data DICtionary Cache (DDIC Cache) ...... 11-12 Viewing Information in the DDIC Cache ...... 11-12 Removing Information from the DDIC Cache...... 11-15 Appendix A Package Contents...... A-1 Package Layout...... A-2 Appendix B Server Configuration...... B-1
SAP Business Connector viii SAP AG SAP Business Connector SAP Adapter Guide
server.cnf ...... B-2 Appendix C Representation of ABAP Types in SAP BC ...... C-1 Appendix D SAP Business Connector API ...... D-1 SAP Client Services...... D-2 pub.sap.client:connect ...... D-2 pub.sap.client:lockSession...... D-3 pub.sap.client:releaseSession ...... D-4 pub.sap.client:invoke ...... D-5 pub.sap.client:invokeTransaction ...... D-6 pub.sap.client:createTID...... D-7 pub.sap.client:confirmTID ...... D-7 pub.sap.client:getAttributes...... D-8 pub.sap.client:getFunctionInterface...... D-10 pub.sap.client:getStructureDefinition ...... D-11 pub.sap.client:sendIDoc...... D-12 pub.sap.client:ping ...... D-13 XRFC Services...... D-15 pub.sap.rfc:encode ...... D-15 pub.sap.rfc:decode ...... D-15 pub.sap.rfc:createTemplate ...... D-16 IDoc Services...... D-17 pub.sap.idoc:encodeSDATA...... D-17 pub.sap.idoc:decodeSDATA...... D-18 pub.sap.idoc:transformFlatToHierarchy...... D-18 pub.sap.idoc:transformHierarchyToFlat...... D-19 pub.sap.idoc.routing:registerService ...... D-20 pub.sap.idoc.routing:unregisterService ...... D-20 pub.sap.idoc:encodeString ...... D-21 pub.sap.idoc:decodeString ...... D-21 pub.sap.idoc:iDocToRecord...... D-22 pub.sap.idoc:recordToIDoc...... D-22 pub.sap.idoc:iDocToTables ...... D-23 pub.sap.idoc:tablesToIDoc ...... D-23 IDoc-XML Services...... D-25 pub.sap.idoc:encode...... D-25 pub.sap.idoc:decode...... D-25
SAP Business Connector ix SAP AG SAP Business Connector SAP Adapter Guide
bXML Services...... D-26 pub.sap.bapi:encode...... D-27 pub.sap.bapi:decode...... D-27 pub.sap.bapi:createTemplate ...... D-28 BAPI Services...... D-29 pub.sap.bapi:commit...... D-29 pub.sap.bapi:rollback ...... D-29 Routing Rule Administration Services ...... D-30 wm.PartnerMgr.gateway.admin:addRoutingRule ...... D-30 wm.PartnerMgr.gateway.admin:editRoutingRule ...... D-31 wm.PartnerMgr.gateway.admin:removeRoutingRule ...... D-33 wm.PartnerMgr.gateway.admin:disableRoutingRule...... D-33 wm.PartnerMgr.gateway.admin:enableRoutingRule ...... D-34 wm.PartnerMgr.gateway.admin:listRoutingRule...... D-34 wm.PartnerMgr.gateway.admin:getRoutingRule ...... D-35 wm.PartnerMgr.gateway.admin:listTransports ...... D-36 Transaction Administration Services ...... D-36 wm.PartnerMgr.xtn.admin:list ...... D-36 wm.PartnerMgr.xtn.admin:get...... D-38 wm.PartnerMgr.xtn.admin:getMessage ...... D-39 wm.PartnerMgr.xtn.admin: mapDocNumToTID...... D-39 wm.PartnerMgr.xtn.admin:delete...... D-40 wm.PartnerMgr.xtn.admin:deleteAll...... D-40 wm.PartnerMgr.xtn.admin:deleteSelection ...... D-40 Transport Services...... D-40 pub.sap.transport.ALE:InboundProcess...... D-41 pub.sap.transport.ALE:OutboundProcess ...... D-41 wm.PartnerMgr.gateway.transport.B2B:InboundProcess...... D-42 wm.PartnerMgr.gateway.transport.B2B:OutboundProcess...... D-43 wm.PartnerMgr.gateway.transport.EmailTransport:OutboundProcess ...... D-45 wm.PartnerMgr.gateway.transport.FTPTransport:OutboundProcess ...... D-46 pub.sap. transport.RFC:InboundProcess ...... D-47 pub.sap.transport.RFC:OutboundProcess...... D-48 pub.sap.transport.XML:InboundProcess ...... D-49 pub.sap.transport.XML:OutboundProcess...... D-50 pub.sap.transport.BAPI:InboundProcess...... D-52
SAP Business Connector x SAP AG SAP Business Connector SAP Adapter Guide
pub.sap.transport.BAPI:OutboundProcess...... D-52 XSLT Services ...... D-53 pub.sap.xslt.transformation:XSLTransformation ...... D-53 pub.sap.xslt.transformation:clearTemplatesCache ...... D-55 pub.sap.xslt.transformation:removeCachedTemplate ...... D-55 Demo Services ...... D-56 sap.demo:handleIDocXMLPost ...... D-56 sap.demo:handleRfcXMLPost ...... D-56 sap.demo:handlebXMLPost...... D-57 sap.demo:transform_IDoc-RFC-Values_to_IDoc-XML ...... D-57 sap.demo: writeSAPXMLFile ...... D-57 Sap.demo:invokeBAPIReturningbXML...... D-58 Miscellaneous Services...... D-58 wm.PartnerMgr.gateway.runtime:confirmTID ...... D-58 wm.PartnerMgr.xtn.Sweeper:sweepTRX...... D-59 IDoc Java API ...... D-59 Appendix E List of deprecated services ...... E-60 Appendix F INDEX...... F-1
SAP Business Connector xi SAP AG Introduction
Chapter 1: Introduction
Welcome!...... 1-2
Related Documentation...... 1-2
SAP1-1 Business Connector SAP AG Introduction Welcome!
Welcome! This guide describes how to install, configure, and develop applications for the SAP Business Connector. It contains information for administrators who manage the system, and for application developers who create applications that use the system. To use this guide effectively, you should: • Understand the basic concepts SAP Business Connector and XML. • Have completed the tutorial in the SAP Business Connector Developers Guide or have a general idea about how to perform basic tasks with the SAP BC Developer. • Know how to create flow services and/or Java services. • Be familiar with the set up and operation of the SAP Business Connector Server.
Related Documentation The following documents are companions to this guide. Some documents are in PDF format and others are in HTML.
Refer to this book… For…
SAP Business Connector Information about using the Server Administrator to configure, monitor, and Administration Guide control the SAP Business Connector Server. This book is for server administrators. You will find this book at:
SAP Business Connector Information that orients you to SAP BC and shows you how to create a Developer Tutorial simple application. It includes basic conceptual information about B2B. This book is aimed at new users of SAP Business Connector. You will find this book at:
SAP Business Connector Information about the controls in the SAP BC Developer application Developer Online Reference windows and step-by-step procedures describing how to perform tasks with the SAP BC Developer. You can access the online reference by clicking Help in an application window or dialog box. This reference is only available, when the SAP BC Developer is installed.
SAP Business Connector 1-2 SAP AG Introduction Related Documentation
Refer to this book… For…
SAP Business Connector This guide describes the built-in services provided with a standard Built-In Services installation of SAP Business Connector and located in the WmPublic or WmDB packages. You will find this document at:
Serialization of ABAP data in In depth information about how ABAP data is serialized in XML messages. XML This serialization is used for RFC and BAPI parameters. You will find this document at:
BizTalk Envelope In depth information about how the SAP BC uses the BizTalk Envelope for Specifications the transmission of business Documents. You will find this guide at:
SAP Business Connector Descriptions of the Java classes and built-in services you use to create API Reference SAP BC services. This reference is for application developers who build SAP BC services. You will find this book at:
SAP Business Connector 1-3 SAP AG Product Overview
Chapter 2: Product Overview
What is the SAP Business Connector?...... 2-2
Functional Highlights...... 2-2
Architecture and Components...... 2-6
Invoking Business Logic...... 2-8
Routing Messages through the Partner Manager...... 2-9
SAP Business Connector 2-1 SAP AG Product Overview Complete SAP System Integration
What is the SAP Business Connector? The SAP Business Connector allows you to extend your business processes over the internet and integrate non-SAP products using open and non-proprietary technology. The SAP Business Connector allows for bi-directional, real-time as well as asynchronous communication to and from the SAP server. You can: Execute SAP’s implementation-independent BAPI methods, as they are described in the Business Object Repository (BOR). BAPIs are stable, precisely-defined and well-documented interfaces to SAP solutions, providing standardized access to SAP solutions on a semantic level. You can quickly and easily create XML-based SAP BC services that execute a BAPI. Applications within your organization can then invoke the SAP BC services to execute a BAPI on the SAP server. Similarly, your business partners can make requests over the Internet to invoke a service that executes a BAPI. The BAPI-interfaces provide a unified access to the application-level functionality, independent of the type of call: Both synchronous as well as asynchronous processing can be triggered by using these interfaces. Asynchronous processing uses the ALE services inside the SAP System transparently for the client. Execute SAP Remote Function Calls (RFCs) from the SAP Business Connector Server. You can access all SAP functionality that is available via RFC from SAP Business Connector Server. External applications do not need to understand SAP datatypes, ABAP structures or the RFC protocol to communicate with an SAP system.