Você está na página 1de 126

TIBCO ActiveMatrix Adapter for SAP Examples

Software Release 6.0 February 2009

Important Information
SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE. USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN LICENSE.PDF) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE LICENSE FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME. This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc. TIB, TIBCO, TIBCO Adapter, Predictive Business, Information Bus, The Power of Now, TIBCO ActiveMatrix BusinessWorks, TIBCO Rendezvous, TIBCO Administrator, TIBCO Designer, TIBCO Runtime Agent, TIBCO Hawk, TIBCO Enterprise Message Service, TIBCO Designer Add-in for TIBCO Business Studio, TIBCO ActiveMatrix Service Grid, TIBCO ActiveMatrix Service Bus, TIBCO ActiveMatrix BusinessWorks Service Engine, and TIBCO Business Studio are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries. EJB, Java EE, J2EE, and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only. THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README.TXT FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM. THIS DOCUMENT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME. THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES. Copyright 1999-2009 TIBCO Software Inc. ALL RIGHTS RESERVED. TIBCO Software Inc. Confidential Information

| iii

Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii TIBCO ActiveMatrix Adapter for SAP Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii Other TIBCO Product Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii Third Party Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x Terminology and Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii How to Contact TIBCO Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv

Chapter 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Business Object Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Using TIBCO ActiveMatrix BusinessWorks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Working with dat files in TIBCO Designer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Creating a Database Table in the SAP System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Creating RFC Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Testing the Function Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Creating Outbound and Inbound Instances Using TIBCO Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Creating an Outbound Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Creating an Inbound Instance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Chapter 2 TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object . 31
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploy and Run the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 33 34 37

Chapter 3 TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object 39
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 41 43 44

TIBCO ActiveMatrix Adapter for SAP Examples

iv

| Contents
Chapter 4 TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 49 51 52

Chapter 5 TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object 55
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 57 59 60

Chapter 6 TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object 61
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 63 65 66

Chapter 7 TIBCO ActiveMatrix BusinessWorks: BDC Example. . . . . . . . . . . . . . . . . . . . . . . . . 69


Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 72 74 75

Chapter 8 TIBCO ActiveMatrix BusinessWorks: Dynamic Logon for RFC . . . . . . . . . . . . . . . . 77


Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 79 81 82

Chapter 9 TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 85 87 88

Chapter 10 TIBCO ActiveMatrix BusinessWorks: Data Caching using RFC . . . . . . . . . . . . . . 89


Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

TIBCO ActiveMatrix Adapter for SAP Examples

Contents v

Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Test the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

Chapter 11 TIBCO ActiveMatrix BusinessWorks: IDoc Filtering . . . . . . . . . . . . . . . . . . . . . . . . 95


Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Test the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

Chapter 12 TIBCO ActiveMatrix BusinessWorks: IDoc Reporting . . . . . . . . . . . . . . . . . . . . . 103


Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring Subscription Services for IDoc Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 104 107 109 110

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

TIBCO ActiveMatrix Adapter for SAP Examples

vi

| Contents

TIBCO ActiveMatrix Adapter for SAP Examples

| vii

Preface

This guide includes examples that demonstrate how the adapter interacts with TIBCO ActiveMatrix BusinessWorks.

Topics
Related Documentation, page viii Terminology and Acronyms, page xii How to Contact TIBCO Customer Support, page xiv

TIBCO ActiveMatrix Adapter for SAP Examples

viii

Preface

Related Documentation
This section lists documentation resources.

TIBCO ActiveMatrix Adapter for SAP Documentation


The following documents form the TIBCO ActiveMatrix Adapter for SAP documentation set: TIBCO ActiveMatrix Adapter for SAP Concepts Read this manual before reading any other book in the documentation set. This book describes the adapter, adapter features, and the applications that the adapter interacts with. TIBCO ActiveMatrix Adapter for SAP Installation Read this manual to learn how to install TIBCO ActiveMatrix Adapter for SAP. TIBCO ActiveMatrix Adapter for SAP Configuration and Deployment This manual explains how to create and configure standalone adapter projects. Information on deploying adapter projects is also included. TIBCO ActiveMatrix Adapter for SAP Examples This manual provides instructions to run the examples that demonstrate use of the adapter. TIBCO ActiveMatrix Adapter for SAP Release Notes Read this document for information about new features, deprecated features, and open and closed issues.

Other TIBCO Product Documentation


You may find it useful to read the documentation for the following TIBCO products. TIBCO Designer TIBCO Administrator TIBCO ActiveMatrix BusinessWorks TIBCO Rendezvous TIBCO Enterprise Message Service TIBCO Hawk TIBCO Adapter SDK TIBCO Runtime Agent

TIBCO ActiveMatrix Adapter for SAP Examples

Related Documentation ix

Third Party Documentation


SAP R/3: Implementation Guide by Bradley D. Hiquet, available from Kelly-Lacey & Associates Inc. This is A Managers Guide to Understanding SAP that emphasizes the users point of view. Printed in 1998 by Macmillan Technological Publishing. SAP R/3 Business Blueprint by Thomas Curran and Gerhard Keller. Printed in 1998 by Prentice Hall PTR. SAP R/3 System, A Client/Server Technology by Rudiger Buck-Emden. This is a general technical overview that is easy to read. Printed in 1996 by Addison-Wesley.

TIBCO ActiveMatrix Adapter for SAP Examples

Preface

Typographical Conventions
The following typographical conventions are used in this manual Table 1 General Typographical Conventions Convention
TIBCO_HOME ENV_HOME

Use Many TIBCO products must be installed within the same home directory. This directory is referenced in documentation as TIBCO_HOME. The value of TIBCO_HOME depends on the operating system. For example, on Windows systems, the default value is C:\tibco. Other TIBCO products are installed into an installation environment. Incompatible products and multiple instances of the same product are installed into different installation environments. The directory into which such products are installed is referenced in documentation as ENV_HOME. The value of ENV_HOME depends on the operating system. For example, on Windows systems the default value is C:\tibco.

code font

Code font identifies commands, code examples, filenames, pathnames, and output displayed in a command window. For example: Use MyCommand to start the foo process.

bold code font

Bold code font is used in the following ways: In procedures, to indicate what a user types. For example: Type admin. In large code samples, to indicate the parts of the sample that are of particular interest. In command syntax, to indicate the default parameter for a command. For example, if no parameter is specified, MyCommand is enabled: MyCommand [enable | disable]

italic font

Italic font is used in the following ways: To indicate a document title. For example: See TIBCO BusinessWorks Concepts. To introduce new terms For example: A portal page may contain several portlets. Portlets are mini-applications that run in a portal. To indicate a variable in a command or code syntax that you must replace. For example: MyCommand pathname

TIBCO ActiveMatrix Adapter for SAP Examples

Typographical Conventions xi

Table 1 General Typographical Conventions (Contd) Convention Key combinations Use Key name separated by a plus sign indicate keys pressed simultaneously. For example: Ctrl+C. Key names separated by a comma and space indicate keys pressed one after the other. For example: Esc, Ctrl+Q. The note icon indicates information that is of special interest or importance, for example, an additional action required only in certain circumstances. The tip icon indicates an idea that could be useful, for example, a way to apply the information provided in the current section to achieve a specific result. The warning icon indicates the potential for a damaging situation, for example, data loss or corruption if certain steps are taken or not taken.

TIBCO ActiveMatrix Adapter for SAP Examples

xii

Preface

Terminology and Acronyms


Term ABAP ALE/IDoc API Application Server BAPI CIF Component Definition Advanced Business Application Programming is a language in SAP used to write SAP specific code. Application Link Enabling/Intermediate Documents. Application Program Interface. The server on which the SAP processes run. Business API (Functionally equivalent to RFC). Certified Intermediate Format. A self-contained replaceable functional unit of the adapter that provides a set of interfaces. TIBCO ActiveMatrix Adapter for SAP has two kinds of components; r3Outbound and r3Inbound. r3Outbound encapsulates functionality for outbound communication with the SAP system while r3Inbound encapsulates the functionality for inbound communication with the SAP system. Electronic Data Interchange. Enterprise Message Service A server used to exchange data with the SAP system. An adapter configuration listening for messages inbound to the SAP system. Inbound instances transfer messages from the TIBCO environment to SAP. A functional sub-unit of the adapter that exposes one or more adapter services. For example, the RFCServer interface exposes RFC/BAPI Request-Response Invocation services. JAVA Messaging Service Multi-byte character string. One way invocation protocol allows you to invoke the BAPI/RFC in the SAP system without waiting for a reply from the system. An adapter configuration listening for messages outbound from SAP. Outbound instances transfer messages from SAP to the TIBCO environment.

EDI EMS Gateway Server Inbound Instance Interface

JMS MBCS One Way Invocation protocol Outbound Instance

TIBCO ActiveMatrix Adapter for SAP Examples

Terminology and Acronyms xiii

Term RV RFC RFC Client RVCM RFC Server RVDQ SAP Native data SSL TID TIDManager

Definition TIBCO Rendezvous protocol; also in certain contexts refers to reliable message quality of service, as opposed to certified message. The SAP Remote Function Call Interface. A SAP term for any program that can post RFCs/BAPIs/IDocs from an external system into the SAP system. TIBCO Rendezvous certified message quality of service. A SAP term for any external program that can accept and process RFCs/BAPIs/IDocs from the SAP system. TIBCO Rendezvous distributed queue. All SAP data that the adapter interacts with. It consists of RFC data types. This includes IDocs received as RFC tables in an RFC function call. Secure Sockets Layer. Transaction ID. A globally unique identifier used by transactional RFCs to ensure exactly-once execution of a transaction. Transaction Identifier Manager.

TIBCO ActiveMatrix Adapter for SAP Examples

xiv

Preface

How to Contact TIBCO Customer Support


For comments or problems with this manual or the software it addresses, please contact TIBCO Support as follows. For an overview of TIBCO Support, and information about getting started with TIBCO Support, visit this site: http://www.tibco.com/services/support If you already have a valid maintenance or support contract, visit this site: https://support.tibco.com Entry to this site requires a username and password. If you do not have a username, you can request one.

TIBCO ActiveMatrix Adapter for SAP Examples

|1
Chapter 1

Introduction

This chapter includes procedures and prerequisites that have to be carried out before you start running the examples provided with your adapter installation. Detailed information for the examples is provided in subsequent chapters of this guide.

Topics
Overview, page 2 Creating a Database Table in the SAP System, page 10 Creating RFC Functions, page 15 Testing the Function Modules, page 22 Testing the Function Modules, page 22 Creating Outbound and Inbound Instances Using TIBCO Designer, page 24 Creating an Inbound Instance, page 27

TIBCO ActiveMatrix Adapter for SAP Examples

| Chapter 1

Introduction

Overview
The examples discussed in this guide demonstrate how TIBCO ActiveMatrix Adapter for SAP interacts with TIBCO ActiveMatrix BusinessWorks. Simple publish-subscribe or request-response scenarios are used to demonstrate the different interactions.

Business Object Examples


The following business objects are used in the examples to build an end-to-end enterprise wide integration and demonstrate the adapter capabilities: Customer SalesOrder PurchaseOrder Employee ItemMaster

The examples provide different operations on each of these business objects: Get - In this operation, TIBCO ActiveMatrix BusinessWorks requests data to be fetched from the SAP system. The Request-Response service is used to fetch records from the SAP system. The query is read from an XML file (it could also be done by a comma separated file or a database). The corresponding BAPI is executed on the SAP server and the result is given back to TIBCO ActiveMatrix BusinessWorks. The results are mapped from ActiveEnterprise to XML format, and written to an XML file. A diagrammatic representation of the Get operation is given next.

