TIBCO ActiveMatrix Adapter for SAP · † TIBCO ActiveMatrix Adapter for SAP Examples This manual...
Transcript of TIBCO ActiveMatrix Adapter for SAP · † TIBCO ActiveMatrix Adapter for SAP Examples This manual...
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-2012 TIBCO Software Inc. ALL RIGHTS RESERVED.
TIBCO Software Inc. Confidential Information
| iii
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2TIBCO ActiveMatrix Adapter for SAP Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Other TIBCO Product Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Third Party Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Terminology and Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Connecting with TIBCO Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8How to Join TIBCOmmunity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8How to Access All TIBCO Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8How to Contact TIBCO Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Chapter 1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Business Object Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Using TIBCO ActiveMatrix BusinessWorks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Working 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Creating an Outbound Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Creating an Inbound Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Chapter 2 TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object .31
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Run the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Chapter 3 TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object
TIBCO ActiveMatrix Adapter for SAP Examples
iv |
39
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Chapter 4 TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Chapter 5 TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object. 57
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Chapter 6 TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object65
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Chapter 7 TIBCO ActiveMatrix BusinessWorks: BDC Example. . . . . . . . . . . . . . . . . . . . . . . . . 77
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Chapter 8 TIBCO ActiveMatrix BusinessWorks: Dynamic Logon for RFC . . . . . . . . . . . . . . . . 85
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
TIBCO ActiveMatrix Adapter for SAP Examples
| v
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Chapter 9 TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Test the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Chapter 10 TIBCO ActiveMatrix BusinessWorks: Data Caching using RFC . . . . . . . . . . . . . . .97
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Test the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Chapter 11 TIBCO ActiveMatrix BusinessWorks: IDoc Filtering . . . . . . . . . . . . . . . . . . . . . . . .103
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Test the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Chapter 12 TIBCO ActiveMatrix BusinessWorks: IDoc Reporting . . . . . . . . . . . . . . . . . . . . . .111
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112Configuring Subscription Services for IDoc Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Test the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Chapter 13 Examples for Advanced Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
UserExit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Control Field Replacements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Dynamic Subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
TIBCO ActiveMatrix Adapter for SAP Examples
| 1
Preface
This guide includes examples that demonstrate how the adapter interacts with TIBCO ActiveMatrix BusinessWorks.
Topics
• Related Documentation, page 2
• Terminology and Acronyms, page 6
• Connecting with TIBCO Resources, page 8
TIBCO ActiveMatrix Adapter for SAP Examples
2 | Preface
Related Documentation
This section lists documentation resources.
TIBCO ActiveMatrix Adapter for SAP DocumentationThe 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 DocumentationYou 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 | 3
Third Party Documentation• SAP R/3: Implementation Guide by Bradley D. Hiquet, available from
Kelly-Lacey & Associates Inc. This is “A Manager’s Guide to Understanding SAP” that emphasizes the user’s 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
4 | Preface
Typographical Conventions
The following typographical conventions are used in this manual
Table 1 General Typographical Conventions
Convention Use
TIBCO_HOME
ENV_HOME
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 ActiveMatrix 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 | 5
Key combinations
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.
Table 1 General Typographical Conventions (Cont’d)
Convention Use
TIBCO ActiveMatrix Adapter for SAP Examples
6 | Preface
Terminology and Acronyms
Term Definition
ABAP Advanced Business Application Programming is a language in SAP used to write SAP specific code.
ALE/IDoc Application Link Enabling/Intermediate Documents.
API Application Program Interface.
Application Server The server on which the SAP processes run.
BAPI Business API (Functionally equivalent to RFC).
CIF Certified Intermediate Format.
Component 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.
EDI Electronic Data Interchange.
EMS Enterprise Message Service
Gateway Server A server used to exchange data with the SAP system.
Inbound Instance An adapter configuration listening for messages inbound to the SAP system. Inbound instances transfer messages from the TIBCO environment to SAP.
Interface 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.
JMS JAVA Messaging Service
MBCS Multi-byte character string.
One Way Invocation protocol
One way invocation protocol allows you to invoke the BAPI/RFC in the SAP system without waiting for a reply from the system.
Outbound Instance An adapter configuration listening for messages outbound from SAP. Outbound instances transfer messages from SAP to the TIBCO environment.
TIBCO ActiveMatrix Adapter for SAP Examples
Terminology and Acronyms | 7
RV TIBCO Rendezvous™ protocol; also in certain contexts refers to reliable message quality of service, as opposed to certified message.
RFC The SAP Remote Function Call Interface.
RFC Client A SAP term for any program that can post RFCs/BAPIs/IDocs from an external system into the SAP system.
RVCM TIBCO Rendezvous certified message quality of service.
RFC Server A SAP term for any external program that can accept and process RFCs/BAPIs/IDocs from the SAP system.
RVDQ TIBCO Rendezvous distributed queue.
SAP Native data 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.
SSL Secure Sockets Layer.
TID Transaction ID. A globally unique identifier used by transactional RFCs to ensure exactly-once execution of a transaction.
TIDManager Transaction Identifier Manager.
Term Definition
TIBCO ActiveMatrix Adapter for SAP Examples
8 | Preface
Connecting with TIBCO Resources
How to Join TIBCOmmunityTIBCOmmunity is an online destination for TIBCO customers, partners, and resident experts, a place to share and access the collective experience of the TIBCO community. TIBCOmmunity offers forums, blogs, and access to a variety of resources. To register, go to http://www.tibcommunity.com.
How to Access All TIBCO DocumentationAfter you join TIBCOmmunity, you can access the documentation for all supported product versions here:
http://docs.tibco.com/TibcoDoc
How to Contact TIBCO SupportFor 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 user name and password. If you do not have a user name, 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
2 | Introduction
Overview
The examples discussed in this guide demonstrate how TIBCO <Product> interacts with TIBCO ActiveMatrix BusinessWorks. Simple publish-subscribe or request-response scenarios are used to demonstrate the different interactions.
Business Object ExamplesThe 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
• 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.
• 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.
BAPI_CUSTOMER_GETDETAIL1
TIBCO Environment
Request for customer
information
Customer details
SAP System
TIBCO ActiveMatrix BusinessWorks
TIBCO ActiveMatrix Adapter for
SAP
Request XML Response XML
TIBCO Environment
SAP System
Request to create
Sales order
Sales order
number
TIBCO ActiveMatrix BusinessWorks
TIBCO ActiveMatrix Adapter for
SAP
BAPI_SALESORDER_CREATEFROMDAT1
Service
Request XML Response XML
TIBCO ActiveMatrix Adapter for SAP Examples
4 | Introduction
Figure 3 Business Object Operation: Sync
Customer
This example demonstrates the Get, Create and Sync operations on the Customer 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_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.
• Create_Customer creates a new customer in the SAP system. Customer details are read from an XML file.
• 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
IDoc ORDERS01 Publication Service
TIBCO Environment
SAP System
TIBCO ActiveMatrix
Adapter for SAP
Purchase Order Information
TIBCO ActiveMatrix BusinessWorks
XML file
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.
• Create_SalesOrder 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.
• Sync_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.
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.
• Get_PurchaseOrder 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.
• Sync_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.
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.
Get_Employee gets Employee details from the SAP system, based on parameters stored in an XML file. These details are then written into another XML file.
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.
• Get_ItemMaster — Fetches Material details from the SAP system and writes these to an XML file.
• Sync_ItemMaster — Whenever a Material record is created or changed in the SAP system, an IDoc is published. On reception of the notification, TIBCO
TIBCO ActiveMatrix Adapter for SAP Examples
6 | 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 use 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 BusinessWorksIf 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.
• Some SAP BAPIs retain old data in the cache if the same connection is used. To access new data using these BAPIs, use the Dynamic Connection feature of the adapter.
• You may be required to refresh the schema in the Schema tab of the adapter service in order to be in sync with the SAP system being used.
TIBCO ActiveMatrix Adapter for SAP Examples
8 | Introduction
• Use the TIBCO Domain Utility to add a machine to a TIBCO Administration Domain.
• In TIBCO Administrator, use the Resource Management > Machines console to register software.
Refer to the TIBCO Administrator documentation for more information.
LocationThe files for the examples are in the following location:TIBCO_HOME\adapter\adr3\version_number\examples\BusinessWorks\<BusinessObjectName>,
where version_number is the adapter version number.
Working with dat files in TIBCO DesignerThe 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 project’s 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 | 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\R3AdapterExamples_Instance.dat
tibco.configurl \tibco\private\adapter\SAPAdapter40\R3AdapterConfiguration
Creating an Inbound InstanceTo 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 Connection Type drop-down.
Ensure that the design-time adapter is running.
TIBCO ActiveMatrix Adapter for SAP Examples
28 | 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.
12. In the Configuration tab, select Inbound in the R/3 Connection field.
13. Configure the inbound instance using the Run-time Inbound tab.
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.
TIBCO ActiveMatrix Adapter for SAP Examples
30 | 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\R3AdapterExamples_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.
This example uses TIBCO Rendezvous as its transport type.
Topics
• Example Description, page 32
• Setup the Example, page 33
• Run the Example, page 35
• Expected Results, page 38
All files relevant to this example are located in the following location.
install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\Customer
TIBCO ActiveMatrix Adapter for SAP Examples
32 | TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object
Example Description
This example illustrates how the adapter’s 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 adapter’s 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 adapter’s 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 adapter’s 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 New empty project and save the project as Customer.
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\BusinessWorks\Customer
4. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
— Overwrite on name conflict.
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.
7. Check the checkbox for Include Existing Files.
8. Click Apply.
Any change to the input XML file starts the process.
TIBCO ActiveMatrix Adapter for SAP Examples
34 | TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object
9. 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
— ASAP_HOME (Home directory of the adapter, install_path\tibco\adapter\adr3\version_number)
10. Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name for the dat file.
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 specified in step 10.
12. Save the project.
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
Run the Example | 35
Run the Example
Perform the following tasks to run the example.
In TIBCO Designer:
1. From the project panel, select the process you want to test. For example, Create_Customer.
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_Customer process is selected by default. Click Start 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.
Follow the above steps to test the processes.
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"?><CustomerCreateFromData1> <CopyReference> <SALESORG>0001</SALESORG> <DISTR_CHAN>01</DISTR_CHAN> <DIVISION>01</DIVISION> <REF_CUSTMR>0000100131</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>
TIBCO ActiveMatrix Adapter for SAP Examples
36 | TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object
<PersonalData> <TITLE_P></TITLE_P> <FIRSTNAME>Sabari</FIRSTNAME> <LASTNAME>Grana1</LASTNAME> <MIDDLENAME>T</MIDDLENAME> <SECONDNAME>JonesSmith</SECONDNAME> <DATE_BIRTH>03031975</DATE_BIRTH> <CITY>Berlin</CITY> <DISTRICT></DISTRICT> <POSTL_COD1>10101</POSTL_COD1> <POSTL_COD2></POSTL_COD2> <PO_BOX></PO_BOX> <PO_BOX_CIT></PO_BOX_CIT> <STREET>BERTOLT-BRECHT-STRASSE</STREET> <HOUSE_NO>1234</HOUSE_NO> <BUILDING>5</BUILDING> <FLOOR>2</FLOOR> <ROOM_NO></ROOM_NO> <COUNTRY>DE</COUNTRY> <COUNTRYISO></COUNTRYISO> <REGION>11</REGION> <TEL1_NUMBR>6508465611</TEL1_NUMBR> <TEL1_EXT>345</TEL1_EXT> <FAX_NUMBER>1111</FAX_NUMBER> <FAX_EXTENS></FAX_EXTENS> <E_MAIL>[email protected]</E_MAIL> <LANGU_P>F</LANGU_P> <LANGUP_ISO></LANGUP_ISO> <CURRENCY>EUR</CURRENCY> <CURRENCY_ISO>EUR</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 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="0000100135"> <DistributionChannel></DistributionChannel> <Division></Division> <SalesOrganiation></SalesOrganiation></CustomerGetDetail1>
TIBCO ActiveMatrix Adapter for SAP Examples
Run the Example | 37
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
38 | TIBCO ActiveMatrix BusinessWorks: Working with the Customer 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\BusinessWorks\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>Düsseldorf</ORT01> <ORT02/> <PFACH/> <REGIO>05</REGIO> <COUNC/> <CITYC/> </E1KNA1M> </IDOC></DEBMAS01>
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
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
All files relevant to this example are located in the following location.
install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\SalesOrder
TIBCO ActiveMatrix Adapter for SAP Examples
40 | TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object
Example Description
This example shows how the adapter’s 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 adapter’s 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.
• Get_SalesOrder uses the adapter’s 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.
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 New empty project.
2. Save the project as SalesOrder.
3. Click Project>Import Full Project.
4. Click the Zip Archive tab and browse to locate the SalesOrder.zip file.
install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\Sales Order
5. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
Overwrite on name conflict.
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.
7. Check the checkbox for Include Existing Files.
8. Click Apply.
TIBCO ActiveMatrix Adapter for SAP Examples
42 | TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object
9. 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
— ASAP_HOME (Home directory of the adapter, install_path\tibco\adapter\adr3\version_number)
10. Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name for the dat file.
11. Modify the repourl and configurl parameters in adr3.tra underinstall_path\tibco\adapter\adr3\version_number\bin
folder to point to the dat file specified in step 10.
12. Save the project.
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 Start 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 | 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\BusinessWorks\Salesorder
1. Create_SalesOrder — 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.
<?xml version="1.0" encoding="US-ASCII"?><ns0:SalesOrder.CreateFromDat1.Response xmlns:ns0="urn:sap-com:document:sap:business" SalesDocument="0000011936"> <BillingParty> <PAYER>0000001451</PAYER> <NAME>Societe Chimique Picardie SA</NAME> <STREET>33 Rue de La Tannerie</STREET> <CITY>Gouvieux</CITY> <LANGU>E</LANGU> <COUNTRY>FR</COUNTRY> <TELEPHONE>003319551917</TELEPHONE> <CURRENCY/> <PMNTTRMS>NT30</PMNTTRMS> </BillingParty> <OrderItemsOut> <item/> </OrderItemsOut> <OrderPartners> <item/> </OrderPartners></ns0:SalesOrder.CreateFromDat1.Response>
2. Get_SalesOrder — The data is fetched based on the sales order Customer number, Type of Material 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, bapi_salesorder_getlist_error.txt is created. Sample of the bapi_salesorder_getlist.xml 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>
TIBCO ActiveMatrix Adapter for SAP Examples
Expected Results | 45
<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
46 | TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object
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.
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
All files relevant to this example are located in the following location.
install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\PurchaseOrder
TIBCO ActiveMatrix Adapter for SAP Examples
48 | TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object
Example Description
This example shows how the adapter’s Subscription and Request-Response services can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has two processes, Get_PurchaseOrder and Sync_PurchaseOrder.
• Get_PurchaseOrder uses the adapter’s 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.
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.
• Sync_PurchaseOrder 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.
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 New empty project.
2. Save the project as PurchaseOrder.
3. Click Project>Import Full Project.
4. Click the Zip Archive tab and browse to locate the PurchaseOder.zip file.
install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\Purchase Order
5. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
— Overwrite on name conflict.
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.
7. Check the checkbox for Include Existing Files.
8. Click Apply.
TIBCO ActiveMatrix Adapter for SAP Examples
50 | TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object
9. 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
— ASAP_HOME (Home directory of the adapter, install_path\tibco\adapter\adr3\version_number)
10. Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name for the dat file.
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 specified in step 10.
12. Save the project.
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 Start 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 | 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\BusinessWorks\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="4500006374"> <PoAddress> <ADDRNUMBER>0000006951</ADDRNUMBER> <ADDRHANDLE/> <NATION/> <DATE>00010101</DATE> <DATE_FROM/> <DATE_TO/> <TITLE>0003</TITLE> <NAME1>C.E.B. BERLIN</NAME1> <NAME2/> <NAME3/> <NAME4/> <NAME_TXT/> <NAME_CO/> <CITY1>Berlin</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>Kolping Str. 15</STREET> <STREETCODE/> <STREETABBR/> <HOUSE_NUM1/> <HOUSE_NUM2/> <HOUSE_NUM3/>
TIBCO ActiveMatrix Adapter for SAP Examples
Expected Results | 53
<STR_SUPPL1/> <STR_SUPPL2/> <LOCATION/> <BUILDING/> <FLOOR/> <ROOMNUMBER/> <COUNTRY>DE</COUNTRY> <LANGU>D</LANGU> <REGION>11</REGION> <SORT1>ALLGEMEIN</SORT1> <SORT2/> <SORT_PHN/> <ADDRORIGIN/> <EXTENSION1/> <EXTENSION2/> <TIME_ZONE/> <TAXJURCODE/> <ADDRESS_ID/> <REMARK/> <DEFLT_COMM/> <TEL_NUMBER/> <TEL_EXTENS/> <FAX_NUMBER/> <FAX_EXTENS/> <BUILD_LONG/> </PoAddress> <PoHeader> <PO_NUMBER/> <CO_CODE/> <DOC_CAT/> <DOC_TYPE/> <CNTRL_IND/> <DELETE_IND/> <STATUS/> <CREATED_ON/> <CREATED_BY/> <ITEM_INTVL/> <LAST_ITEM/> <VENDOR>0000001000</VENDOR> <LANGUAGE>D</LANGUAGE> <PMNTTRMS>ZB01</PMNTTRMS> <DSCNT1_TO/> <DSCNT2_TO/> <DSCNT3_TO/> <CASH_DISC1/> <CASH_DISC2/> <PURCH_ORG/> <PUR_GROUP/> <CURRENCY>DEM</CURRENCY> <EXCH_RATE/> <EX_RATE_FX/> <DOC_DATE/> <VPER_START/> <VPER_END/> <APPLIC_BY/> <QUOT_DEAD/> <BINDG_PER/>
TIBCO ActiveMatrix Adapter for SAP Examples
54 | TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object
<WARRANTY>00000000</WARRANTY> <BIDINV_NO/> <QUOTATION/> <QUOT_DATE/> <REF_1/> <SALES_PERS/> <TELEPHONE>010/32323</TELEPHONE> <SUPPL_VEND/> <CUSTOMER/> <AGREEMENT/> <REJ_REASON/> <COMPL_DLV/> <GR_MESSAGE/> <SUPPL_PLNT/> <RCVG_VEND/> <INCOTERMS1>EXW</INCOTERMS1> <INCOTERMS2>Berlin</INCOTERMS2> <TARGET_VAL/> <COLL_NO/> <DOC_COND/> <PROCEDURE>RM0000</PROCEDURE> <UPDATE_GRP/> <DIFF_INV/> <EXPORT_NO/> <OUR_REF/> <LOGSYSTEM/> <SUBITEMINT>00001</SUBITEMINT> <MAST_COND/> <REL_GROUP/> <REL_STRAT/> <REL_IND/> <REL_STATUS/> <SUBJ_TO_R/> <TAXR_CNTRY/> <SCHED_IND/> <VEND_NAME/> <CURRENCY_ISO/> <EXCH_RATE_CM/> </PoHeader> <PoItemAccountAssignm/> <PoItemConfirmations/> <PoItemContractLimits/> <PoItemHistory/> <PoItemHistoryTotals/> <PoItemLimits/> <PoItems/> <PoItemSchedules/> <PoItemServices/> <PoItemSrvAccassValues/> <PoItemTexts/> <Return/></ns0:PurchaseOrder.GetDetail.Response>
• 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 | 55
<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
56 | TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object
TIBCO ActiveMatrix Adapter for SAP Examples
| 57
Chapter 5 TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object
This example shows how to use the adapter’s Request-Response service within a TIBCO ActiveMatrix BusinessWorks process to get an Employee record stored in the SAP system.
This example uses TIBCO Rendezvous as its transport type.
Topics
• Example Description, page 58
• Setup the Example, page 59
• Test the Example, page 61
• Expected Results, page 62
All files relevant to this example are located in the following location.
install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\Employee
TIBCO ActiveMatrix Adapter for SAP Examples
58 | TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object
Example Description
This example shows how the adapter’s Request-Response service can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has one process, Get_Employee.
• Get_Employee uses the adapter’s Request-Response Service to fetch data from SAP for a particular employee. The data is fetched based on the Employee name 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 | 59
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 New empty project.
2. Save the project as Employee.
3. Click Project>Import Full Project.
4. Click the Zip Archive tab and browse to locate the Employee.zip file. install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\Employee
5. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
— Overwrite on name conflict.
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.
7. Check the checkbox for Include Existing Files and click Apply.
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
— ASAP_HOME (Home directory of the adapter, install_path\tibco\adapter\adr3\version_number)
TIBCO ActiveMatrix Adapter for SAP Examples
60 | TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object
9. Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name for the dat file.
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 specified in step 9.
11. Save the project.
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 | 61
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 Start 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
62 | 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\BusinessWorks\Employee
• Get_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.
<?xml version="1.0" encoding="UTF-8"?><ns0:Employee.GetList.Response xmlns:ns0="urn:sap-com:document:sap:business"> <OrgAssignment> <item> <PERNO>00102745</PERNO> <INFOTYPE>0001</INFOTYPE> <SUBTYPE/> <SEQNO>000</SEQNO> <TEXTFLAG/> <SCREENCTRL/> <REASON/> <FLAG1/> <FLAG2/> <FLAG3/> <FLAG4/> <RESERVED1/> <RESERVED2/> <EGROUP>1</EGROUP> <ESUBGROUP>U1</ESUBGROUP> <PAYAREA>UW</PAYAREA> <CONTRACT/> <COSTCENTER>0000001810</COSTCENTER> <POSITION>50004916</POSITION> <JOB>50017453</JOB> <SUPERVISOR/> <NAME>Mr. Michael Aaron</NAME> <OBJECTTYPE>S</OBJECTTYPE> <ADMINGROUP>300</ADMINGROUP> <FUND/> <ORGTXT>Sales Graphics</ORGTXT> <JOBTXT>Functional Specialists (U</JOBTXT> <POSTXT>Graphics Specialist</POSTXT> </item> </OrgAssignment> <PersonalData> <item> <PERNO>00102745</PERNO> <INFOTYPE>0002</INFOTYPE> <SUBTYPE/>
TIBCO ActiveMatrix Adapter for SAP Examples
Expected Results | 63
<SEQNO>000</SEQNO> <TEXTFLAG/> <SCREENCTRL/> <REASON/> <FLAG1/> <FLAG2/> <FLAG3/> <FLAG4/> <RESERVED1/> <RESERVED2/> <INITIALS/> <FIRSTNAME>Michael</FIRSTNAME> <TITLE/> <NAMEAFFIX/> <NAMEPREFIX/> <FORMOFADR>1</FORMOFADR> <GENDER>1</GENDER> <BIRTHDATE>19750623</BIRTHDATE> <BIRTHCTRY/> <BIRTHSTATE/> <BIRTHPLACE/> <NATIONAL/> <LANGU>E</LANGU> <RELIGION/> <PERMO>10</PERMO> <PERID>798798748</PERID> <BIRTHDTPP>00000000</BIRTHDTPP> <BIRTHYEAR>1975</BIRTHYEAR> <BIRTHMONTH>06</BIRTHMONTH> <BIRTHDAY>23</BIRTHDAY> </item> </PersonalData> <Return> <TYPE/> <MESSAGE/> </Return></ns0:Employee.GetList.Response>
TIBCO ActiveMatrix Adapter for SAP Examples
64 | TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object
TIBCO ActiveMatrix Adapter for SAP Examples
</ns0:Employee.GetList.Response> | 65
</ns0:Employee.GetList.Response>
Chapter 6 TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object
This example shows how to use the adapter’s Request-Response service within a TIBCO ActiveMatrix BusinessWorks process to get and synchronize material details stored in the SAP system.
This example uses TIBCO Rendezvous as its transport type.
Topics
• Example Description, page 66
• Setup the Example, page 67
• Test the Example, page 69
• Expected Results, page 70
All files relevant to this example are located in the following location.
install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\ItemMaster
TIBCO ActiveMatrix Adapter for SAP Examples
66 | TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object
Example Description
This example shows how the adapter’s Subscription and Request-Response services can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has two processes, Get_ItemMaster and Sync_ItemMaster.
• Get_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.
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.
• Sync_ItemMaster 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.
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 | 67
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 New empty project.
2. Save the project as ItemMaster.
3. Click Project>Import Full Project.
4. Click the Zip Archive tab and browse to locate the ItemMaster.zip file.
install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\ItemMaster
5. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
— Overwrite on name conflict.
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.
7. Check the checkbox for Include Existing Files and click Apply.
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
— ASAP_HOME (Home directory of the adapter, install_path\tibco\adapter\adr3\version_number)
TIBCO ActiveMatrix Adapter for SAP Examples
68 | TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object
9. Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name for the dat file.
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 specified in step 9.
11. Save the project.
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 | 69
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 Start 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
70 | 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\BusinessWorks\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="000000000000000068"> <MaterialGeneralData> <MATL_DESC>a portable 1 ton crane</MATL_DESC> <OLD_MAT_NO/> <MATL_TYPE>FHMI</MATL_TYPE> <IND_SECTOR>A</IND_SECTOR> <DIVISION/> <MATL_GROUP>013</MATL_GROUP> <PROD_HIER/> <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>0</GROSS_WT> <NET_WEIGHT>0</NET_WEIGHT> <UNIT_OF_WT/> <VOLUME>0</VOLUME> <VOLUMEUNIT/> <LENGTH>0</LENGTH> <WIDTH>0</WIDTH> <HEIGHT>0</HEIGHT> <UNIT_DIM/> <MANU_MAT/> <MFR_NO/> <BASE_UOM_ISO>PCE</BASE_UOM_ISO> <UNIT_OF_WT_ISO/> <VOLUMEUNIT_ISO/> <UNIT_DIM_ISO/> <CREATED_ON>19960112</CREATED_ON>
TIBCO ActiveMatrix Adapter for SAP Examples
Expected Results | 71
<CREATED_BY>PANACEK</CREATED_BY> <LAST_CHNGE>20030123</LAST_CHNGE> <CHANGED_BY>I021066</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>
• Sync_ItemMaster — The IDoc MATMAS is stored in matmas.xml file. Sample of the matmas.xml is given next.
<?xml version="1.0" encoding="US-ASCII"?><MATMAS01> <IDOC> <EDI_DC40> <TABNAM>EDI_DC40</TABNAM> <MANDT>800</MANDT> <DOCNUM>0000000002347081</DOCNUM> <DOCREL>700</DOCREL> <STATUS>30</STATUS> <DIRECT>1</DIRECT> <OUTMOD>2</OUTMOD> <EXPRSS/> <TEST/> <IDOCTYP>MATMAS01</IDOCTYP> <CIMTYP/> <MESTYP>MATMAS</MESTYP> <MESCOD/> <MESFCT/> <STD/> <STDVRS/> <STDMES/> <SNDPOR>SAPTE2</SNDPOR> <SNDPRT>LS</SNDPRT> <SNDPFC/> <SNDPRN>T90CLNT090</SNDPRN> <SNDSAD/> <SNDLAD/> <RCVPOR>A000000067</RCVPOR> <RCVPRT>LS</RCVPRT> <RCVPFC/> <RCVPRN>ZSABARI</RCVPRN> <RCVSAD/>
TIBCO ActiveMatrix Adapter for SAP Examples
72 | TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object
<RCVLAD/> <CREDAT>20120216</CREDAT> <CRETIM>190639</CRETIM> <REFINT/> <REFGRP/> <REFMES/> <ARCKEY/> <SERIAL>20120216190639</SERIAL> </EDI_DC40> <E1MARAM> <MSGFN>005</MSGFN> <MATNR>100-251</MATNR> <ERSDA>20021219</ERSDA> <ERNAM>DAVISONI</ERNAM> <LAEDA>20110722</LAEDA> <AENAM>KRISHNA</AENAM> <PSTAT>KVEDBG</PSTAT> <MTART>HAWA</MTART> <MBRSH>A</MBRSH> <MATKL>001</MATKL> <MEINS>PCE</MEINS> <BLANZ>000</BLANZ> <EKWSL>1</EKWSL> <BRGEW>0.250</BRGEW> <NTGEW>0.250</NTGEW> <GEWEI>KGM</GEWEI> <VOLUM>0.000</VOLUM> <TRAGR>0001</TRAGR> <SPART>01</SPART> <WESCH>0.000</WESCH> <LAENG>0.000</LAENG> <BREIT>0.000</BREIT> <HOEHE>0.000</HOEHE> <ERGEW>0.000</ERGEW> <ERVOL>0.000</ERVOL> <GEWTO>0.0</GEWTO> <VOLTO>0.0</VOLTO> <FUELG>0</FUELG> <STFAK>0</STFAK> <MHDRZ>0</MHDRZ> <MHDHB>0</MHDHB> <MHDLP>0</MHDLP> <VPSTA>KVEDBG</VPSTA> <MSTDE>00000000</MSTDE> <MSTDV>00000000</MSTDV> <COMPL>00</COMPL> <E1MAKTM> <MSGFN>005</MSGFN> <SPRAS>D</SPRAS> <MAKTX>Sechskantschraube M10</MAKTX> </E1MAKTM> <E1MAKTM> <MSGFN>005</MSGFN> <SPRAS>E</SPRAS> <MAKTX>1.5" Hex nut gasket neoprene white</MAKTX> </E1MAKTM> <E1MAKTM>
TIBCO ActiveMatrix Adapter for SAP Examples
Expected Results | 73
<MSGFN>005</MSGFN> <SPRAS>F</SPRAS> <MAKTX>VIS À TÊTE HEXAGONALE M10</MAKTX> </E1MAKTM> <E1MAKTM> <MSGFN>005</MSGFN> <SPRAS>J</SPRAS> <MAKTX>TEJA M10</MAKTX> </E1MAKTM> <E1MAKTM> <MSGFN>005</MSGFN> <SPRAS>P</SPRAS> <MAKTX>Parafuso sextavado M10</MAKTX> </E1MAKTM> <E1MAKTM> <MSGFN>005</MSGFN> <SPRAS>R</SPRAS> <MAKTX>TEJA M10</MAKTX> </E1MAKTM> <E1MAKTM> <MSGFN>005</MSGFN> <SPRAS>S</SPRAS> <MAKTX>Tornillo cabeza hexagonal M10</MAKTX> </E1MAKTM> <E1MARCM> <MSGFN>005</MSGFN> <WERKS>1000</WERKS> <PSTAT>VEDBG</PSTAT> <EKGRP>001</EKGRP> <DISMM>PD</DISMM> <DISPO>101</DISPO> <PLIFZ>10</PLIFZ> <WEBAZ>1</WEBAZ> <PERKZ>M</PERKZ> <AUSSS>0.00</AUSSS> <DISLS>FX</DISLS> <BESKZ>F</BESKZ> <MINBE>0.000</MINBE> <EISBE>100.000</EISBE> <BSTMI>0.000</BSTMI> <BSTMA>0.000</BSTMA> <BSTFE>1000.000</BSTFE> <BSTRF>0.000</BSTRF> <MABST>0.000</MABST> <LOSFX>0</LOSFX> <SBDKZ>2</SBDKZ> <AUSDT>00000000</AUSDT> <FHORI>001</FHORI> <BEARZ>0.00</BEARZ> <RUEZT>0.00</RUEZT> <TRANZ>0.00</TRANZ> <BASMG>0.000</BASMG> <DZEIT>0</DZEIT> <MAXLZ>0</MAXLZ> <UEETO>0.0</UEETO> <UNETO>0.0</UNETO> <WZEIT>0</WZEIT>
TIBCO ActiveMatrix Adapter for SAP Examples
74 | TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object
<VZUSL>0.00</VZUSL> <UMLMC>0.000</UMLMC> <LADGR>0003</LADGR> <LGRAD>0.0</LGRAD> <OBJID>00000000</OBJID> <MTVFP>01</MTVFP> <VRVEZ>0.00</VRVEZ> <VBAMG>0.000</VBAMG> <VBEAZ>0.00</VBEAZ> <PRCTR>0000001010</PRCTR> <TRAME>0.000</TRAME> <FXHOR>000</FXHOR> <VINT1>000</VINT1> <VINT2>000</VINT2> <LOSGR>10.000</LOSGR> <LGPRO>0001</LGPRO> <DISGR>PP01</DISGR> <KAUSF>0.00</KAUSF> <TAKZT>0</TAKZT> <AWSLS>000001</AWSLS> <VRBDT>00000000</VRBDT> <VRBFK>0.00</VRBFK> <PRENO>00000000</PRENO> <PREND>00000000</PREND> <PRENG>00000000</PRENG> <PRFRQ>0</PRFRQ> <LGFSB>0001</LGFSB> <SHZET>00</SHZET> <MMSTD>00000000</MMSTD> <DPLHO>0</DPLHO> <MINLS>0.000</MINLS> <MAXLS>0.000</MAXLS> <FIXLS>0.000</FIXLS> <LTINC>0.000</LTINC> <COMPL>00</COMPL> </E1MARCM> <E1MARMM> <MSGFN>005</MSGFN> <MEINH>PCE</MEINH> <UMREZ>1</UMREZ> <UMREN>1</UMREN> <LAENG>0.000</LAENG> <BREIT>0.000</BREIT> <HOEHE>0.000</HOEHE> <VOLUM>0.000</VOLUM> <BRGEW>0.250</BRGEW> <GEWEI>KGM</GEWEI> </E1MARMM> <E1MBEWM> <MSGFN>005</MSGFN> <BWKEY>1000</BWKEY> <VPRSV>S</VPRSV> <VERPR>0.95</VERPR> <STPRS>0.95</STPRS> <PEINH>1</PEINH> <BKLAS>3100</BKLAS> <VMVPR>S</VMVPR>
TIBCO ActiveMatrix Adapter for SAP Examples
Expected Results | 75
<VMVER>0.95</VMVER> <VMSTP>0.95</VMSTP> <VMPEI>1</VMPEI> <VMBKL>3100</VMBKL> <VJVPR>S</VJVPR> <VJVER>0.95</VJVER> <VJSTP>0.95</VJSTP> <LFGJA>2002</LFGJA> <LFMON>12</LFMON> <ZKPRS>0</ZKPRS> <ZKDAT>00000000</ZKDAT> <BWPRS>0</BWPRS> <BWPRH>0</BWPRH> <VJBWS>0</VJBWS> <VJBWH>0</VJBWH> <VVJLB>0.000</VVJLB> <VVMLB>0.000</VVMLB> <VVSAL>0</VVSAL> <ZPLPR>0</ZPLPR> <ZPLP1>0</ZPLP1> <ZPLP2>0</ZPLP2> <ZPLP3>0</ZPLP3> <ZPLD1>00000000</ZPLD1> <ZPLD2>00000000</ZPLD2> <ZPLD3>00000000</ZPLD3> <BWPH1>0</BWPH1> <BWPS1>0</BWPS1> <ABWKZ>00</ABWKZ> <PSTAT>BG</PSTAT> <KALN1>000100061872</KALN1> <KALNR>000100061873</KALNR> <VERS1>00</VERS1> <VERS2>00</VERS2> <VERS3>00</VERS3> <KOSGR>SAP10</KOSGR> <PPRDZ>000</PPRDZ> <PPRDL>000</PPRDL> <PPRDV>000</PPRDV> <PDATZ>0000</PDATZ> <PDATL>0000</PDATL> <PDATV>0000</PDATV> <EKALR>X</EKALR> <VPLPR>0</VPLPR> <VJBKL>3100</VJBKL> <VJPEI>1</VJPEI> <HKMAT>X</HKMAT> <BWPEI>0</BWPEI> </E1MBEWM> <E1MVKEM> <MSGFN>005</MSGFN> <VKORG>1000</VKORG> <VTWEG>10</VTWEG> <SKTOF>X</SKTOF> <VMSTD>00000000</VMSTD> <AUMNG>0.000</AUMNG> <LFMNG>0.000</LFMNG> <EFMNG>0.000</EFMNG>
TIBCO ActiveMatrix Adapter for SAP Examples
76 | TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object
<SCMNG>0.000</SCMNG> <MTPOS>NORM</MTPOS> </E1MVKEM> <E1MLANM> <MSGFN>005</MSGFN> <ALAND>DE</ALAND> <TATY1>MWST</TATY1> <TAXM1>1</TAXM1> </E1MLANM> </E1MARAM> </IDOC></MATMAS01>
TIBCO ActiveMatrix Adapter for SAP Examples
| 77
Chapter 7 TIBCO ActiveMatrix BusinessWorks: BDC Example
This example shows how to use the adapter’s 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.
Topics
• Example Description, page 78
• Setup the Example, page 80
• Test the Example, page 82
• Expected Results, page 83
All files relevant to this example are located in the following location.
install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\BDC
TIBCO ActiveMatrix Adapter for SAP Examples
78 | TIBCO ActiveMatrix BusinessWorks: BDC Example
Example Description
This example shows how the adapter’s 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 | 79
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
80 | 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.
Create a batch in the SAP system. For details, refer TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment.
In TIBCO Designer:
1. In the initial dialog box click New empty project.
2. Save the project as BDC.
3. Click Project>Import Full Project.
4. 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\BusinessWorks\BDC
5. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
— Overwrite on name conflict.
6. Click the File Poller icon. In the configuration panel, File Name field, click Browse and select the input XML file. Click Apply.
7. Include appropriate values for the following global variables:
— AppServer
— Client
— GatewayHost
— GatewayService
— Password
— ProgramID
— SystemNumber
— TIBCO_HOME (Home directory of the TIBCO installation)
— UserName
8. Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name for the dat file.
9. Modify the repourl and configurl parameters in adr3.tra under
TIBCO ActiveMatrix Adapter for SAP Examples
Setup the Example | 81
install_path\tibco\adapter\adr3\version_number\bin
folder to point to the dat file specified in step 8.
10. Save the project.
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
82 | 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 Start 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 | 83
Expected Results
The example results can be viewed in the respective XML files written to:
install_path\tibco\adapter\adr3\version_number\examples\BusinessWorks\BDC
BDC_Process — 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.
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
| 85
Chapter 8 TIBCO ActiveMatrix BusinessWorks: Dynamic Logon for RFC
This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process.
Topics
• Example Description, page 86
• Setup the Example, page 87
• Test the Example, page 89
• Expected Results, page 90
All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\version_number\examples\BusinessWorks\AdvancedFeatures\DynamicLogOn
TIBCO ActiveMatrix Adapter for SAP Examples
86 | 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 | 87
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 New empty project.
2. Save the project as DynamicLogon.
3. Click Project>Import Full Project.
4. 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\BusinessWorks\AdvancedFeatures\DynamicLogOn
5. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
— Overwrite on name conflict.
6. Include appropriate values for the following global variables:
— AppServer
— Client
— GatewayHost
— GatewayService
— Password
— ProgramID
— SystemNumber
— UserName
7. Navigate to the Invoke LogOn Service in the DynamicLogon process definition and updated the values under the Input tab to match those with your SAP system.
8. Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name for the dat file.
9. 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 specified in step 8.
TIBCO ActiveMatrix Adapter for SAP Examples
88 | TIBCO ActiveMatrix BusinessWorks: Dynamic Logon for RFC
10. Save the project.
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 | 89
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 Start 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
90 | 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
| 91
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.
Topics
• Example Description, page 92
• Setup the Example, page 93
• Test the Example, page 95
• Expected Results on page 96
All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\version_number\examples\BusinessWorks\AdvancedFeatures\ExternalCommit
TIBCO ActiveMatrix Adapter for SAP Examples
92 | 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 | 93
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 New empty project and save it as ExternalCommit.
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\BusinessWorks\AdvancedFeatures\ExternalCommit
4. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
— Overwrite on name conflict.
5. Click Apply.
6. Include appropriate values for the following global variables:
— AppServer
— Client
— GatewayHost
— GatewayService
— Password
— ProgramID
— SystemNumber
— UserName
7. Navigate to the Invoke an Adapter Request-Response Service in the External Commit process definition and updated the values under the Input tab to match those with your SAP system.
8. Navigate to the R3AdapterConfiguration > Design-Time Connection tab and uncheck the checkbox for Use Design-time Connection For Run-Time.
9. Click Apply.
10. Click the Run-Time Inbound tab and specify values for your environment.
TIBCO ActiveMatrix Adapter for SAP Examples
94 | TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI
11. Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name. for the dat file.
12. Modify the repourl and configurl parameters in adr3.tra under
install_path\tibco\adapter\adr3\version_number\bin
folder to point to the location of the dat file. specified in step 11.
13. Save the project.
14. Run the adapter from the command line
adr3 --propFile <adapter_home>\bin\adr3.tra
15. Exit TIBCO Designer.
TIBCO ActiveMatrix Adapter for SAP Examples
Test the Example | 95
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 Start 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
96 | 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
| 97
Chapter 10 TIBCO ActiveMatrix BusinessWorks: Data Caching using RFC
This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process.
Topics
• Example Description, page 98
• Setup the Example, page 99
• Test the Example, page 101
• Expected Results, page 102
All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\version_number\examples\BusinessWorks\AdvancedFeatures\DataCaching
TIBCO ActiveMatrix Adapter for SAP Examples
98 | 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 | 99
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 New empty project.
2. Save the project as DataCaching.
3. Click Project>Import Full Project.
4. 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\BusinessWorks\AdvancedFeatures\DataCaching
5. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
— Overwrite on name conflict.
6. Include appropriate values for the following global variables:
— AppServer
— Client
— GatewayHost
— GatewayService
— Password
— ProgramID
— SystemNumber
— UserName
7. Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name. for the dat file.
8. 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 specified in step 7.
9. Save the project.
10. Run the adapter from the command line
TIBCO ActiveMatrix Adapter for SAP Examples
100 | TIBCO ActiveMatrix BusinessWorks: Data Caching using RFC
adr3 --propFile <adapter_home>\bin\adr3.tra
11. Exit TIBCO Designer.
TIBCO ActiveMatrix Adapter for SAP Examples
Test the Example | 101
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 Start 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
102 | 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
| 103
Chapter 11 TIBCO ActiveMatrix BusinessWorks: IDoc Filtering
This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process.
Topics
• Example Description, page 104
• Setup the Example, page 106
• Test the Example, page 108
• Expected Results, page 109
All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\version_number\examples\BusinessWorks\AdvancedFeatures\IDocFiltering
TIBCO ActiveMatrix Adapter for SAP Examples
104 | 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 | 105
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
106 | 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 New empty project.
2. Save the project as IDocFiltering.
3. Click Project>Import Full Project.
4. 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\BusinessWorks\AdvancedFeatures\IDocFiltering
5. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
— Overwrite on name conflict.
6. Include appropriate values for the following global variables:
— AppServer
— Client
— GatewayHost
— GatewayService
— Password
— ProgramID
— SystemNumber
— UserName
— OutputFile
7. Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name for the dat file.
8. 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 specified in step 7.
9. Save the project.
TIBCO ActiveMatrix Adapter for SAP Examples
Setup the Example | 107
10. Run the adapter from the command line
adr3 --propFile <adapter_home>\bin\adr3.tra
11. Exit TIBCO Designer.
TIBCO ActiveMatrix Adapter for SAP Examples
108 | 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 Start 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 | 109
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
| 111
Chapter 12 TIBCO ActiveMatrix BusinessWorks: IDoc Reporting
This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process.
This example uses Java Messaging Service (JMS) as its transport type.
Topics
• Example Description, page 112
• Setup the Example, page 115
• Test the Example, page 117
• Expected Results, page 118
All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\version_number\examples\BusinessWorks\AdvancedFeatures\IDocReporting
TIBCO ActiveMatrix Adapter for SAP Examples
112 | 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 ReportingTo 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 | 113
4. Associate this publisher endpoint to the Subscription Service by referring to this endpoint in the Confirm Publisher reference field as shown in the following figure:
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
114 | TIBCO ActiveMatrix BusinessWorks: IDoc Reporting
the same. In this example, the Queue name is test_report as shown in the following figure.
TIBCO ActiveMatrix Adapter for SAP Examples
Setup the Example | 115
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 New empty project.
2. Save the project as IDocReporting.
3. Click Project>Import Full Project.
4. 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\BusinessWorks\AdvancedFeatures\IDocReporting.
5. In the Import - Options dialog box, check the checkboxes for
— Replace existing global variables with those in import, and
— Overwrite on name conflict.
6. Include appropriate values for the following global variables:
— AppServer
— Client
— GatewayHost
— GatewayService
— Password
— ProgramID
— SystemNumber
— UserName
— IDocOutput
— ErrorOutput
— ExceptionOutput
7. Update the value of the Valid Destinations field in the R3Adapterconfiguration> Adapter Services tab to match your configuration.
Update the RCVPOR and RCVPRN fields in the Publish to Adapter activity to match the value specified in the Valid Destinations field.
TIBCO ActiveMatrix Adapter for SAP Examples
116 | TIBCO ActiveMatrix BusinessWorks: IDoc Reporting
8. *Click Project > Export Full Project> Local Repository and specify values for Project Name and Dir Name for the dat file.
9. 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 specified in step 8.
10. Click the IDocReporting process definition and select the Publish to Adapter resource.
11. Navigate to the Input tab and update values listed in the Activity Input pane to match those with your SAP system.
12. Save the project.
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 | 117
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 Start 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
118 | TIBCO ActiveMatrix BusinessWorks: IDoc Reporting
Expected Results
The example results can be viewed in the respective .txt files written to:
• IDocOutput.txt or
• ErrorOutput.txt or
• ExceptionOutput.txt
depending on the status of the IDoc subscribed.
TIBCO ActiveMatrix Adapter for SAP Examples
| 119
Chapter 13 Examples for Advanced Features
This chapter discusses some examples that use advanced adapter features.
Topics
• Overview, page 120
• UserExit, page 121
• Control Field Replacements, page 124
• Dynamic Subjects, page 125
TIBCO ActiveMatrix Adapter for SAP Examples
120 | Examples for Advanced Features
Overview
The examples provided in this chapter demonstrate the usage of the following advanced features of the adapter:
• UserExit
• Control Field Replacements
• Dynamic Subject
The examples are covered in detail in the later sections of this chapter. These examples are available in the following folder of the adapter installation. TIBCO_HOME\adapter\adr3\version_number\examples\repository\R3ExamplesAdv.dat
TIBCO ActiveMatrix Adapter for SAP Examples
UserExit | 121
UserExit
This feature is used to perform user-defined operations on IDocs before publishing or after subscribing from the TIBCO environment. On the publication side you can invoke an operation using user exits before publishing the IDoc.
On the subscription side you can configure user exit to send operation request to server after subscribing to IDoc data. This operation can carry out simple transformation for IDoc messages. You must code the implementation of the operation separately.
A simple example for user exit is included in the installation. The code is available in adr3\version_number\examples\cpp\UserExitExe. This code creates an Rpc Server listening to the subject USEREXIT.LISTENING.SUBJECT. The operations associated with this RPC Server are PublisherUserExit and SubscriberUserExit. Both of these operations are defined inside class userExit. The class userExit is part of the product classes accompanying the adapter.
In order to invoke the operations implemented by the Rpc Server, you must first create an Rpc Client with similar properties that is subject, classRef, etc. To invoke the operation from the client, use the operation names associated with the server.
For obtaining information on the actual operations, refer to the local repository adr3\version_number\examples\repository\R3ADAPTER_EXAMPLES.dat
In order to compile this example, the following settings need to be carried out:
1. Additional 'include' directories to include:
a. <sdk install-dir> (e.g. C:\TIBCO\SDK) \includeb. <rv install-dir>
(TIBCO_HOME\TIBRV) \include (TIBCO_HOME\Tra)\include
2. Additional library directories to include:a. <sdk install-dir>\lib
b. <rv install-dir>\lib
3. Library to include:a. Maverick50.lib
This example has been compiled only for Windows NT. To compile in UNIX environments, minor changes in code may be required.
TIBCO ActiveMatrix Adapter for SAP Examples
122 | Examples for Advanced Features
Usage In order to run the example adapter containing an Rpc Server, you must do the following:
1. Compile and link the accompanying source and header files using the latest TIBCO Rendezvous and TIBCO Adapter SDK.
2. The configuration and metadata required by the adapter is in the local repository R3ADAPTER_EXAMPLES.dat located in adr3\version_number\examples\repository. If you wish to use another repository, you must export the adapter instance from this local repository and then import it to the repository desired.
3. To invoke the operations implemented by the RPC Server inside the adapter, you must define the following in the adapter acting as the RPC Client that is the adapter making the invocation.
4. Invoke the user exit used by the Publisher.
— Associate the desired IDoc to an operation called PublisherUserExit.
— Make sure to create a RVCM RPC Client on subject USEREXIT.LISTENING.SUBJECT and classRef userExit.
— Since the Publisher expects a reply coming back from the user exit operation, make sure that the operation SubscriberUserExit is defined as request/reply.
All of the above information is based on the current source code and local repository provided as part of the adapter. If you make changes to the source code, you may need to make similar changes in the repository and vice-versa.
5. Invoke the user exit used by the Subscriber,
— Associate the desired IDoc to an operation called SubscriberUserExit.
— Make sure to create a RVCM Rpc Client on subject USEREXIT.LISTENING.SUBJECT and classRef userExit.
— Since the Subscriber expects a reply coming back from the user exit operation, make sure that the operation SubscriberUserExit is defined as request/reply.
For details on configuring UserExit for Publisher using TIBCO Designer, refer to TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment.
For details on configuring UserExit for Subscription service using TIBCO Designer, refer to TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment.
TIBCO ActiveMatrix Adapter for SAP Examples
UserExit | 123
All of the above information is based on the current source code and local repository provided as part of the adapter. If you make changes to the source code, you may need to make similar changes in the repository and vice-versa.
TIBCO ActiveMatrix Adapter for SAP Examples
124 | Examples for Advanced Features
Control Field Replacements
This feature is applicable to IDoc publishers. It allows you to replace the value of the fields in the control record of the IDoc. For example, replacing the values of the fields RCVPRN (receiving partner) or RCVPOR (receiving port), can be done within the adapter itself and no separate transformation service is needed.
An example for this feature is provided in the adr3\version_number\examples directory of the adapter installation. The publisher instance configured in R3ExamplesAdv.dat is configured for control field replacement. In this instance, the control field SNDPRN is set to sender and the control field RCVPRN is set to receiver
To test the replacement of control fields:
1. Run the Publisher instance.
2. Send the IDoc from the SAP system.
3. Capture the outgoing message from the publication service using rvstream. In the rvstream capture, you will be able see the values of control fields, SNDPRN and RCVPRN getting replaced with sender and receiver respectively.
For configuring this feature using TIBCO Designer, refer to the TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment.
TIBCO ActiveMatrix Adapter for SAP Examples
Dynamic Subjects | 125
Dynamic Subjects
This feature is applicable to IDoc publishers. Based on the content of the fields in the control record the subject for the IDoc publisher can be set. This helps in routing the messages based on the content and hence if there are different consumers for the same message they can listen to the message on the value of the field content. For example if the partner number is a part of the dynamic subject then the message for different partners will be published on different subjects.
An example to illustrate this feature is provided in the examples directory of the adapter installation. Dynamic subjects should be configured with any control field record enclosed within '$' For example, if the subject configured is mysubject.$DOCNUM$, each IDoc will be published on a different subject corresponding to the DOCNUM of that particular IDoc.
The path of the example is given next.
TIBCO_HOME\adapter\adr3\version_number\examples\repository\R3ExamlesAdv.dat
The publisher instance configured in the R3ExamplesAdv.dat is configured for the subject, mysubject.$DOCNUM$.
To test the content based routing:
1. Run the adapter instance for the publisher.
2. Run tibrvlisten on "mysubject.>" For each message you will be able to view the change in the subject.
TIBCO ActiveMatrix Adapter for SAP Examples
| 127
Index
A
API 6
B
Business Object Examples 2, 2
C
Control Field Replacements 124, 124, 124, 124Create a Database Table in the SAP System 10, 10Create RFC Functions 15, 15Creating a Database Table in the SAP System 10, 10Creating an Inbound Instance 27, 27, 27, 27Creating an Outbound Instance 24, 24, 24, 24Creating Outbound and Inbound Instances Using
TIBCO Designer 24, 24, 24, 24Creating RFC Functions 15, 15Customer 4customer support 8, 8
D
Dynamic Subjects 125, 125, 125, 125
E
Employee 5Employee Business Object 5ENV_HOME 4
Example Description 32, 40, 48, 58, 66, 78Expected Results 38, 44, 52, 62, 70, 83
I
ItemMaster 5ItemMaster Business Object 5
L
Location 8
O
Overview 2, 2, 2, 2, 120, 120, 120, 120
P
Prerequisites 7PurchaseOrder 5PurchaseOrder Business Object 5
R
Running the example 27, 30RV 7, 7RVCM 7RVDQ 7
TIBCO ActiveMatrix Adapter for SAP Examples
128 |
S
SalesOrder 4Selecting a Service 25, 25, 25, 25Selecting Schema 25, 25, 25, 25Setting up Connection 24, 24, 24, 24, 27, 27, 27, 27Setup for all the processes
33Setup the Example 33, 41, 49, 59, 67, 80Storing Shared Objects in One Location 22, 22, 22support, contacting 8, 8
T
Task A Create_SalesOrder and Get_SalesOrder Setup41
Task A Deploy the Example 35Task A Get_PurchaseOrder and Sync_PurchaseOrder
Setup49
Task B Start JMS Server 42, 50technical support 8, 8Test the Example 43, 51, 61, 69, 82Testing the Function Modules 22, 22, 22, 22TIBCO_HOME 4
U
UserExit 121, 121, 121, 121Using TIBCO ActiveMatrix BusinessWorks 7
W
Working with dat files in TIBCO Designer 8
TIBCO ActiveMatrix Adapter for SAP Examples