TIBCO ActiveMatrix Adapter for SAP Examples

Overview 3

Figure 1 Business Object Operation: Get


Request XML Response XML SAP System

TIBCO ActiveMatrix BusinessWorks

TIBCO ActiveMatrix Adapter for SAP Customer details

BAPI_CUSTOMER_G ETDETAIL1

Request for customer information

TIBCO Environment

Insert - In this operation, TIBCO ActiveMatrix BusinessWorks sends data to the SAP System to create a record. The Request-Response adapter service is used to send a record and get a response from the SAP system. The record details are read from an XML file. The corresponding BAPI is executed on the SAP server and the result is given back to TIBCO ActiveMatrix BusinessWorks. The results are then written to an XML file. A diagrammatic representation of the Insert operation is given next:

Figure 2 Business Object Operation: Insert.


Request XML Response XML SAP System

TIBCO ActiveMatrix BusinessWorks Request to create Sales order Sales order number TIBCO Environment

TIBCO ActiveMatrix Adapter for SAP

BAPI_SALESORDER_ CREATEFROMDAT1 Service

Sync - In this operation, the SAP System sends (publishes) data, which is received by TIBCO ActiveMatrix BusinessWorks. The Publication service in the adapter is used to send records from the SAP system in the form of IDocs. The data is received by TIBCO ActiveMatrix BusinessWorks and written to an XML file. A diagrammatic representation of the Sync operation is given next.
TIBCO ActiveMatrix Adapter for SAP Examples

| Chapter 1

Introduction

Figure 3 Business Object Operation: Sync


SAP System

TIBCO ActiveMatrix Adapter for SAP

IDoc ORDERS01 Publication Service

Purchase Order Information

XML file

TIBCO Environment

TIBCO ActiveMatrix BusinessWorks

Customer This example demonstrates the Get, Create and Sync operations on the Business Object. Pre-configured TIBCO ActiveMatrix BusinessWorks processes are available with the adapter installation to perform these operations. A brief description of these processes is given next.
Customer

process fetches customer details from the SAP system and writes them to a database table. You can write the data in an XML file by making a small modification in the XML file as explained later in the guide. The Customer Number is read from an XML file containing query details.
Get_Customer

creates a new customer in the SAP system. Customer details are read from an XML file.
Create_Customer Sync_Customer

publishes an IDoc, out of the SAP system whenever a new customer is created. TIBCO ActiveMatrix BusinessWorks receives details of this customer and includes them in an XML file.

SalesOrder This example demonstrates the Get, Create and Sync operations on the SalesOrder Business Object. Pre-configured TIBCO ActiveMatrix BusinessWorks processes are available with the adapter installation to perform these operations. A brief description of these processes is given next.
Get_SalesOrder

fetches Sales Orders from the SAP system and writes them in an XML file. The CustomerNumber, Material, SalesOrganization

TIBCO ActiveMatrix Adapter for SAP Examples

Overview 5

parameters are read from another XML file. Sales Orders based on these parameters are retrieved from the SAP system. creates a Sales Order in the SAP system and writes the details of the operation in an XML file. The data that needs to be passed to create an order in the SAP system is read from another XML file.
Create_SalesOrder

publishes an IDoc, out of the SAP system whenever a new SalesOrder is created. TIBCO ActiveMatrix BusinessWorks receives details of this SalesOrder, and includes them in an XML file.
Sync_SalesOrder

PurchaseOrder This example demonstrates the Get and Sync operations on the PurchaseOrder Business Object. Pre-configured TIBCO ActiveMatrix BusinessWorks processes are available with the adapter installation to perform these operations. A brief description of these processes is given next. fetches Purchase Order details from the SAP system and writes them in an XML File. The Purchase Order Number is read from another XML file.
Get_PurchaseOrder

publishes an IDoc, out of the SAP system whenever a new Purchase Order is created or changed. TIBCO ActiveMatrix BusinessWorks receives details of this Purchase Order, and writes them in an XML file.
Sync_PurchaseOrder

Employee This example demonstrates the Get operation on the Employee Business Object. A pre-configured TIBCO ActiveMatrix BusinessWorks process is available with your adapter installation. A brief description of the process is given next. gets Employee details from the SAP system, based on parameters stored in an XML file. These details are then written into another XML file.
Get_Employee

ItemMaster This example demonstrates the Get and Sync operations on the ItemMaster Business Object. Pre-configured TIBCO ActiveMatrix BusinessWorks processes are available with the adapter installation to perform these operations. A brief description of these processes is given next. Fetches Material details from the SAP system and writes these to an XML file.
Get_ItemMaster

Whenever a Material record is created or changed in the SAP system, an IDoc is published. On reception of the notification, TIBCO
Sync_ItemMaster

TIBCO ActiveMatrix Adapter for SAP Examples

| Chapter 1

Introduction

ActiveMatrix BusinessWorks triggers the SyncItemMaster process. This reads the published message and writes the Material details in an XML file.

TIBCO ActiveMatrix Adapter for SAP Examples

Prerequisites 7

Prerequisites
To try out the examples, you must first set up a custom integration scenario in your SAP system. Carry out the following steps to set up the integration scenario: 1. Create a database table in the SAP system. See Creating a Database Table in the SAP System on page 10 for details. 2. Create function modules (BAPIs) to add, delete and modify entries. See Creating RFC Functions on page 15 for details. 3. Configure outbound adapters. See Creating an Outbound Instance on page 24 for details. 4. Configure inbound adapters. See Creating an Inbound Instance on page 27 for details.

Using TIBCO ActiveMatrix BusinessWorks


If you are using the adapter with TIBCO ActiveMatrix BusinessWorks, the following software must be installed to run the examples: TIBCO ActiveMatrix Adapter for SAP TIBCO ActiveMatrix BusinessWorks TIBCO Administrator SAP System TIBCO Runtime Agent

Refer to the TIBCO ActiveMatrix Adapter for SAP readme.txt for the supported versions of the software listed above. The TIBCO ActiveMatrix BusinessWorks examples use TIBCO Designer to create an Enterprise Archive File (EAR) and TIBCO Administrator to deploy the EAR file. In TIBCO Administrator, make sure all software components needed by the adapter instance are installed on one or more machines that are part of a TIBCO Administration Domain and that the software is registered in the domain. Use the TIBCO Domain Utility to add a machine to a TIBCO Administration Domain. In TIBCO Administrator, use the Resource to register software.
Management > Machines

console

These topics are explained in the TIBCO Administrator documentation set.

TIBCO ActiveMatrix Adapter for SAP Examples

| Chapter 1

Introduction

Location
The files for the examples are in the following location:
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\<Busi nessObjectName>,

where <version_number> is the adapter version number. Make sure the resources in the examples point to the correct location.

Working with dat files in TIBCO Designer


The dat files included in the adapter installation are used by all examples except the TIBCO ActiveMatrix BusinessWorks examples. You cannot directly open a dat file in TIBCO Designer and make modifications to the configurations. To do this, complete the following steps:

TIBCO ActiveMatrix Adapter for SAP Examples

Prerequisites 9

1. Convert the dat file to a multi-file project. a. Open TIBCO Designer. In the first screen that is displayed, click Administration. The screen is shown next.

b. Then click the Convert DAT to Files icon. In the window that is displayed, browse and select the dat file you wish to convert to a multi-file project. Click OK.

2. Click the Open existing project icon from the first TIBCO Designer screen. Browse to the directory where the converted multi-file project is saved. 3. Make configuration changes as per your requirements. 4. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK.

TIBCO ActiveMatrix Adapter for SAP Examples

10

| Chapter 1

Introduction

Creating a Database Table in the SAP System


To create an employee table in the SAP system ABAP dictionary, you must create a structure in that dictionary. To do this: 1. Start the SAP system. 2. In the logon screen, select Tools>ABAP Workbench>Development>ABAP Dictionary. The following screen is displayed.

3. Select the Datatype radio button and type ZMRM_STR in the associated text field. 4. Click the Create icon.

TIBCO ActiveMatrix Adapter for SAP Examples

Creating a Database Table in the SAP System 11

5. Select the Structure radio button in the Create Type ZMRM_STR pop up and click the icon.

6. Enter the values NAME and GRP in the Component column. 7. Enter the values CHAR30 and CHAR25 in the Component type column for the values NAME and GRP. 8. To save the structure click Save. The following screen is displayed.

9. Click Local object to save the ZMRM_STR structure. This will take you back to the previous screen. 10. Click Structure and then click Activate to make this structure available.
TIBCO ActiveMatrix Adapter for SAP Examples

12

| Chapter 1

Introduction

11. Click Back to return to the Dictionary Objects browser as shown next.

12. Select the Database table radio button and enter the name of the table as ZMRM_TABLE. 13. Click the Create icon to create the table.

14. Enter a short description for the object in the Short Description field, select C in the Delivery class field and select Display/Maintenance Allowed in the Data Browser/Table View Maint. field.

TIBCO ActiveMatrix Adapter for SAP Examples

Creating a Database Table in the SAP System 13

15. Select the Fields tab.

16. Enter the values MANDT, EMPNUM and .INCLUDE in the Fields column. 17. Select the Key check boxes next to MANDT and EMPNUM fields. 18. To save the structure click Save. 19. Click Local object to save the ZMRM_STR structure. This will take you back to the previous screen. 20. Click the Technical Settings button to get the following screen.

TIBCO ActiveMatrix Adapter for SAP Examples

14

| Chapter 1

Introduction

21. Select USER in the Data class field, select 0 in the Size Category field and select the Buffering not allowed radio button in the Buffering section. Save your settings. 22. Select Back to return to the previous screen. 23. Select Table>Activate to activate the table.

TIBCO ActiveMatrix Adapter for SAP Examples

Creating RFC Functions 15

Creating RFC Functions


Here, we write two simple RFC functions to add and get employee information. 1. Start the SAP system. In the logon screen, select Tools>ABAPWorkbench>Development>SE37-FuncionBuilder to invoke Function Builder initial screen.

2. Select Goto>Function groups>Create group.

3. Enter ZNEW in the Function group field and a short description of the Function group in the Short Text field.

TIBCO ActiveMatrix Adapter for SAP Examples

16

| Chapter 1

Introduction

4. To save the structure click Save. The following screen is displayed.

5. Click Local object to save the ZMRM_STR structure. This will take you back to the Function Builder initial screen.

6. Enter Z_ADDEMPINFO in the Function module field.

TIBCO ActiveMatrix Adapter for SAP Examples

Creating RFC Functions 17

7. Click Create to create the function module. The following screen is displayed.

8. Enter ZNEW in the Function group field and a short description in the Short text field. 9. Click Save. The following screen is displayed.

10. Click the Import tab. 11. Enter SOCNUM and REFSTR in the Parameter name column which refer to the ZMRM_TABLE's EMPNUM and ZMRM_STR respectively.

TIBCO ActiveMatrix Adapter for SAP Examples

18

| Chapter 1

Introduction

12. Click the Exceptions tab.

13. Enter INSERT_FAILED in the Exception column. This is the exception the code uses. 14. Click Activate, and then click Save to create the Z_ADDEMPINFO function module. 15. Click the Source code tab.

16. Enter your custom code. Click Save to save changes.

TIBCO ActiveMatrix Adapter for SAP Examples

Creating RFC Functions 19

17. Click Back to return to the Function Builder initial screen, and then enter the value Z_GETEMPINFO in the Function module field and click the Create icon to create the second function module.

18. Click the Import tab. In the Import parameter column enter SOCNUM and REFSTR, which refer to the ZMRM_TABLE's EMPNUM and ZMRM_STR respectively. The following screen shows the Import parameters.

TIBCO ActiveMatrix Adapter for SAP Examples

20

| Chapter 1

Introduction

19. Click the Export tab. Enter the Export parameter in the first column. Enter the corresponding Reference Field/Structure. The following screen shows the export parameters.

20. Click the Tables tab. Enter the Table parameter in the first column. Enter the corresponding Reference Structure. The following screen shows the Table parameters.

TIBCO ActiveMatrix Adapter for SAP Examples

Creating RFC Functions 21

21. Click the Exceptions tab. Define the exception that you will be using in the code. The following screen shows an example.

22. Click Activate to activate the Function module and then click Save to save. 23. Click the Source Code icon to display the following screen.

24. Enter your custom code as shown and click Save.

TIBCO ActiveMatrix Adapter for SAP Examples

22

| Chapter 1

Introduction

Testing the Function Modules


1. To test whether the function modules, which you have created earlier in the previous sections are working correctly, go to Function Builder initial screen. 2. Enter the name of the Function Module and select FunctionModule>Test>SingleTest. The following Test Function Module initial screen is displayed.

3. Enter the values SOCNUM and REFSTR in the Import parameters column.

TIBCO ActiveMatrix Adapter for SAP Examples

Testing the Function Modules 23

4. Click the EXECUTE icon. The following screen is displayed.

5. If you try to add the same employee details twice, the following exception is displayed:

6. Test the other function modules similarly.

TIBCO ActiveMatrix Adapter for SAP Examples

24

| Chapter 1

Introduction

Creating Outbound and Inbound Instances Using TIBCO Designer


This is an end-to-end example that demonstrates the communication between the outbound and inbound instances of the adapter. Both adapter instances connect to the SAP system. The outbound and inbound instances are pre-configured. The subsequent sections explain how to arrive at these configurations.

Creating an Outbound Instance


Setting up Connection 1. Start TIBCO Designer. (For details refer to the TIBCO Designer User's Guide.) 2. Drag and drop an R/3 Adapter Configuration icon from the R/3 palette panel to the design panel. The folders in the project panel will be created as follows: R/3 Adapter Configuration R/3 Connections 3. Set options in the Design-Time Connection tab.

TIBCO ActiveMatrix Adapter for SAP Examples

Creating Outbound and Inbound Instances Using TIBCO Designer 25

4. Specify values in the fields. Click Test Connection to test the connection. 5. Next, click the projects Adapter Services folder. The R/3 Filters tab is displayed. Selecting Schema 1. Click Fetch RFC/BAPIs. The progress bar is displayed, indicating that information is being downloaded from the SAP system. Specify the following in the RFC/BAPI tab: In the Name column, select the Z-ADDEMPINFO function from the appropriate group in the list. This is the function that you created earlier to add employee information. Select the Used checkbox and click Apply. A service for the RFC is created automatically. The RFC/BAPI appears in the design panel. Selecting a Service 1. Select the adapter service, associate it with the corresponding schema, and specify information in the Configuration and Advanced tabs. Click Apply to create an outbound service. In the Configuration tab, default values are displayed. 2. In the Advanced tab, specify a Subject. This subject name should be the same as in the inbound instance. 3. Associate the service with the corresponding schema. Select the RFC/ABAP functions (Z_GETEMPINFO,Z_DELEMPINFO) created earlier in the Request-Response mode. See Creating RFC Functions on page 15 for details on creating these functions. 4. Next, click R3Adapterconfiguration in the project folder. In the Configuration tab, enable Show All Tabs. The Adapter Services tab is displayed. 5. In the Adapter Services tab, set the TID Management field to Remote. This ensures that all the transactional RFC calls occur only once. For details on TID

TIBCO ActiveMatrix Adapter for SAP Examples

26

| Chapter 1

Introduction

Manager, see TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment.

6. Click Apply. 7. In the Configuration tab, select Outbound in the R/3


Connection

field.

8. Configure the outbound instance using the Run-time Outbound tab.

9. In the Program ID field, specify the value sapides that you have provided in the SAP system during configuration of the RFC destination. 10. In the Gateway
Service

field, specify the SAP gateway service.

11. In the Gateway Host field, specify the gatewayHost name or the IP address or router string. If there is no specific machine acting as the gateway host, this is the same as the appserver.

TIBCO ActiveMatrix Adapter for SAP Examples

Creating Outbound and Inbound Instances Using TIBCO Designer 27

12. In the RFC Trace field, indicate whether the trace is on or off. Possible values are 0 and 1 only. 0 is the default value. You need not change the default settings. 0 denotes the trace is OFF. 1 denotes the trace is ON. 13. Click Apply. Running the example Use the properties file to run the outbound adapter instance.
tibco.repourl TIBCO_HOME\adapter\adr3\<version_number>\examples\repository\R3Ada pterExamples_Instance.dat tibco.configurl \tibco\private\adapter\SAPAdapter40\R3AdapterConfiguration

Creating an Inbound Instance


To create an inbound instance of the adapter, use the following steps: Setting up Connection 1. Start TIBCO Designer. For details on the TIBCO Designer, use the Help options in the TIBCO designer GUI or refer the TIBCO Designer User's Guide. 2. Drag and drop an R/3 Adapter Configuration icon from the R/3 palette panel to the design panel. The folders in the project panel will be created as follows: R/3 Adapter Configuration R/3 Connections 3. In the Configuration tab, select Inbound from the R/3 drop-down. Ensure that the design-time adapter is running.
Connection Type

TIBCO ActiveMatrix Adapter for SAP Examples

28

| Chapter 1

Introduction

4. Set connection options in the Design-Time

Connection

tab.

5. Specify values in fields. Click Test Connection to test the connection. 6. Select the Adapter Services folder, fetch the schema using the Fetch RFC/BAPIs button. 7. Click the RFC/BAPI tab. 8. Select the Function group from the list that is displayed. 9. Select the Used check box against the required schema and click Apply to create an inbound service. In this example, select RFC/ABAP functions (Z_GETEMPINFO and Z_DELEMPINFO) created earlier in the Request-Response mode. 10. Specify details in the Configuration and Advanced tabs.

TIBCO ActiveMatrix Adapter for SAP Examples

Creating Outbound and Inbound Instances Using TIBCO Designer 29

11. In the Advanced tab, specify the Subject. The subject name specified in this instance should be the same as in the outbound instance.

Ensure that the subject name in both Inbound instance and Outbound instance match for all three RFC functions. This allows the outbound adapter to communicate with the inbound adapter. 12. In the Configuration tab, select Inbound in the R/3 13. Configure the inbound instance using the Run-time
Connection Inbound

field.

tab.

TIBCO ActiveMatrix Adapter for SAP Examples

30

| Chapter 1

Introduction

14. Settings used in the Design-time Connection tab are populated by default in the Run-time Inbound tab. You can test the connection by clicking Test Connection. 15. Click Apply. Running the example Use the properties file to run the inbound adapter instance.
tibco.repourl TIBCO_HOME\adapter\adr3\<version_number>\examples\repository\R3Ada pterExamples_Instance.dat tibco.configurl \tibco\private\adapter\SAPAdapter40\R3AdapterConfiguration

TIBCO ActiveMatrix Adapter for SAP Examples

| 31
Chapter 2

TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object

This example shows how to use several adapter services within a TIBCO ActiveMatrix BusinessWorks process to create, get and synchronize Customer details stored in SAP. The example is deployed and run using the TIBCO Administrator GUI. All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\Customer

This example uses TIBCO Rendezvous as its transport type.

Topics
Example Description, page 32 Setup the Example, page 33 Deploy and Run the Example, page 34 Expected Results, page 37

TIBCO ActiveMatrix Adapter for SAP Examples

32

| Chapter 2

TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object

Example Description
This example illustrates how the adapters Subscription and Request-Response services can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has three processes, Create_Customer, Get_Customer and Sync_Customer.
Create_Customer

uses the adapters Request-Response service to create a customer record in SAP.


Create_Customer

uses the input XML file (containing details about the customer to be created) to invoke the Request-Response service and creates a customer in SAP. It returns a customer number for the customer record created in the SAP system.
Get_Customer uses the adapters Request-Response Service to fetch data from SAP for a particular customer. The data is fetched based on the customer number specified in the input XML file and is written into an output XML file. Sync_Customer

uses the adapters Subscription service to subscribe to update or modification messages from SAP whenever Customer details are modified or updated in the SAP system. On receiving the Customer details, TIBCO ActiveWorks BusinessWorks writes the IDoc to an XML file.

For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 33

Setup the Example


Before starting the example you must import the sample project zip file and save it in a new project. Setup for all the processes: In TIBCO Designer: 1. In the initial dialog box click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the Customer.zip file. The file is located in the following folder <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessW
orks\Customer

4. Save the project as a multi-file project by the name Customer. 5. Select Customer in the project panel. 6. For Create_Customer and Get_Customer processes, click the File Poller icon. In the configuration panel, File Name field, click Browse and select the corresponding input XML file from the path given in step 3. Click Apply. Any change to the input XML file starts the process. 7. Select the Enterprise Archive Object, Customer. Click Build Archive in the Configuration tab. This creates an archive file. For more information on creating an EAR file, see TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment. 8. Exit TIBCO Designer.

TIBCO ActiveMatrix Adapter for SAP Examples

34

| Chapter 2

TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object

Deploy and Run the Example


Perform the following tasks to deploy and run the example. Task A Deploy the Example In TIBCO Administrator: 1. Click on the Installed Software link on the left panel. Check if TIBCO ActiveMatrix Adapter for SAP is registered. If the software is not registered, register by clicking the Add Custom Software button. Please refer to the TIBCO Administrator documentation for more details on adding custom software. 2. Go to Application Management. Click New Application. Upload the EAR file created in the previous section and click OK. On the following screen, clear the Quick Configure check box and then click Save. 3. Click Configuration in the newly created application. Click on the top level application name in the configuration view. a. Go to the Advanced tab and provide the values for AppServer, Client, GatewayHost, GatewayService, ProgramID, SystemNumber, TIBCO_HOME, UserName b. Click Save. The Configuration screen appears. c. Click the Adapter archive and click Add To Additional Machines. d. Select the machine and click OK. In the following screen, click Save. e. In the Configuration screen click Deploy which will take you to the next screen. The Start successfully deployed services check box is selected by default. Click OK. The .tra files are created in <Adapter_Home>\bin\domain\<DomainName>. 4. Once the deployment is complete, click Service Instances under the application. The adapter is listed. Both the customer creation and customer fetching process is started. The adapter instance is also started. Task B Run the Example To run each example: 1. To trigger Create_Customer, you must make a change in the Create_Customer_Send_Template.xml file and save. An example of the XML file is given next.
<?xml version="1.0" encoding="utf-8"?>

TIBCO ActiveMatrix Adapter for SAP Examples

Deploy and Run the Example 35

<CustomerCreateFromData1> <CopyReference> <SALESORG>3000</SALESORG> <DISTR_CHAN>10</DISTR_CHAN> <DIVISION>01</DIVISION> <REF_CUSTMR>0000003000</REF_CUSTMR> </CopyReference> <OptionalPersonalData> <TRANSPZONE></TRANSPZONE> <CONTROL_ACCOUNT></CONTROL_ACCOUNT> <PMNTTRMS></PMNTTRMS> <SHIP_COND></SHIP_COND> <DELYG_PLNT></DELYG_PLNT> <PART_DLV></PART_DLV> <C_CTR_AREA></C_CTR_AREA> <TAXJURCODE></TAXJURCODE> </OptionalPersonalData> <PersonalData> <TITLE_P></TITLE_P> <FIRSTNAME>Jigar</FIRSTNAME> <LASTNAME>Kadakia</LASTNAME> <MIDDLENAME></MIDDLENAME> <SECONDNAME></SECONDNAME> <DATE_BIRTH>03031978</DATE_BIRTH> <CITY>bangalore</CITY> <DISTRICT></DISTRICT> <POSTL_COD1>123456</POSTL_COD1> <POSTL_COD2>123456</POSTL_COD2> <PO_BOX>334458</PO_BOX> <PO_BOX_CIT>122230</PO_BOX_CIT> <STREET>123 ABC</STREET> <HOUSE_NO></HOUSE_NO> <BUILDING></BUILDING> <FLOOR></FLOOR> <ROOM_NO></ROOM_NO> <COUNTRY>IN</COUNTRY> <COUNTRYISO>IN</COUNTRYISO> <REGION></REGION> <TEL1_NUMBR>1111</TEL1_NUMBR> <TEL1_EXT></TEL1_EXT> <FAX_NUMBER>1111</FAX_NUMBER> <FAX_EXTENS></FAX_EXTENS> <E_MAIL>prasad_joshi@infy.com</E_MAIL> <LANGU_P>E</LANGU_P> <LANGUP_ISO>EN</LANGUP_ISO> <CURRENCY>INR</CURRENCY> <CURRENCY_ISO>INR</CURRENCY_ISO> <TITLE_KEY></TITLE_KEY> <ONLY_CHANGE_COMADDRESS></ONLY_CHANGE_COMADDRESS> </PersonalData> </CustomerCreateFromData1>

The process with the help of the XML parser and the mapper constructs the data required for the adapter Request-Response service. The Invoke task triggers the Request-Response service. The Request-Response service executes the BAPI_CREATE_CUSTOMERFROMDATA1, which creates a customer in the SAP
TIBCO ActiveMatrix Adapter for SAP Examples

36

| Chapter 2

TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object

system.using the details given in the above XML file. The Request-Response service then sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders it into an XML form and writes that to BAPI_CREATE_CUSTOMERFROMDATA1.xml file. 2. To trigger Get_Customer, you must make a change in the Get_Customer_Send_Template.xml input file. In the example given below the Customer number is changed:
<?xml version="1.0" encoding="utf-8"?> <CustomerGetDetail1 CustomerNo="5068609616"> <DistributionChannel></DistributionChannel> <Division></Division> <SalesOrganiation></SalesOrganiation> </CustomerGetDetail1>

TIBCO ActiveWorks BusinessWorks maps the data to the schema using a parser and mapper, and then passes the data to an invoke task. The Invoke task sends a request to the adapter Request-Response service. The Request-Response service fetches customer details from SAP using bapi_customer_getdetail and sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders the data into an XML format and writes that to an output bapi_customer_getdetail.xml file. 3. When a Debmas IDoc is sent from SAP, the Sync_Customer process is triggered. For example: When a Debmas IDoc is sent from SAP, the Subscription service activity in the TIBCO ActiveMatrix BusinessWorks process is triggered. The received IDoc is then rendered into an XML and written to an output debmas.xml file.

TIBCO ActiveMatrix Adapter for SAP Examples

Expected Results 37

Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\Customer

Create_Customer -

Data is created based on the customer details specified in the input XML file and a customer is created in the SAP system. An XML file, bapi_create_customerfromdata1.xml (containing the customer number of the customer created in the SAP system.) is created. In case of error, bapi_create_customerfromdata1_error.txt is created.
Get_Customer - Data is fetched based on the customer number specified in the input XML file. The customer details are fetched and written into the bapi_customer_getdetail.xml file. In case of error, bapi_customer_getdetail_error.txt is created. Sample of the bapi_customer_getdetail.xml file is given next.

<?xml version="1.0" encoding="UTF-8"?> <ns0:Customer.GetDetail1.Response xmlns:ns0="urn:sap-com:document:sap:business" CustomerNo="5068609617"> <PersonalData> <FIRSTNAME>Jigar Kadakia</FIRSTNAME> <STREET>123 ABC</STREET> <HOUSE_NO>123456</HOUSE_NO> <FAX_NUMBER>1111</FAX_NUMBER> </PersonalData> </ns0:Customer.GetDetail1.Response>

Sync_Customer

- Output (IDoc DEBMAS) is stored in the debmas.xml file. Sample of the debmas.xml is given next.

<?xml version="1.0" encoding="US-ASCII"?> <DEBMAS01> <IDOC> <E1KNA1M> <MSGFN>005</MSGFN> <KUNNR>0000000100</KUNNR> <ANRED>Firma</ANRED> <KUKLA/> <LAND1>DE</LAND1> <NAME1>OEM Meyer</NAME1> <NAME2/> <ORT01>Dsseldorf</ORT01> <ORT02/> <PFACH/> <REGIO>05</REGIO> <COUNC/> <CITYC/> </E1KNA1M> </IDOC> </DEBMAS01>

TIBCO ActiveMatrix Adapter for SAP Examples

38

| Chapter 2

TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object

TIBCO ActiveMatrix Adapter for SAP Examples

| 39
Chapter 3

TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object

This example shows how to use several adapter services within a TIBCO ActiveMatrix BusinessWorks process to create and get SalesOrder details in the SAP system All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWorks
\SalesOrder

This example uses Java Messaging Service (JMS) as its transport type.

Topics
Example Description, page 40 Setup the Example, page 41 Test the Example, page 43 Expected Results, page 44

TIBCO ActiveMatrix Adapter for SAP Examples

40

| Chapter 3

TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object

Example Description
This example shows how the adapters Request-Response service can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has two processes, Create_SalesOrder and Get_SalesOrder.
Create_SalesOrder uses the adapters Request-Response service to create a SalesOrder record in the SAP system. Create_SalesOrder

uses the input XML file (containing details about the sales order to be created) to invoke the Request-Response service and creates a sales order in the SAP system. It returns the sales order number for the sales order created in the SAP system. Any update in the input file triggers the Create_SalesOrder process. The process with the help of the XML parser and the mapper constructs the data required for the adapter Request-Response service. The Invoke task triggers the Request-Response service. The Request-Response service executes the bapi_salesorder_createfromdata1, which creates a sales order in SAP. The Request-Response service then sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders it into an XML form and writes that to a file.

uses the adapters Request-Response service to fetch data from SAP for a particular sales order. The data is fetched based on the Customer number, Type of Material and Sales Organization that you specify in the input XML file. The data is sent back by the adapter to TIBCO ActiveMatrix BusinessWorks and is written into an output XML file.
Get_SalesOrder

Any update in the input file triggers the Get_SalesOrder process. TIBCO ActiveWorks BusinessWorks maps the data to the schema using a parser and mapper, and then passes the data to an invoke task. Invoke task sends request to the adapter Request-Response service. The Request-Response service fetches sales order details from SAP using bapi_salesorder_getlist and sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders the data into an XML format and writes that to an output file. For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 41

Setup the Example


Before starting the example you must import the sample project zip file and save it in a new project. Task A Create_SalesOrder and Get_SalesOrder Setup: In TIBCO Designer: 1. In the initial dialog box click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the SalesOrder.zip file. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessW
orks\Sales Order

4. Save the project as a multi-file project by the name SalesOrder. 5. Select the SalesOrder process. 6. Click the File Poller icon. In the configuration panel, File Name field, click Browse and select the corresponding input XML file from the path given in step 3. Click Apply. 7. Check the checkbox for Include Existing Files. 8. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService JMSProviderUrl Password ProgramID SystemNumber TIBCO_HOME (Home directory of the TIBCO installation) UserName 9. Test the connection to ensure connectivity. 10. Validate the project to ensure there are no errors.
TIBCO ActiveMatrix Adapter for SAP Examples

42

| Chapter 3

TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object

11. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 12. Modify the repourl and configurl parameters in adr3.tra under
<install-path>\tibco\adapter\adr3\<version_number>\bin

folder to point to the dat file. 13. Run the adapter from the command line
adr3--propFile

<adapter_home>\bin\adr3.tra

14. Exit TIBCO Designer. Task B Start EMS Server This example uses JMS as the transport type. Ensure that the TIBCO Enterprise Message Service server is running and accessible to the machine on which the adapter is installed before running any of the processes.

TIBCO ActiveMatrix Adapter for SAP Examples

Test the Example 43

Test the Example


In TIBCO Designer: 1. From the project panel, select the process you want to test. For example, Create_SalesOrder. 2. Click the Set Breakpoints icon. 3. In the window that appears, choose Select All, then click OK. 4. Click the Tester tab to the left of the project panel. The test panel replaces the project tree. 5. Click the Start testing viewed process button. 6. In the process selection window that appears, the Create_SalesOrder process is selected by default. Click Load Selected. The process is now in Test mode. Any change to the input XML file starts the process. 7. Once the process starter is highlighted (indicating a process has started), click the Step to next activity icon to step through the process. 8. Click the Stop Testing icon to return to design mode. 9. Follow the above steps to test the other processes.

TIBCO ActiveMatrix Adapter for SAP Examples

44

| Chapter 3

TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object

Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\Salesorder

1.

The results are directly reflected in the SAP system. The data is created based on the sales order details specified in the input XML file and a sales order is created in the SAP system. An XML file, bapi_salesorder_createfromdata1.xml (containing the Sales Order number of the sales order created in the SAP system.) is created. In case of error, bapi_salesorder_createfromdata1_error.txt is created. Sample of the bapi_salesorder_createfromdata1.xml is shown next.
Create_SalesOrder

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <SalesOrder.CreateFromDat1.Response xmlns = "urn:sap-com:document:sap:business" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" SalesDocument = "0000011260"> <BillingParty> <PAYER>0000003050</PAYER> <NAME>Bush Holdings, Inc.</NAME> <STREET>1 1 408 Michigan Avenue</STREET> <POSTL_CODE>60611</POSTL_CODE> <CITY>CHICAGO</CITY> <LANGU>E</LANGU> <COUNTRY>US</COUNTRY> <C_CTR_AREA>3000</C_CTR_AREA> <CRED_ACCNT>0000003050</CRED_ACCNT> <CRED_LIMIT>1000</CRED_LIMIT> <ORDER_VALS>0</ORDER_VALS> <RCVBL_VALS>0</RCVBL_VALS> <CRED_LIAB>0</CRED_LIAB> <CURRENCY>USD</CURRENCY> <VAL_LIMIT>0</VAL_LIMIT> <PMNTTRMS>NT30</PMNTTRMS> <ADD_VAL_DY>00</ADD_VAL_DY> <FIX_VAL_DY>00000000</FIX_VAL_DY> <REBATE_FRM>19650921</REBATE_FRM> </BillingParty> <ShipToParty> <SHIP_TO>0000003000</SHIP_TO> <NAME>Thomas Bush Inc.</NAME> <STREET>1 1 2800 South 25th Ave</STREET> <POSTL_CODE>60153</POSTL_CODE> <CITY>MAYWOOD</CITY> <LANGU>E</LANGU> <DEST_CNTRY>US</DEST_CNTRY> <TRNSP_ZONE>0000000003</TRNSP_ZONE> <TELEPHONE>(312)450-BUSH</TELEPHONE> <UNLOAD_PT>Dock 1</UNLOAD_PT> <FAC_CALEND>01</FAC_CALEND> <RECV_HOURS>001</RECV_HOURS>

TIBCO ActiveMatrix Adapter for SAP Examples

Expected Results 45

<MO_AM_FROM>090000</MO_AM_FROM> <MO_AM_UNTL>124500</MO_AM_UNTL> <MO_PM_FROM>130000</MO_PM_FROM> <MO_PM_UNTL>170000</MO_PM_UNTL> <TU_AM_FROM>083000</TU_AM_FROM> <TU_AM_UNTL>120000</TU_AM_UNTL> <TU_PM_FROM>130000</TU_PM_FROM> <TU_PM_UNTL>170000</TU_PM_UNTL> <WE_AM_FROM>083000</WE_AM_FROM> <WR_AM_UNTL>120000</WR_AM_UNTL> <WE_PM_FROM>130000</WE_PM_FROM> <WE_PM_UNTL>150000</WE_PM_UNTL> <TH_AM_FROM>083000</TH_AM_FROM> <TH_AM_UNTL>120000</TH_AM_UNTL> <TH_PM_FROM>130000</TH_PM_FROM> <TH_PM_UNTL>170000</TH_PM_UNTL> <FR_AM_FROM>080000</FR_AM_FROM> <FR_AM_UNTL>120000</FR_AM_UNTL> <FR_PM_FROM>130000</FR_PM_FROM> <FR_PM_UNTL>140000</FR_PM_UNTL> <REGION>IL</REGION> <TAXJURCODE>1403118101</TAXJURCODE> <SHIP_COND>02</SHIP_COND> <ACCNT_GRP>0001</ACCNT_GRP> </ShipToParty> <SoldToParty> <SOLD_TO>0000003000</SOLD_TO> <NAME>Thomas Bush Inc.</NAME> <STREET>1 1 2800 South 25th Ave</STREET> <POSTL_CODE>60153</POSTL_CODE> <CITY>MAYWOOD</CITY> <LANGU>E</LANGU> <COUNTRY>US</COUNTRY> <TELEPHONE>(312)450-BUSH</TELEPHONE> <STAT_GROUP>1</STAT_GROUP> <PRC_PROCED>1</PRC_PROCED> <CUST_GROUP>02</CUST_GROUP> <SALES_DIST>US0015</SALES_DIST> <PRICE_LIST>03</PRICE_LIST> <INCOTERMS1>CIF</INCOTERMS1> <INCOTERMS2>Chicago</INCOTERMS2> <MAX_PL_DLV>9</MAX_PL_DLV> <ORDER_COMB>X</ORDER_COMB> <DLV_PRIO>02</DLV_PRIO> <CURRENCY>USD</CURRENCY> <SHIP_COND>02</SHIP_COND> <ORDER_PROB>100</ORDER_PROB> <SALES_OFF>3010</SALES_OFF> <SALES_GRP>311</SALES_GRP> </SoldToParty> </SalesOrder.CreateFromDat1.Response>

2.

The data is fetched based on the sales order Customer and Sales Organization specified in the input XML file. The sales order details are fetched and written into bapi_salesorder_getlist.xml file. In case of error,
Get_SalesOrder number, Type of Material

TIBCO ActiveMatrix Adapter for SAP Examples

46

| Chapter 3

TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object

bapi_salesorder_getlist_error.txt bapi_salesorder_getlist.xml

is created. Sample of the file is given next.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <SalesOrder.GetList.Response xmlns = "urn:sap-com:document:sap:business" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"> <SalesOrders> <item> <SD_DOC>0000006369</SD_DOC> <ITM_NUMBER>000010</ITM_NUMBER> <MATERIAL>100-100</MATERIAL> <DOC_TYPE>TA</DOC_TYPE> <DOC_DATE>20011009</DOC_DATE> <REQ_QTY>10</REQ_QTY> <REQ_DATE>20011009</REQ_DATE> <PURCH_NO>acbootsph987654321</PURCH_NO> <BATCH></BATCH> <VALID_FROM>00000000</VALID_FROM> <VALID_TO>99999999</VALID_TO> <SOLD_TO>0000450505</SOLD_TO> <NAME>ac boots us customer</NAME> <NET_PRICE>11.11</NET_PRICE> <SALES_UNIT>ST</SALES_UNIT> </item> <item> <SD_DOC>0000006369</SD_DOC> <ITM_NUMBER>000010</ITM_NUMBER> <MATERIAL>100-100</MATERIAL> <DOC_TYPE>TA</DOC_TYPE> <DOC_DATE>20011009</DOC_DATE> <REQ_QTY>10</REQ_QTY> <REQ_DATE>20011026</REQ_DATE> <PURCH_NO>acbootsph987654321</PURCH_NO> <BATCH></BATCH> <VALID_FROM>00000000</VALID_FROM> <VALID_TO>99999999</VALID_TO> <SOLD_TO>0000450505</SOLD_TO> <NAME>ac boots us customer</NAME> <NET_PRICE>11.11</NET_PRICE> <SALES_UNIT>ST</SALES_UNIT> </item> </SalesOrders> </SalesOrder.GetList.Response>

TIBCO ActiveMatrix Adapter for SAP Examples

| 47
Chapter 4

TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object

This example shows how to use several adapter services within a TIBCO ActiveMatrix BusinessWorks process to get and synchronize a Purchase Order stored in the SAP system. All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\PurchaseOrder

This example uses Java Messaging Service (JMS) as its transport type.

Topics
Example Description, page 48 Setup the Example, page 49 Test the Example, page 51 Expected Results, page 52

TIBCO ActiveMatrix Adapter for SAP Examples

48

| Chapter 4

TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object

Example Description
This example shows how the adapters Subscription and Request-Response services can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has two processes, Get_PurchaseOrder and Sync_PurchaseOrder. uses the adapters Request-Response Service to fetch data from SAP for a particular purchase order. The data is fetched based on the Purchase Order number you specify in the input XML file. The data is sent back by the adapter to TIBCO ActiveMatrix BusinessWorks and is written into an output XML file.
Get_PurchaseOrder

Any update in the input file triggers the Get_PurchaseOrder process. TIBCO ActiveWorks BusinessWorks maps the data to the schema using a parser and mapper, and then passes the data to an invoke task. The Invoke task sends a request to the adapter Request-Response service. The Request-Response service fetches purchase order details from SAP using bapi_po_getdetail and sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders the data into an XML format and writes that to an output file. subscribes to update or modification messages from SAP whenever Purchase order details are modified or updated in the SAP system. On receiving the Purchase order details, TIBCO ActiveWorks BusinessWorks writes the IDoc to an XML file.
Sync_PurchaseOrder

For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 49

Setup the Example


Before starting the example you must import the sample project zip file and save it in a new project. Task A Get_PurchaseOrder and Sync_PurchaseOrder Setup: In TIBCO Designer: 1. In the initial dialog box click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the PurchaseOder.zip file. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWor ks\Purchase Order 4. Save the project as a multi-file project by the name PurchaseOrder. 5. Select the PurchaseOrder process. 6. Click the File Poller icon. In the configuration panel, File Name field, click Browse and select the corresponding input XML file from the path given in step 3. Click Apply. 7. Check the checkbox for Include Existing Files. 8. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService JMSProviderUrl Password ProgramID SystemNumber TIBCO_HOME (Home directory of the TIBCO installation) UserName 9. Test the connection to ensure connectivity.

TIBCO ActiveMatrix Adapter for SAP Examples

50

| Chapter 4

TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object

10. Validate the project to ensure there are no errors. 11. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 12. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 13. Run the adapter from the command line
adr3--propFile

<adapter_home>\bin\adr3.tra

14. Exit TIBCO Designer. Task B Start EMS Server This example uses JMS as the transport type. Ensure that the TIBCO Enterprise Message Service server is running and accessible to the machine on which the adapter is installed before running any of the processes.

TIBCO ActiveMatrix Adapter for SAP Examples

Test the Example 51

Test the Example


In TIBCO Designer: 1. From the project panel, select the process you want to test. For example, Get_PurchaseOrder. 2. Click the Set Breakpoints icon. 3. In the window that appears, choose Select All, then click OK. 4. Click the Tester tab to the left of the project panel. The test panel replaces the project tree. 5. Click the Start testing viewed process button. 6. In the process selection window that appears, the Get_PurchaseOrder process is selected by default. Click Load Selected. The process is now in Test mode. Any change to the input XML file starts the process. 7. Once the process starter is highlighted (indicating a process has started), click the Step to next activity icon to step through the process. 8. Click the Stop Testing icon to return to design mode. 9. Follow the above steps to test the other processes.

TIBCO ActiveMatrix Adapter for SAP Examples

52

| Chapter 4

TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object

Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\PurchaseOrder

Get_PurchaseOrder

The data is fetched based on the purchase order number specified in the input XML file. The purchase order details are fetched and written into bapi_po_getdetail.xml file. In case of error, bapi_po_getdetail_error.txt is created. Sample of the bapi_po_getdetail.xml file is shown next.

<?xml version="1.0" encoding="US-ASCII"?> <ns0:PurchaseOrder.GetDetail.Response xmlns:ns0="urn:sap-com:document:sap:business" PurchaseOrder="4500000140"> <PoAddress> <ADDRNUMBER>0000006945</ADDRNUMBER> <ADDRHANDLE/> <NATION/> <DATE>00010101</DATE> <DATE_FROM/> <DATE_TO/> <TITLE/> <NAME1>Electronic Components Distributor</NAME1> <NAME2/> <NAME3/> <NAME4/> <NAME_TXT/> <NAME_CO/> <CITY1>Foster City</CITY1> <CITY2/> <CITY_CODE/> <CITYP_CODE/> <CHCKSTATUS/> <POST_CODE1/> <POST_CODE2/> <POST_CODE3/> <PO_BOX/> <PO_BOX_NUM/> <PO_BOX_LOC/> <CITY_CODE2/> <PO_BOX_REG/> <PO_BOX_CTY/> <POSTALAREA/> <TRANSPZONE/> <STREET>Tower Lane 1082</STREET>

Sync_PurchaseOrder The IDoc DEBMAS is stored in Orders01.xml file. Sample of the Orders01.xml file is given next.

<?xml version="1.0" encoding="US-ASCII"?>

TIBCO ActiveMatrix Adapter for SAP Examples

Expected Results 53

<ORDERS01> <IDOC> <EDI_DC40> <TABNAM>EDI_DC40</TABNAM> <MANDT>800</MANDT> <DOCNUM>0000000001133323</DOCNUM> <DOCREL>45B</DOCREL> <STATUS>30</STATUS> <DIRECT>1</DIRECT> <OUTMOD>2</OUTMOD> <EXPRSS/> <TEST/> <IDOCTYP>ORDERS01</IDOCTYP> <CIMTYP/> <MESTYP>ORDERS</MESTYP> <MESCOD/> <MESFCT/> <STD/> <STDVRS/> <STDMES/> <SNDPOR>SAPIDS</SNDPOR> <SNDPRT>LS</SNDPRT> <SNDPFC/> <SNDPRN>ID3CLNT800</SNDPRN> <SNDSAD/> <SNDLAD/> <RCVPOR>A000000035</RCVPOR> <RCVPRT>LS</RCVPRT> <RCVPFC>LS</RCVPFC> <RCVPRN>LSCHANDRA</RCVPRN> <RCVSAD/> <RCVLAD/> <CREDAT>20030916</CREDAT> <CRETIM>102843</CRETIM> <REFINT/> <REFGRP/> <REFMES/> <ARCKEY/> <SERIAL>20030203171009</SERIAL> </EDI_DC40>

TIBCO ActiveMatrix Adapter for SAP Examples

54

| Chapter 4

TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object

TIBCO ActiveMatrix Adapter for SAP Examples

| 55
Chapter 5

TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object

This example shows how to use the adapters Request-Response service within a TIBCO ActiveMatrix BusinessWorks process to get an Employee record stored in the SAP system. All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\Employee

This example uses TIBCO Rendezvous as its transport type.

Topics
Example Description, page 56 Setup the Example, page 57 Test the Example, page 59 Expected Results, page 60

TIBCO ActiveMatrix Adapter for SAP Examples

56

| Chapter 5

TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object

Example Description
This example shows how the adapters Request-Response service can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has one process, Get_Employee.
Get_Employee uses the adapters Request-Response Service to fetch data from SAP for a particular employee. The data is fetched based on the Employee number you specify in the input XML file. The data is sent back by the adapter to TIBCO ActiveMatrix BusinessWorks and is written into an output XML file.

Any update in the input file triggers the Get_Employee process. TIBCO ActiveWorks BusinessWorks maps the data to the schema using a parser and mapper, and then passes the data to an invoke task. The Invoke task sends a request to the adapter Request-Response service. The Request-Response service fetches employee details from SAP using bapi_employee_getdata and sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders the data into an XML format and writes that to an output file. For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 57

Setup the Example


Before starting the example you must import the sample project zip file and save it in a new project. Task A Get_Employee Setup: In TIBCO Designer: 1. In the initial dialog box click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the Employee.zip file. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWor ks\Employee 4. Save the project as a multi-file project by the name Employee. 5. Select the Employee process. 6. Click the File Poller icon. In the configuration panel, File Name field, click Browse and select the corresponding input XML file from the path given in step 3. Click Apply. 7. Check the checkbox for Include Existing Files. 8. Include the appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber TIBCO_HOME (Home directory of the TIBCO installation) UserName 9. Test the connection to ensure connectivity. 10. Validate the project to ensure there are no errors. 11. Convert the multi-file format to a dat file.
TIBCO ActiveMatrix Adapter for SAP Examples

58

| Chapter 5

TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object

Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 12. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 13. Run the adapter from the command line
adr3--propFile

<adapter_home>\bin\adr3.tra

14. Exit TIBCO Designer.

TIBCO ActiveMatrix Adapter for SAP Examples

Test the Example 59

Test the Example


In TIBCO Designer: 1. From the project panel, select the process you want to test. For example, Get_Employee. 2. Click the Set Breakpoints icon. 3. In the window that appears, choose Select All, then click OK. 4. Click the Tester tab to the left of the project panel. The test panel replaces the project tree. 5. Click the Start testing viewed process button. 6. In the process selection window that appears, the Get_Employee process is selected by default. Click Load Selected. The process is now in Test mode. Any change to the input XML file starts the process. 7. Once the process starter is highlighted (indicating a process has started), click the Step to next activity icon to step through the process. 8. Click the Stop Testing icon to return to design mode.

TIBCO ActiveMatrix Adapter for SAP Examples

60

| Chapter 5

TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object

Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\Employee

The data is fetched based on the Employee number specified in the input XML file. The employee details are fetched and written into bapi_employee_getdata.xml file. In case of error, bapi_employee_getdata_error.txt is created. Sample of the bapi_employee_getdata.xml is given next.
Get_Employee

<?xml version="1.0" encoding="UTF-8"?> <ns0:Employee.GetList.Response xmlns:ns0="urn:sap-com:document:sap:business"> <Archivelink> <item/> </Archivelink> <Communication> <item/> </Communication> <InternalControl> <item/> </InternalControl> <OrgAssignment> <item/> </OrgAssignment> <PersonalData> <item/> </PersonalData> <Return> <TYPE/> <ID/> <NUMBER/> <MESSAGE/> <LOG_NO/> <LOG_MSG_NO/> <MESSAGE_V1/> <MESSAGE_V2/> <MESSAGE_V3/> <MESSAGE_V4/> <PARAMETER/> <ROW/> <FIELD/> <SYSTEM/> </Return> </ns0:Employee.GetList.Response>

TIBCO ActiveMatrix Adapter for SAP Examples

| 61
Chapter 6

TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object

This example shows how to use the adapters Request-Response service within a TIBCO ActiveMatrix BusinessWorks process to get and synchronize material details stored in the SAP system. All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\ItemMaster

This example uses TIBCO Rendezvous as its transport type.

Topics
Example Description, page 62 Setup the Example, page 63 Test the Example, page 65 Expected Results, page 66

TIBCO ActiveMatrix Adapter for SAP Examples

62

| Chapter 6

TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object

Example Description
This example shows how the adapters Subscription and Request-Response services can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has two processes, Get_ItemMaster and Sync_ItemMaster. uses Request-Response Service to fetch details from SAP for a particular material. The data is fetched based on the Material number specified in the input XML file. The data is sent back by the adapter to TIBCO ActiveMatrix BusinessWorks and is written into an output XML file.
Get_ItemMaster

Any update in the input file triggers the Get_ItemMaster process. TIBCO ActiveWorks BusinessWorks maps the data to the schema using a parser and mapper, and then passes the data to an invoke task. The Invoke task sends a request to the adapter Request-Response service. The Request-Response service fetches material details from SAP using bapi_material_get_detail and sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders the data into an XML format and writes that to an output file. subscribes to update or modification messages from SAP whenever Material details are modified or updated in the SAP system. On receiving the Material details, TIBCO ActiveWorks BusinessWorks writes the IDoc to an XML file.
Sync_ItemMaster

For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 63

Setup the Example


Before starting the example you must import the sample project zip file and save it in a new project. Task A Get_ItemMaster and Sync_ItemMaster Setup: In TIBCO Designer: 1. In the initial dialog box click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the ItemMaster.zip file. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWor ks\ItemMaster 4. Save the project as a multi-file project by the name ItemMaster. 5. Select the ItemMaster process. 6. Click the File Poller icon. In the configuration panel, File Name field, click Browse and select the corresponding input XML file from the path given in step 3. Click Apply. 7. Check the checkbox for Include Existing Files. 8. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber TIBCO_HOME (Home directory of the TIBCO installation) UserName 9. Test the connection to ensure connectivity. 10. Validate the project to ensure there are no errors. 11. Convert the multi-file format to a dat file.

TIBCO ActiveMatrix Adapter for SAP Examples

64

| Chapter 6

TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object

Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 12. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 13. Run the adapter from the command line
adr3--propFile

<adapter_home>\bin\adr3.tra

14. Exit TIBCO Designer.

TIBCO ActiveMatrix Adapter for SAP Examples

Test the Example 65

Test the Example


In TIBCO Designer: 1. From the project panel, select the process you want to test. For example, Get_ItemMaster. 2. Click the Set Breakpoints icon. 3. In the window that appears, choose Select All, then click OK. 4. Click the Tester tab to the left of the project panel. The test panel replaces the project tree. 5. Click the Start testing viewed process button. 6. In the process selection window that appears, the Get_ItemMaster process is selected by default. Click Load Selected. The process is now in Test mode. Any change to the input XML file starts the process. 7. Once the process starter is highlighted (indicating a process has started), click the Step to next activity icon to step through the process. 8. Click the Stop Testing icon to return to design mode. 9. Follow the above steps to test the other processes.

TIBCO ActiveMatrix Adapter for SAP Examples

66

| Chapter 6

TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object

Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\ItemMaster

Get_ItemMaster

The data is fetched based on the Material number specified in the input XML file. The material details are fetched and written into bapi_material_get_detail.xml file. In case of error, bapi_material_get_detail_error.txt is created. Sample of the bapi_material_get_detail.xml is given next.

<?xml version="1.0" encoding="US-ASCII"?> <ns0:Material.GetDetail.Response xmlns:ns0="urn:sap-com:document:sap:business" Material="100-100"> <MaterialGeneralData> <MATL_DESC>Cast iron spiral casing</MATL_DESC> <OLD_MAT_NO/> <MATL_TYPE>HALB</MATL_TYPE> <IND_SECTOR>M</IND_SECTOR> <DIVISION>01</DIVISION> <MATL_GROUP>001</MATL_GROUP> <PROD_HIER>001000010500000115</PROD_HIER> <BASIC_MATL>GG-25</BASIC_MATL> <STD_DESCR/> <LAB_DESIGN/> <PROD_MEMO/> <PAGEFORMAT/> <CONTAINER/> <STOR_CONDS/> <TEMP_CONDS/> <BASE_UOM>ST</BASE_UOM> <EAN_UPC/> <EAN_CAT/> <SIZE_DIM/> <GROSS_WT>3.0</GROSS_WT> <NET_WEIGHT>3.0</NET_WEIGHT> <UNIT_OF_WT>KG</UNIT_OF_WT> <VOLUME>0.0</VOLUME> <VOLUMEUNIT/> <LENGTH>0.0</LENGTH> <WIDTH>0.0</WIDTH> <HEIGHT>0.0</HEIGHT> <UNIT_DIM/> <MANU_MAT/> <MFR_NO/> <BASE_UOM_ISO>ST</BASE_UOM_ISO> <UNIT_OF_WT_ISO>KGM</UNIT_OF_WT_ISO> <VOLUMEUNIT_ISO/> <UNIT_DIM_ISO/> <CREATED_ON>19941107</CREATED_ON> <CREATED_BY>BALLER</CREATED_BY>

TIBCO ActiveMatrix Adapter for SAP Examples

Expected Results 67

<LAST_CHNGE>20030217</LAST_CHNGE> <CHANGED_BY>ABAPTRG1</CHANGED_BY> </MaterialGeneralData> <Return> <TYPE>S</TYPE> <ID/> <NUMBER/> <MESSAGE/> <LOG_NO/> <LOG_MSG_NO>000000</LOG_MSG_NO> <MESSAGE_V1/> <MESSAGE_V2/> <MESSAGE_V3/> <MESSAGE_V4/> <PARAMETER/> <ROW/> <FIELD/> <SYSTEM/> </Return> </ns0:Material.GetDetail.Response>

The IDoc MATMAS is stored in matmas.xml file. Sample of the matmas.xml is given next.
Sync_ItemMaster

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <MATMAS01> <IDOC> <EDI_DC40> <TABNAM>EDI_DC40</TABNAM> <MANDT>800</MANDT> <DOCNUM>0000000001133324</DOCNUM> <DOCREL>45B</DOCREL> <STATUS>30</STATUS> <DIRECT>1</DIRECT> <OUTMOD>2</OUTMOD> <EXPRSS></EXPRSS> <TEST></TEST> <IDOCTYP>MATMAS01</IDOCTYP> </EDI_DC40> <E1MARAM> <MSGFN>005</MSGFN> <MATNR>100-100</MATNR> <ERSDA>19941107</ERSDA> <ERNAM>BALLER</ERNAM> <LAEDA>20020124</LAEDA> <AENAM>ABAPTRG1</AENAM> <PSTAT>KCVEDPALSQBGF</PSTAT> <LVORM></LVORM> <MTART>HALB</MTART> <E1MAKTM> <MSGFN>005</MSGFN> <SPRAS>D</SPRAS> <MAKTX>Spiralgehuse GG</MAKTX> <SPRAS_ISO>DE</SPRAS_ISO> </E1MAKTM>

TIBCO ActiveMatrix Adapter for SAP Examples

68

| Chapter 6

TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object

TIBCO ActiveMatrix Adapter for SAP Examples

| 69
Chapter 7

TIBCO ActiveMatrix BusinessWorks: BDC Example

This example shows how to use the adapters services within a TIBCO ActiveMatrix BusinessWorks process. The TIBCO ActiveMatrix BusinessWorks process uses BDC (sequence of transactions) in the SAP system.to create a Purchase order in the SAP system. For more details, see TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment. All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\BDC

Topics
Example Description, page 70 Setup the Example, page 72 Test the Example, page 74 Expected Results, page 75

TIBCO ActiveMatrix Adapter for SAP Examples

70

| Chapter 7

TIBCO ActiveMatrix BusinessWorks: BDC Example

Example Description
This example shows how the adapters services and a batch (sequence of transactions) in the SAP system can be used in a TIBCO ActiveMatrix BusinessWorks process. The batch is invoked from the TIBCO ActiveMatrix BusinessWorks process to create a Purchase Order in the SAP system. The example has one process, BDC_Process.
BDC_Process

- The input XML file (PurchaseOrderIn.xml) contains the data to create a purchase order in the SAP system. Any update in the input file triggers the BDC_Process process. In the process, the XSLT transformation with the help of the XML parser and the mapper constructs the data required for the adapter Request-Response service. The Invoke task triggers the Request-Response service specifying the data and the name of the batch (give the exact name) in the SAP system. The Request-Response service executes the RFC_Call_Transaction, which in turn executes BDC in SAP to create a purchase order. The Request-Response service then sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, in case of successful execution, the Purchase order number is returned in an XML file, else an error message is written to a file. The sequence of events in the example is listed below: 1. Create a batch in the SAP system. For details, see TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment. 2. The PurchaseOrderIn.xml contains the data for the creation of the purchase order in SAP 3. The XSL file (POSchema.xsl) contains the purchase order schema. 4. The XSLT task maps the XSL to the PurchaseOrderIn.xml 5. Output for the XSLT task is an XML file, which is parsed and mapped to the XSD schema and then given to the Invoke task in the TIBCO ActiveMatrix BusinessWorks process. 6. The invoke task sends a request to the adapter specifying the data and the name of the batch (give the exact name) in the SAP system. 7. The adapter invokes the RFC_Call_Transaction in the SAP system. 8. The RFC_Call_Transaction creates the PurchaseOrder in SAP through a series of recorded transactions as specified by the batch. 9. In case of successful execution, the Purchase order number is returned else an error message is written to a file.

TIBCO ActiveMatrix Adapter for SAP Examples

Example Description 71

For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.

TIBCO ActiveMatrix Adapter for SAP Examples

72

| Chapter 7

TIBCO ActiveMatrix BusinessWorks: BDC Example

Setup the Example


Before starting the example you must create a batch in the SAP system, import the sample project zip file and save it in a new project. Task A Create a batch in SAP Create a batch in the SAP system. For details, refer TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment. Task B BDC_Process Setup In TIBCO Designer: 1. In the initial dialog box click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the BDC.zip file. The file is located in <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessW
orks\BDC

4. Save the project as a multi-file project by the name BDC. 5. Select the BDC process. 6. Click the File Poller icon. In the configuration panel, File Browse and select the input XML file. Click Apply. 7. Check the checkbox for Include Existing Files. 8. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber TIBCO_HOME (Home directory of the TIBCO installation) UserName
Name

field, click

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 73

9. Test the connection to ensure connectivity. 10. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 11. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 12. Run the adapter from the command line
adr3--propFile

<adapter_home>\bin\adr3.tra

13. Exit TIBCO Designer.

TIBCO ActiveMatrix Adapter for SAP Examples

74

| Chapter 7

TIBCO ActiveMatrix BusinessWorks: BDC Example

Test the Example


In TIBCO Designer: 1. From the project panel, select the process you want to test. For example, BDC_Process. 2. Click the Set Breakpoints icon. 3. In the window that appears, choose Select All, then click OK. 4. Click the Tester tab to the left of the project panel. The test panel replaces the project tree. 5. Click the Start testing viewed process button. 6. In the process selection window that appears, the BDC_Process process is selected by default. Click Load Selected. The process is now in Test mode. Any change to the input XML file starts the process. 7. Once the process starter is highlighted (indicating a process has started), click the Step to next activity icon to step through the process. 8. Click the Stop Testing icon to return to design mode.

TIBCO ActiveMatrix Adapter for SAP Examples

Expected Results 75

Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\BDC

The results are directly reflected in the SAP system. The data is created based on the purchase order details specified in the input XML file and a purchase order is created in the SAP system. An output file, bdc_output.txt (containing the Purchase Order number of the purchase order created in SAP ) is created. In case of error, rfc_call_transaction_error.txt is created. Sample of the bdc_output.txt file is shown next.
BDC_Process Reply= class/45B/basic/structures/MESSAGEINF { MSGTY=S MSGID=06 MSGNO=017 MSSPC= MSGTX=Standard PO created under the number 4500010303 }

TIBCO ActiveMatrix Adapter for SAP Examples

76

| Chapter 7

TIBCO ActiveMatrix BusinessWorks: BDC Example

TIBCO ActiveMatrix Adapter for SAP Examples

| 77
Chapter 8

TIBCO ActiveMatrix BusinessWorks: Dynamic Logon for RFC

This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process. All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\Advan cedFeatures\DynamicLogOn

Topics
Example Description, page 78 Setup the Example, page 79 Test the Example, page 81 Expected Results, page 82

TIBCO ActiveMatrix Adapter for SAP Examples

78

| Chapter 8

TIBCO ActiveMatrix BusinessWorks: Dynamic Logon for RFC

Example Description
This example shows how the adapter's Request-Response Service can be used in a TIBCO ActiveMatrix BusinessWorks process. This example deals with using TIBCO BusinesWorks to log on to the SAP system at run- time using the adapter and invoking an RFC request on the newly created connection and then to log off from the SAP system. The example has one process, DynamicLogon.
DynamicLogon

creates a task that invokes the logon operation. The subject for logon operation is RFCClient.RPCServer.<Instance name>. The sessionId from the reply of the Logon operation should be mapped to the input of the RFC request along with the customer details to be searched. The screen is shown next. The same sessionId is also mapped to the logoff operation.

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 79

Setup the Example


Before starting the example, you must import the sample project zip file and save it in a new project. In TIBCO Designer: 1. In the initial dialog box, click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the DynamicLogOn.zip file. The file is located in <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessW
orks\AdvancedFeatures\DynamicLogOn

4. Save the project as a multi-file project by the name DynamicLogOn. 5. Select the DynamicLogOn process. 6. Specify appropriate values for the connection parameters in the Input tab of the Invoke Logon Service activity of the DynamicLogon process. 7. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber UserName 8. Test the connection to ensure connectivity. 9. Validate the project to ensure there are no errors. 10. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 11. Modify the repourl and configurl parameters in adr3.tra under
TIBCO ActiveMatrix Adapter for SAP Examples

80

| Chapter 8

TIBCO ActiveMatrix BusinessWorks: Dynamic Logon for RFC

<install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 12. Run the adapter from the command line.
adr3--propFile

<adapter_home>\bin\adr3.tra

13. Exit TIBCO Designer.

TIBCO ActiveMatrix Adapter for SAP Examples

Test the Example 81

Test the Example


In TIBCO Designer: 1. From the project panel, select the process DynamicLogOn. 2. Click the Set Breakpoints icon. 3. In the window that appears, choose Select All, then click OK. 4. Click the Tester tab to the left of the project panel. The test panel replaces the project tree. 5. Click the Start testing viewed process button. 6. In the process selection window that appears, the DynamicLogOn process is selected by default. Click Load Selected. The process is now in Test mode. 7. Once the process starter is highlighted (indicating a process has started), click the Step to next activity icon to step through the process. 8. Click the Stop Testing icon to return to design mode.

TIBCO ActiveMatrix Adapter for SAP Examples

82

| Chapter 8

TIBCO ActiveMatrix BusinessWorks: Dynamic Logon for RFC

Expected Results
The console window of the inbound instance indicates that the request from TIBCO ActiveMatrix BusinessWorks for Logon, for RFC_CUSTOMER_GET and for Logoff was sent. The output in the console window of TIBCO ActiveMatrix BusinessWorks displays the customer records fetched from the SAP system.

TIBCO ActiveMatrix Adapter for SAP Examples

| 83
Chapter 9

TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI

This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process. All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\Advan cedFeatures\ExternalCommit

Topics
Example Description, page 84 Setup the Example, page 85 Test the Example, page 87 Expected Results, page 88

TIBCO ActiveMatrix Adapter for SAP Examples

84

| Chapter 9

TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI

Example Description
This example deals with using TIBCO ActiveMatrix BusinessWorks to commit a transaction in the SAP system using the adapter. BAPI_SALESORDER_CREATEFROMDAT1 is the BAPI which is used for the creation of a sales order. This BAPI updates the necessary tables and waits for an external commit. In this example, BAPI_SALESORDER_CREATEFROMDAT1 is invoked to create a sales order and then BAPI_TRANSACTION_COMMIT is invoked to commit the transaction. Map the SessionID for the RFCClosure details in the reply of the SalesOrderCreate task to the SessionID for the RFCClosure details in the request of the SalesOrderCommit task. The screen is shown next.

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 85

Setup the Example


Before starting the example, you must import the sample project zip file and save it in a new project. In TIBCO Designer: 1. In the initial dialog box, click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the ExternalCommit.zip file. The file is located in <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessW
orks\AdvancedFeatures\ExternalCommit

4. Save the project as a multi-file project by the name ExternalCommit. 5. Select the ExternalCommit process. 6. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber UserName 7. Test the connection to ensure connectivity. 8. Validate the project to ensure there are no errors. 9. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 10. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin

TIBCO ActiveMatrix Adapter for SAP Examples

86

| Chapter 9

TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI

folder to point to the dat file. 11. Run the adapter from the command line
adr3--propFile

<adapter_home>\bin\adr3.tra

12. Exit TIBCO Designer.

TIBCO ActiveMatrix Adapter for SAP Examples

Test the Example 87

Test the Example


In TIBCO Designer: 1. From the project panel, select the process ExternalCommit. 2. Click the Set Breakpoints icon. 3. In the window that appears, choose Select All, then click OK. 4. Click the Tester tab to the left of the project panel. The test panel replaces the project tree. 5. Click the Start testing viewed process button. 6. In the process selection window that appears, the ExternalCommit process is selected by default. Click Load Selected. The process is now in Test mode. 7. Once the process starter is highlighted (indicating a process has started), click the Step to next activity icon to step through the process. 8. Click the Stop Testing icon to return to design mode.

TIBCO ActiveMatrix Adapter for SAP Examples

88

| Chapter 9

TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI

Expected Results
See the output in the console window of the TIBCO ActiveMatrix BusinessWorks engine. The console window of the inbound instance also indicates that a request from TIBCO ActiveMatrix BusinessWorks for BAPI_SALESORDER_CREATEFROMDAT1 was made and a request for BAPI_TRANSACTION_COMMIT to commit the operation was made. In the SAP console VA03, you can see the sales order created.

TIBCO ActiveMatrix Adapter for SAP Examples

| 89
Chapter 10

TIBCO ActiveMatrix BusinessWorks: Data Caching using RFC

This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process. All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\Advan cedFeatures\DataCaching

Topics
Example Description, page 90 Setup the Example, page 91 Test the Example, page 93 Expected Results, page 94

TIBCO ActiveMatrix Adapter for SAP Examples

90

| Chapter 10

TIBCO ActiveMatrix BusinessWorks: Data Caching using RFC

Example Description
This example deals with using TIBCO ActiveMatrix BusinessWorks to handle large internal tables from the SAP system. Data chunking will be helpful in the scenario where the number of records in the reply is large. The records can be viewed in batches till all the records are retrieved using data chunking. To enable data chunking, you must set appropriate attributes in the closure argument in the userClosure attribute of the request class. RFC_CUSTOMER_GET retrieves all the records in the SAP system when the CustomerId parameter(KUNNR) is set to *. These records can be viewed in batches by setting appropriate values for the attribute, PacketSize in the Userclosure attribute. Enter the details for GUID, packetSize, bUseCache, bClearCache and CacheDirection in the request mapper. The number of records fetched will depend on these details. The screen is shown next.

To appreciate Data Chunking, the customer number parameter (KUNNR) is set to *. For each iteration in the loop, the number of records retrieved is the same as the number specified for the attribute, PacketSize.

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 91

Setup the Example


Before starting the example, you must import the sample project zip file and save it in a new project. In TIBCO Designer: 1. In the initial dialog box, click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the DataCaching.zip file. The file is located in <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessW
orks\AdvancedFeatures\DataCaching

4. Save the project as a multi-file project by the name DataCaching. 5. Select the DataCaching process. 6. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber UserName 7. Test the connection to ensure connectivity. 8. Validate the project to ensure there are no errors. 9. Convert the multi-file format to a dat file. 10. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 11. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin

TIBCO ActiveMatrix Adapter for SAP Examples

92

| Chapter 10

TIBCO ActiveMatrix BusinessWorks: Data Caching using RFC

folder to point to the dat file. 12. Run the adapter from the command line
adr3--propFile

<adapter_home>\bin\adr3.tra

13. Exit TIBCO Designer.

TIBCO ActiveMatrix Adapter for SAP Examples

Test the Example 93

Test the Example


In TIBCO Designer: 1. From the project panel, select the process DataCaching. 2. Click the Set Breakpoints icon. 3. In the window that appears, choose Select All, then click OK. 4. Click the Tester tab to the left of the project panel. The test panel replaces the project tree. 5. Click the Start testing viewed process button. 6. In the process selection window that appears, the DataCaching process is selected by default. Click Load Selected. The process is now in Test mode. 7. Once the process starter is highlighted (indicating a process has started), click the Step to next activity icon to step through the process. 8. Click the Stop Testing icon to return to design mode.

TIBCO ActiveMatrix Adapter for SAP Examples

94

| Chapter 10

TIBCO ActiveMatrix BusinessWorks: Data Caching using RFC

Expected Results
See the output in the console window of the TIBCO ActiveMatrix BusinessWorks. In the reply, the number of records retrieved would be the same as the number specified for PacketSize. The console window of the inbound instance also indicates that the request from TIBCO ActiveMatrix BusinessWorks for RFC_CUSTOMER_GET was made. For every request being processed, the Number of Records Found will increase by the same amount as the number specified for PacketSize till all the records are fetched.

TIBCO ActiveMatrix Adapter for SAP Examples

| 95
Chapter 11

TIBCO ActiveMatrix BusinessWorks: IDoc Filtering

This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process. All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\Advan cedFeatures\IDocFiltering

Topics
Example Description, page 96 Setup the Example, page 98 Test the Example, page 100 Expected Results, page 101

TIBCO ActiveMatrix Adapter for SAP Examples

96

| Chapter 11

TIBCO ActiveMatrix BusinessWorks: IDoc Filtering

Example Description
This example deals with using TIBCO Business Works to subscribe the IDocs for which some of the segments are filtered. IDoc Filtering enables an IDoc Publication Service to filter segments and fields of an IDoc received from the SAP system before publishing the IDoc message to the TIBCO environment. Selective publishing of segments or fields at run-time is achieved by specifying the segments or fields to filter in the IDoc Publication Service schema. This can be done in TIBCO Designer at design-time. The filtered IDoc message that is published in the TIBCO environment will continue to conform to the original IDoc schema, but the data for the segments and fields filtered will not be published. Subscribing systems can use the original IDoc schema downloaded into the project to receive the filtered IDoc messages. To configure filtering for an IDoc Publication Service: 1. Go to the Schema tab of the Publication Service. This tab displays the SAP schema for the IDoc type. For example, in the screen given next, the schema for MATMAS01 is displayed.

TIBCO ActiveMatrix Adapter for SAP Examples

Example Description 97

2. Filter out an IDoc segment or field by selecting the check box provided against each of the IDoc segments or fields. For example, in the screen given next, the segment E1MARCM and its children segments are being filtered.

To filter an entire IDoc segment and its children segments, select the check box against that segment. The children segments are automatically filtered at run-time Segments that are defined as mandatory in the SAP system are not filtered even if the check boxes against these segments are selected.

TIBCO ActiveMatrix Adapter for SAP Examples

98

| Chapter 11

TIBCO ActiveMatrix BusinessWorks: IDoc Filtering

Setup the Example


Before starting the example, you must import the sample project zip file and save it in a new project. In TIBCO Designer: 1. In the initial dialog box, click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the IDocFiltering.zip file. The file is located in <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessW
orks\AdvancedFeatures\IDocFiltering

4. Save the project as a multi-file project by the name IDocFiltering. 5. Select the IDocFiltering process. 6. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber UserName OutputFile 7. Test the connection to ensure connectivity. 8. Validate the project to ensure there are no errors. 9. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 10. Modify the repourl and configurl parameters in adr3.tra under

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 99

<install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 11. Run the adapter from the command line
adr3--propFile

<adapter_home>\bin\adr3.tra

12. Exit TIBCO Designer.

TIBCO ActiveMatrix Adapter for SAP Examples

100

| Chapter 11

TIBCO ActiveMatrix BusinessWorks: IDoc Filtering

Test the Example


In TIBCO Designer: 1. From the project panel, select the process IDocFiltering. 2. Click the Set Breakpoints icon. 3. In the window that appears, choose Select All, then click OK. 4. Click the Tester tab to the left of the project panel. The test panel replaces the project tree. 5. Click the Start testing viewed process button. 6. In the process selection window that appears, the IDocFiltering process is selected by default. Click Load Selected. The process is now in Test mode. 7. Once the process starter is highlighted (indicating a process has started), click the Step to next activity icon to step through the process. 8. Publish the IDoc from the SAP system. 9. Click the Stop Testing icon to return to design mode.

TIBCO ActiveMatrix Adapter for SAP Examples

Expected Results 101

Expected Results
The example results can be viewed in the respective XML files written to
output.xml

The subscribed IDoc is written into output.xml file. The filtered segments will not be present in this file.

TIBCO ActiveMatrix Adapter for SAP Examples

102

| Chapter 11

TIBCO ActiveMatrix BusinessWorks: IDoc Filtering

TIBCO ActiveMatrix Adapter for SAP Examples

| 103
Chapter 12

TIBCO ActiveMatrix BusinessWorks: IDoc Reporting

This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process. All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\Advan cedFeatures\IDocReporting

This example uses Java Messaging Service (JMS) as its transport type.

Topics
Example Description, page 104 Setup the Example, page 107 Test the Example, page 109 Expected Results, page 110

TIBCO ActiveMatrix Adapter for SAP Examples

104

| Chapter 12

TIBCO ActiveMatrix BusinessWorks: IDoc Reporting

Example Description
This feature enables the adapter to report adapter processing errors, application errors or informational messages about successful posting of messages to the SAP system for all one way inbound scenarios. This example deals with using TIBCO ActiveMatrix BusinessWorks to get a confirmation from the Subscription Service of the adapter about the status of the IDoc which is being published from TIBCO ActiveMatrix BusinessWorks.

Configuring Subscription Services for IDoc Reporting


To configure Subscription Services for IDoc Reporting: 1. Select the Advanced tab of the Subscription Service. 2. Select the Confirm Required check box. A Confirm Publisher reference field is displayed. 3. Create a publisher endpoint under the Advanced>Sessions and select any session with required transport, quality of service and subject attributes.

TIBCO ActiveMatrix Adapter for SAP Examples

Example Description 105

4. Associate this publisher endpoint to the Subscription Service by referring to this endpoint in the Confirm Publisher reference field. The screen is given next.

5. The Publisher Endpoint destination name and the Queue name for the activity Wait for Adapter Message in TIBCO ActiveMatrix BusinessWorks should be

TIBCO ActiveMatrix Adapter for SAP Examples

106

| Chapter 12

TIBCO ActiveMatrix BusinessWorks: IDoc Reporting

the same. In this example, the Queue name is test_report. The screen is given next.

TIBCO ActiveMatrix Adapter for SAP Examples

Setup the Example 107

Setup the Example


Before starting the example, you must import the sample project zip file and save it in a new project. In TIBCO Designer: 1. In the initial dialog box, click Open New Project and specify a name for the project. 2. Click Project>Import Full Project. 3. Click the Zip Archive tab and browse to locate the IDocReporting.zip file. The file is located in <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessW
orks\AdvancedFeatures\IDocReporting

4. Save the project as a multi-file project by the name IDocReporting. 5. Select the IDocReporting process. 6. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber UserName IDocOutput ErrorOutput ExceptionOutput 7. Test the connection to ensure connectivity. 8. Validate the project to ensure there are no errors. 9. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the

TIBCO ActiveMatrix Adapter for SAP Examples

108

| Chapter 12

TIBCO ActiveMatrix BusinessWorks: IDoc Reporting

dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 10. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 11. Run the adapter from the command line
adr3--propFile

<adapter_home>\bin\adr3.tra

12. Exit TIBCO Designer.

TIBCO ActiveMatrix Adapter for SAP Examples

Test the Example 109

Test the Example


In TIBCO Designer: 1. From the project panel, select the process IDocReporting. 2. Click the Set Breakpoints icon. 3. In the window that appears, choose Select All, then click OK. 4. Click the Tester tab to the left of the project panel. The test panel replaces the project tree. 5. Click the Start testing viewed process button. 6. In the process selection window that appears, the IDocReporting process is selected by default. Click Load Selected. The process is now in Test mode. 7. Once the process starter is highlighted (indicating a process has started), click the Step to next activity icon to step through the process. 8. Click the Stop Testing icon to return to design mode.

TIBCO ActiveMatrix Adapter for SAP Examples

110

| Chapter 12

TIBCO ActiveMatrix BusinessWorks: IDoc Reporting

Expected Results
The example results can be viewed in the respective .txt files written to:
IDocOutput.txt

or or

ErrorOutput.txt

ExceptionOutput.txt

depending on the status of the IDoc subscribed.

TIBCO ActiveMatrix Adapter for SAP Examples

| 111

Index

A
API xii

Expected Results 37, 44, 52, 60, 66, 75

I B
Business Object Examples 2 ItemMaster 5 ItemMaster Business Object 5

L C
Location 8 Create a Database Table in the SAP System 10 Create RFC Functions 15 Creating a Database Table in the SAP System 10 Creating an Inbound Instance 27 Creating an Outbound Instance 24 Creating Outbound and Inbound Instances Using TIBCO Designer 24 Creating RFC Functions 15 Customer 4 customer support xiv

O
Overview 2

P
Prerequisites 7 PurchaseOrder 5 PurchaseOrder Business Object 5

D
Deploy and Run the Example 34

R E
Employee 5 Employee Business Object 5 ENV_HOME x Example Description 32, 40, 48, 56, 62, 70 Running the example 27, 30 RV xiii RVCM xiii RVDQ xiii

TIBCO ActiveMatrix Adapter for SAP Examples

112

|
S

Index

SalesOrder 4 Selecting a Service 25 Selecting Schema 25 Setting up Connection 24, 27 Setup for all the processes 33 Setup the Example 33, 41, 49, 57, 63, 72 Storing Shared Objects in One Location 22 support, contacting xiv

T
Task A Create_SalesOrder and Get_SalesOrder Setup 41 Task A Deploy the Example 34 Task A Get_PurchaseOrder and Sync_PurchaseOrder Setup 49 Task B Run the Example 34 Task B Start JMS Server 42, 50 technical support xiv Test the Example 43, 51, 59, 65, 74 Testing the Function Modules 22 TIBCO_HOME x

U
Using TIBCO ActiveMatrix BusinessWorks 7

W
Working with dat files in TIBCO Designer 8

TIBCO ActiveMatrix Adapter for SAP Examples

Você também pode gostar