Escolar Documentos
Profissional Documentos
Cultura Documentos
Important Information
SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE. USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN LICENSE.PDF) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE LICENSE FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME. This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc. TIB, TIBCO, TIBCO Adapter, Predictive Business, Information Bus, The Power of Now, TIBCO ActiveMatrix BusinessWorks, TIBCO Rendezvous, TIBCO Administrator, TIBCO Designer, TIBCO Runtime Agent, TIBCO Hawk, TIBCO Enterprise Message Service, TIBCO Designer Add-in for TIBCO Business Studio, TIBCO ActiveMatrix Service Grid, TIBCO ActiveMatrix Service Bus, TIBCO ActiveMatrix BusinessWorks Service Engine, and TIBCO Business Studio are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries. EJB, Java EE, J2EE, and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only. THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README.TXT FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM. THIS DOCUMENT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME. THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES. Copyright 1999-2009 TIBCO Software Inc. ALL RIGHTS RESERVED. TIBCO Software Inc. Confidential Information
| iii
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii TIBCO ActiveMatrix Adapter for SAP Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii Other TIBCO Product Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii Third Party Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x Terminology and Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii How to Contact TIBCO Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Chapter 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Business Object Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Using TIBCO ActiveMatrix BusinessWorks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Working with dat files in TIBCO Designer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Creating a Database Table in the SAP System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Creating RFC Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Testing the Function Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Creating Outbound and Inbound Instances Using TIBCO Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Creating an Outbound Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Creating an Inbound Instance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Chapter 2 TIBCO ActiveMatrix BusinessWorks: Working with the Customer Business Object . 31
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploy and Run the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 33 34 37
Chapter 3 TIBCO ActiveMatrix BusinessWorks: Working with the SalesOrder Business Object 39
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 41 43 44
iv
| Contents
Chapter 4 TIBCO ActiveMatrix BusinessWorks: Working with the PurchaseOrder Business Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 49 51 52
Chapter 5 TIBCO ActiveMatrix BusinessWorks: Working with the Employee Business Object 55
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 57 59 60
Chapter 6 TIBCO ActiveMatrix BusinessWorks: Working with the ItemMaster Business Object 61
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 63 65 66
Chapter 9 TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Test the Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 85 87 88
Contents v
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
vi
| Contents
| vii
Preface
This guide includes examples that demonstrate how the adapter interacts with TIBCO ActiveMatrix BusinessWorks.
Topics
Related Documentation, page viii Terminology and Acronyms, page xii How to Contact TIBCO Customer Support, page xiv
viii
Preface
Related Documentation
This section lists documentation resources.
Related Documentation ix
Preface
Typographical Conventions
The following typographical conventions are used in this manual Table 1 General Typographical Conventions Convention
TIBCO_HOME ENV_HOME
Use Many TIBCO products must be installed within the same home directory. This directory is referenced in documentation as TIBCO_HOME. The value of TIBCO_HOME depends on the operating system. For example, on Windows systems, the default value is C:\tibco. Other TIBCO products are installed into an installation environment. Incompatible products and multiple instances of the same product are installed into different installation environments. The directory into which such products are installed is referenced in documentation as ENV_HOME. The value of ENV_HOME depends on the operating system. For example, on Windows systems the default value is C:\tibco.
code font
Code font identifies commands, code examples, filenames, pathnames, and output displayed in a command window. For example: Use MyCommand to start the foo process.
Bold code font is used in the following ways: In procedures, to indicate what a user types. For example: Type admin. In large code samples, to indicate the parts of the sample that are of particular interest. In command syntax, to indicate the default parameter for a command. For example, if no parameter is specified, MyCommand is enabled: MyCommand [enable | disable]
italic font
Italic font is used in the following ways: To indicate a document title. For example: See TIBCO BusinessWorks Concepts. To introduce new terms For example: A portal page may contain several portlets. Portlets are mini-applications that run in a portal. To indicate a variable in a command or code syntax that you must replace. For example: MyCommand pathname
Typographical Conventions xi
Table 1 General Typographical Conventions (Contd) Convention Key combinations Use Key name separated by a plus sign indicate keys pressed simultaneously. For example: Ctrl+C. Key names separated by a comma and space indicate keys pressed one after the other. For example: Esc, Ctrl+Q. The note icon indicates information that is of special interest or importance, for example, an additional action required only in certain circumstances. The tip icon indicates an idea that could be useful, for example, a way to apply the information provided in the current section to achieve a specific result. The warning icon indicates the potential for a damaging situation, for example, data loss or corruption if certain steps are taken or not taken.
xii
Preface
Term RV RFC RFC Client RVCM RFC Server RVDQ SAP Native data SSL TID TIDManager
Definition TIBCO Rendezvous protocol; also in certain contexts refers to reliable message quality of service, as opposed to certified message. The SAP Remote Function Call Interface. A SAP term for any program that can post RFCs/BAPIs/IDocs from an external system into the SAP system. TIBCO Rendezvous certified message quality of service. A SAP term for any external program that can accept and process RFCs/BAPIs/IDocs from the SAP system. TIBCO Rendezvous distributed queue. All SAP data that the adapter interacts with. It consists of RFC data types. This includes IDocs received as RFC tables in an RFC function call. Secure Sockets Layer. Transaction ID. A globally unique identifier used by transactional RFCs to ensure exactly-once execution of a transaction. Transaction Identifier Manager.
xiv
Preface
|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
| Chapter 1
Introduction
Overview
The examples discussed in this guide demonstrate how TIBCO ActiveMatrix Adapter for SAP interacts with TIBCO ActiveMatrix BusinessWorks. Simple publish-subscribe or request-response scenarios are used to demonstrate the different interactions.
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.
Overview 3
BAPI_CUSTOMER_G ETDETAIL1
TIBCO Environment
Insert - In this operation, TIBCO ActiveMatrix BusinessWorks sends data to the SAP System to create a record. The Request-Response adapter service is used to send a record and get a response from the SAP system. The record details are read from an XML file. The corresponding BAPI is executed on the SAP server and the result is given back to TIBCO ActiveMatrix BusinessWorks. The results are then written to an XML file. A diagrammatic representation of the Insert operation is given next:
TIBCO ActiveMatrix BusinessWorks Request to create Sales order Sales order number TIBCO Environment
Sync - In this operation, the SAP System sends (publishes) data, which is received by TIBCO ActiveMatrix BusinessWorks. The Publication service in the adapter is used to send records from the SAP system in the form of IDocs. The data is received by TIBCO ActiveMatrix BusinessWorks and written to an XML file. A diagrammatic representation of the Sync operation is given next.
TIBCO ActiveMatrix Adapter for SAP Examples
| Chapter 1
Introduction
XML file
TIBCO Environment
Customer This example demonstrates the Get, Create and Sync operations on the Business Object. Pre-configured TIBCO ActiveMatrix BusinessWorks processes are available with the adapter installation to perform these operations. A brief description of these processes is given next.
Customer
process fetches customer details from the SAP system and writes them to a database table. You can write the data in an XML file by making a small modification in the XML file as explained later in the guide. The Customer Number is read from an XML file containing query details.
Get_Customer
creates a new customer in the SAP system. Customer details are read from an XML file.
Create_Customer Sync_Customer
publishes an IDoc, out of the SAP system whenever a new customer is created. TIBCO ActiveMatrix BusinessWorks receives details of this customer and includes them in an XML file.
SalesOrder This example demonstrates the Get, Create and Sync operations on the SalesOrder Business Object. Pre-configured TIBCO ActiveMatrix BusinessWorks processes are available with the adapter installation to perform these operations. A brief description of these processes is given next.
Get_SalesOrder
fetches Sales Orders from the SAP system and writes them in an XML file. The CustomerNumber, Material, SalesOrganization
Overview 5
parameters are read from another XML file. Sales Orders based on these parameters are retrieved from the SAP system. creates a Sales Order in the SAP system and writes the details of the operation in an XML file. The data that needs to be passed to create an order in the SAP system is read from another XML file.
Create_SalesOrder
publishes an IDoc, out of the SAP system whenever a new SalesOrder is created. TIBCO ActiveMatrix BusinessWorks receives details of this SalesOrder, and includes them in an XML file.
Sync_SalesOrder
PurchaseOrder This example demonstrates the Get and Sync operations on the PurchaseOrder Business Object. Pre-configured TIBCO ActiveMatrix BusinessWorks processes are available with the adapter installation to perform these operations. A brief description of these processes is given next. fetches Purchase Order details from the SAP system and writes them in an XML File. The Purchase Order Number is read from another XML file.
Get_PurchaseOrder
publishes an IDoc, out of the SAP system whenever a new Purchase Order is created or changed. TIBCO ActiveMatrix BusinessWorks receives details of this Purchase Order, and writes them in an XML file.
Sync_PurchaseOrder
Employee This example demonstrates the Get operation on the Employee Business Object. A pre-configured TIBCO ActiveMatrix BusinessWorks process is available with your adapter installation. A brief description of the process is given next. gets Employee details from the SAP system, based on parameters stored in an XML file. These details are then written into another XML file.
Get_Employee
ItemMaster This example demonstrates the Get and Sync operations on the ItemMaster Business Object. Pre-configured TIBCO ActiveMatrix BusinessWorks processes are available with the adapter installation to perform these operations. A brief description of these processes is given next. Fetches Material details from the SAP system and writes these to an XML file.
Get_ItemMaster
Whenever a Material record is created or changed in the SAP system, an IDoc is published. On reception of the notification, TIBCO
Sync_ItemMaster
| Chapter 1
Introduction
ActiveMatrix BusinessWorks triggers the SyncItemMaster process. This reads the published message and writes the Material details in an XML file.
Prerequisites 7
Prerequisites
To try out the examples, you must first set up a custom integration scenario in your SAP system. Carry out the following steps to set up the integration scenario: 1. Create a database table in the SAP system. See Creating a Database Table in the SAP System on page 10 for details. 2. Create function modules (BAPIs) to add, delete and modify entries. See Creating RFC Functions on page 15 for details. 3. Configure outbound adapters. See Creating an Outbound Instance on page 24 for details. 4. Configure inbound adapters. See Creating an Inbound Instance on page 27 for details.
Refer to the TIBCO ActiveMatrix Adapter for SAP readme.txt for the supported versions of the software listed above. The TIBCO ActiveMatrix BusinessWorks examples use TIBCO Designer to create an Enterprise Archive File (EAR) and TIBCO Administrator to deploy the EAR file. In TIBCO Administrator, make sure all software components needed by the adapter instance are installed on one or more machines that are part of a TIBCO Administration Domain and that the software is registered in the domain. Use the TIBCO Domain Utility to add a machine to a TIBCO Administration Domain. In TIBCO Administrator, use the Resource to register software.
Management > Machines
console
| Chapter 1
Introduction
Location
The files for the examples are in the following location:
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\<Busi nessObjectName>,
where <version_number> is the adapter version number. Make sure the resources in the examples point to the correct location.
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.
10
| Chapter 1
Introduction
3. Select the Datatype radio button and type ZMRM_STR in the associated text field. 4. Click the Create icon.
5. Select the Structure radio button in the Create Type ZMRM_STR pop up and click the icon.
6. Enter the values NAME and GRP in the Component column. 7. Enter the values CHAR30 and CHAR25 in the Component type column for the values NAME and GRP. 8. To save the structure click Save. The following screen is displayed.
9. Click Local object to save the ZMRM_STR structure. This will take you back to the previous screen. 10. Click Structure and then click Activate to make this structure available.
TIBCO ActiveMatrix Adapter for SAP Examples
12
| Chapter 1
Introduction
11. Click Back to return to the Dictionary Objects browser as shown next.
12. Select the Database table radio button and enter the name of the table as ZMRM_TABLE. 13. Click the Create icon to create the table.
14. Enter a short description for the object in the Short Description field, select C in the Delivery class field and select Display/Maintenance Allowed in the Data Browser/Table View Maint. field.
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.
14
| Chapter 1
Introduction
21. Select USER in the Data class field, select 0 in the Size Category field and select the Buffering not allowed radio button in the Buffering section. Save your settings. 22. Select Back to return to the previous screen. 23. Select Table>Activate to activate the table.
3. Enter ZNEW in the Function group field and a short description of the Function group in the Short Text field.
16
| Chapter 1
Introduction
5. Click Local object to save the ZMRM_STR structure. This will take you back to the Function Builder initial screen.
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.
18
| Chapter 1
Introduction
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.
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.
20
| Chapter 1
Introduction
19. Click the Export tab. Enter the Export parameter in the first column. Enter the corresponding Reference Field/Structure. The following screen shows the export parameters.
20. Click the Tables tab. Enter the Table parameter in the first column. Enter the corresponding Reference Structure. The following screen shows the Table parameters.
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.
22
| Chapter 1
Introduction
3. Enter the values SOCNUM and REFSTR in the Import parameters column.
5. If you try to add the same employee details twice, the following exception is displayed:
24
| Chapter 1
Introduction
4. Specify values in the fields. Click Test Connection to test the connection. 5. Next, click the projects Adapter Services folder. The R/3 Filters tab is displayed. Selecting Schema 1. Click Fetch RFC/BAPIs. The progress bar is displayed, indicating that information is being downloaded from the SAP system. Specify the following in the RFC/BAPI tab: In the Name column, select the Z-ADDEMPINFO function from the appropriate group in the list. This is the function that you created earlier to add employee information. Select the Used checkbox and click Apply. A service for the RFC is created automatically. The RFC/BAPI appears in the design panel. Selecting a Service 1. Select the adapter service, associate it with the corresponding schema, and specify information in the Configuration and Advanced tabs. Click Apply to create an outbound service. In the Configuration tab, default values are displayed. 2. In the Advanced tab, specify a Subject. This subject name should be the same as in the inbound instance. 3. Associate the service with the corresponding schema. Select the RFC/ABAP functions (Z_GETEMPINFO,Z_DELEMPINFO) created earlier in the Request-Response mode. See Creating RFC Functions on page 15 for details on creating these functions. 4. Next, click R3Adapterconfiguration in the project folder. In the Configuration tab, enable Show All Tabs. The Adapter Services tab is displayed. 5. In the Adapter Services tab, set the TID Management field to Remote. This ensures that all the transactional RFC calls occur only once. For details on TID
26
| Chapter 1
Introduction
field.
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
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.
12. In the RFC Trace field, indicate whether the trace is on or off. Possible values are 0 and 1 only. 0 is the default value. You need not change the default settings. 0 denotes the trace is OFF. 1 denotes the trace is ON. 13. Click Apply. Running the example Use the properties file to run the outbound adapter instance.
tibco.repourl TIBCO_HOME\adapter\adr3\<version_number>\examples\repository\R3Ada pterExamples_Instance.dat tibco.configurl \tibco\private\adapter\SAPAdapter40\R3AdapterConfiguration
28
| Chapter 1
Introduction
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.
11. In the Advanced tab, specify the Subject. The subject name specified in this instance should be the same as in the outbound instance.
Ensure that the subject name in both Inbound instance and Outbound instance match for all three RFC functions. This allows the outbound adapter to communicate with the inbound adapter. 12. In the Configuration tab, select Inbound in the R/3 13. Configure the inbound instance using the Run-time
Connection Inbound
field.
tab.
30
| Chapter 1
Introduction
14. Settings used in the Design-time Connection tab are populated by default in the Run-time Inbound tab. You can test the connection by clicking Test Connection. 15. Click Apply. Running the example Use the properties file to run the inbound adapter instance.
tibco.repourl TIBCO_HOME\adapter\adr3\<version_number>\examples\repository\R3Ada pterExamples_Instance.dat tibco.configurl \tibco\private\adapter\SAPAdapter40\R3AdapterConfiguration
| 31
Chapter 2
This example shows how to use several adapter services within a TIBCO ActiveMatrix BusinessWorks process to create, get and synchronize Customer details stored in SAP. The example is deployed and run using the TIBCO Administrator GUI. All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\Customer
Topics
Example Description, page 32 Setup the Example, page 33 Deploy and Run the Example, page 34 Expected Results, page 37
32
| Chapter 2
Example Description
This example illustrates how the adapters Subscription and Request-Response services can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has three processes, Create_Customer, Get_Customer and Sync_Customer.
Create_Customer
uses the input XML file (containing details about the customer to be created) to invoke the Request-Response service and creates a customer in SAP. It returns a customer number for the customer record created in the SAP system.
Get_Customer uses the adapters Request-Response Service to fetch data from SAP for a particular customer. The data is fetched based on the customer number specified in the input XML file and is written into an output XML file. Sync_Customer
uses the adapters Subscription service to subscribe to update or modification messages from SAP whenever Customer details are modified or updated in the SAP system. On receiving the Customer details, TIBCO ActiveWorks BusinessWorks writes the IDoc to an XML file.
For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.
4. Save the project as a multi-file project by the name Customer. 5. Select Customer in the project panel. 6. For Create_Customer and Get_Customer processes, click the File Poller icon. In the configuration panel, File Name field, click Browse and select the corresponding input XML file from the path given in step 3. Click Apply. Any change to the input XML file starts the process. 7. Select the Enterprise Archive Object, Customer. Click Build Archive in the Configuration tab. This creates an archive file. For more information on creating an EAR file, see TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment. 8. Exit TIBCO Designer.
34
| Chapter 2
<CustomerCreateFromData1> <CopyReference> <SALESORG>3000</SALESORG> <DISTR_CHAN>10</DISTR_CHAN> <DIVISION>01</DIVISION> <REF_CUSTMR>0000003000</REF_CUSTMR> </CopyReference> <OptionalPersonalData> <TRANSPZONE></TRANSPZONE> <CONTROL_ACCOUNT></CONTROL_ACCOUNT> <PMNTTRMS></PMNTTRMS> <SHIP_COND></SHIP_COND> <DELYG_PLNT></DELYG_PLNT> <PART_DLV></PART_DLV> <C_CTR_AREA></C_CTR_AREA> <TAXJURCODE></TAXJURCODE> </OptionalPersonalData> <PersonalData> <TITLE_P></TITLE_P> <FIRSTNAME>Jigar</FIRSTNAME> <LASTNAME>Kadakia</LASTNAME> <MIDDLENAME></MIDDLENAME> <SECONDNAME></SECONDNAME> <DATE_BIRTH>03031978</DATE_BIRTH> <CITY>bangalore</CITY> <DISTRICT></DISTRICT> <POSTL_COD1>123456</POSTL_COD1> <POSTL_COD2>123456</POSTL_COD2> <PO_BOX>334458</PO_BOX> <PO_BOX_CIT>122230</PO_BOX_CIT> <STREET>123 ABC</STREET> <HOUSE_NO></HOUSE_NO> <BUILDING></BUILDING> <FLOOR></FLOOR> <ROOM_NO></ROOM_NO> <COUNTRY>IN</COUNTRY> <COUNTRYISO>IN</COUNTRYISO> <REGION></REGION> <TEL1_NUMBR>1111</TEL1_NUMBR> <TEL1_EXT></TEL1_EXT> <FAX_NUMBER>1111</FAX_NUMBER> <FAX_EXTENS></FAX_EXTENS> <E_MAIL>prasad_joshi@infy.com</E_MAIL> <LANGU_P>E</LANGU_P> <LANGUP_ISO>EN</LANGUP_ISO> <CURRENCY>INR</CURRENCY> <CURRENCY_ISO>INR</CURRENCY_ISO> <TITLE_KEY></TITLE_KEY> <ONLY_CHANGE_COMADDRESS></ONLY_CHANGE_COMADDRESS> </PersonalData> </CustomerCreateFromData1>
The process with the help of the XML parser and the mapper constructs the data required for the adapter Request-Response service. The Invoke task triggers the Request-Response service. The Request-Response service executes the BAPI_CREATE_CUSTOMERFROMDATA1, which creates a customer in the SAP
TIBCO ActiveMatrix Adapter for SAP Examples
36
| Chapter 2
system.using the details given in the above XML file. The Request-Response service then sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders it into an XML form and writes that to BAPI_CREATE_CUSTOMERFROMDATA1.xml file. 2. To trigger Get_Customer, you must make a change in the Get_Customer_Send_Template.xml input file. In the example given below the Customer number is changed:
<?xml version="1.0" encoding="utf-8"?> <CustomerGetDetail1 CustomerNo="5068609616"> <DistributionChannel></DistributionChannel> <Division></Division> <SalesOrganiation></SalesOrganiation> </CustomerGetDetail1>
TIBCO ActiveWorks BusinessWorks maps the data to the schema using a parser and mapper, and then passes the data to an invoke task. The Invoke task sends a request to the adapter Request-Response service. The Request-Response service fetches customer details from SAP using bapi_customer_getdetail and sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders the data into an XML format and writes that to an output bapi_customer_getdetail.xml file. 3. When a Debmas IDoc is sent from SAP, the Sync_Customer process is triggered. For example: When a Debmas IDoc is sent from SAP, the Subscription service activity in the TIBCO ActiveMatrix BusinessWorks process is triggered. The received IDoc is then rendered into an XML and written to an output debmas.xml file.
Expected Results 37
Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\Customer
Create_Customer -
Data is created based on the customer details specified in the input XML file and a customer is created in the SAP system. An XML file, bapi_create_customerfromdata1.xml (containing the customer number of the customer created in the SAP system.) is created. In case of error, bapi_create_customerfromdata1_error.txt is created.
Get_Customer - Data is fetched based on the customer number specified in the input XML file. The customer details are fetched and written into the bapi_customer_getdetail.xml file. In case of error, bapi_customer_getdetail_error.txt is created. Sample of the bapi_customer_getdetail.xml file is given next.
<?xml version="1.0" encoding="UTF-8"?> <ns0:Customer.GetDetail1.Response xmlns:ns0="urn:sap-com:document:sap:business" CustomerNo="5068609617"> <PersonalData> <FIRSTNAME>Jigar Kadakia</FIRSTNAME> <STREET>123 ABC</STREET> <HOUSE_NO>123456</HOUSE_NO> <FAX_NUMBER>1111</FAX_NUMBER> </PersonalData> </ns0:Customer.GetDetail1.Response>
Sync_Customer
- Output (IDoc DEBMAS) is stored in the debmas.xml file. Sample of the debmas.xml is given next.
<?xml version="1.0" encoding="US-ASCII"?> <DEBMAS01> <IDOC> <E1KNA1M> <MSGFN>005</MSGFN> <KUNNR>0000000100</KUNNR> <ANRED>Firma</ANRED> <KUKLA/> <LAND1>DE</LAND1> <NAME1>OEM Meyer</NAME1> <NAME2/> <ORT01>Dsseldorf</ORT01> <ORT02/> <PFACH/> <REGIO>05</REGIO> <COUNC/> <CITYC/> </E1KNA1M> </IDOC> </DEBMAS01>
38
| Chapter 2
| 39
Chapter 3
This example shows how to use several adapter services within a TIBCO ActiveMatrix BusinessWorks process to create and get SalesOrder details in the SAP system All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWorks
\SalesOrder
This example uses Java Messaging Service (JMS) as its transport type.
Topics
Example Description, page 40 Setup the Example, page 41 Test the Example, page 43 Expected Results, page 44
40
| Chapter 3
Example Description
This example shows how the adapters Request-Response service can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has two processes, Create_SalesOrder and Get_SalesOrder.
Create_SalesOrder uses the adapters Request-Response service to create a SalesOrder record in the SAP system. Create_SalesOrder
uses the input XML file (containing details about the sales order to be created) to invoke the Request-Response service and creates a sales order in the SAP system. It returns the sales order number for the sales order created in the SAP system. Any update in the input file triggers the Create_SalesOrder process. The process with the help of the XML parser and the mapper constructs the data required for the adapter Request-Response service. The Invoke task triggers the Request-Response service. The Request-Response service executes the bapi_salesorder_createfromdata1, which creates a sales order in SAP. The Request-Response service then sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders it into an XML form and writes that to a file.
uses the adapters Request-Response service to fetch data from SAP for a particular sales order. The data is fetched based on the Customer number, Type of Material and Sales Organization that you specify in the input XML file. The data is sent back by the adapter to TIBCO ActiveMatrix BusinessWorks and is written into an output XML file.
Get_SalesOrder
Any update in the input file triggers the Get_SalesOrder process. TIBCO ActiveWorks BusinessWorks maps the data to the schema using a parser and mapper, and then passes the data to an invoke task. Invoke task sends request to the adapter Request-Response service. The Request-Response service fetches sales order details from SAP using bapi_salesorder_getlist and sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders the data into an XML format and writes that to an output file. For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.
4. Save the project as a multi-file project by the name SalesOrder. 5. Select the SalesOrder process. 6. Click the File Poller icon. In the configuration panel, File Name field, click Browse and select the corresponding input XML file from the path given in step 3. Click Apply. 7. Check the checkbox for Include Existing Files. 8. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService JMSProviderUrl Password ProgramID SystemNumber TIBCO_HOME (Home directory of the TIBCO installation) UserName 9. Test the connection to ensure connectivity. 10. Validate the project to ensure there are no errors.
TIBCO ActiveMatrix Adapter for SAP Examples
42
| Chapter 3
11. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 12. Modify the repourl and configurl parameters in adr3.tra under
<install-path>\tibco\adapter\adr3\<version_number>\bin
folder to point to the dat file. 13. Run the adapter from the command line
adr3--propFile
<adapter_home>\bin\adr3.tra
14. Exit TIBCO Designer. Task B Start EMS Server This example uses JMS as the transport type. Ensure that the TIBCO Enterprise Message Service server is running and accessible to the machine on which the adapter is installed before running any of the processes.
44
| Chapter 3
Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\Salesorder
1.
The results are directly reflected in the SAP system. The data is created based on the sales order details specified in the input XML file and a sales order is created in the SAP system. An XML file, bapi_salesorder_createfromdata1.xml (containing the Sales Order number of the sales order created in the SAP system.) is created. In case of error, bapi_salesorder_createfromdata1_error.txt is created. Sample of the bapi_salesorder_createfromdata1.xml is shown next.
Create_SalesOrder
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <SalesOrder.CreateFromDat1.Response xmlns = "urn:sap-com:document:sap:business" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" SalesDocument = "0000011260"> <BillingParty> <PAYER>0000003050</PAYER> <NAME>Bush Holdings, Inc.</NAME> <STREET>1 1 408 Michigan Avenue</STREET> <POSTL_CODE>60611</POSTL_CODE> <CITY>CHICAGO</CITY> <LANGU>E</LANGU> <COUNTRY>US</COUNTRY> <C_CTR_AREA>3000</C_CTR_AREA> <CRED_ACCNT>0000003050</CRED_ACCNT> <CRED_LIMIT>1000</CRED_LIMIT> <ORDER_VALS>0</ORDER_VALS> <RCVBL_VALS>0</RCVBL_VALS> <CRED_LIAB>0</CRED_LIAB> <CURRENCY>USD</CURRENCY> <VAL_LIMIT>0</VAL_LIMIT> <PMNTTRMS>NT30</PMNTTRMS> <ADD_VAL_DY>00</ADD_VAL_DY> <FIX_VAL_DY>00000000</FIX_VAL_DY> <REBATE_FRM>19650921</REBATE_FRM> </BillingParty> <ShipToParty> <SHIP_TO>0000003000</SHIP_TO> <NAME>Thomas Bush Inc.</NAME> <STREET>1 1 2800 South 25th Ave</STREET> <POSTL_CODE>60153</POSTL_CODE> <CITY>MAYWOOD</CITY> <LANGU>E</LANGU> <DEST_CNTRY>US</DEST_CNTRY> <TRNSP_ZONE>0000000003</TRNSP_ZONE> <TELEPHONE>(312)450-BUSH</TELEPHONE> <UNLOAD_PT>Dock 1</UNLOAD_PT> <FAC_CALEND>01</FAC_CALEND> <RECV_HOURS>001</RECV_HOURS>
Expected Results 45
<MO_AM_FROM>090000</MO_AM_FROM> <MO_AM_UNTL>124500</MO_AM_UNTL> <MO_PM_FROM>130000</MO_PM_FROM> <MO_PM_UNTL>170000</MO_PM_UNTL> <TU_AM_FROM>083000</TU_AM_FROM> <TU_AM_UNTL>120000</TU_AM_UNTL> <TU_PM_FROM>130000</TU_PM_FROM> <TU_PM_UNTL>170000</TU_PM_UNTL> <WE_AM_FROM>083000</WE_AM_FROM> <WR_AM_UNTL>120000</WR_AM_UNTL> <WE_PM_FROM>130000</WE_PM_FROM> <WE_PM_UNTL>150000</WE_PM_UNTL> <TH_AM_FROM>083000</TH_AM_FROM> <TH_AM_UNTL>120000</TH_AM_UNTL> <TH_PM_FROM>130000</TH_PM_FROM> <TH_PM_UNTL>170000</TH_PM_UNTL> <FR_AM_FROM>080000</FR_AM_FROM> <FR_AM_UNTL>120000</FR_AM_UNTL> <FR_PM_FROM>130000</FR_PM_FROM> <FR_PM_UNTL>140000</FR_PM_UNTL> <REGION>IL</REGION> <TAXJURCODE>1403118101</TAXJURCODE> <SHIP_COND>02</SHIP_COND> <ACCNT_GRP>0001</ACCNT_GRP> </ShipToParty> <SoldToParty> <SOLD_TO>0000003000</SOLD_TO> <NAME>Thomas Bush Inc.</NAME> <STREET>1 1 2800 South 25th Ave</STREET> <POSTL_CODE>60153</POSTL_CODE> <CITY>MAYWOOD</CITY> <LANGU>E</LANGU> <COUNTRY>US</COUNTRY> <TELEPHONE>(312)450-BUSH</TELEPHONE> <STAT_GROUP>1</STAT_GROUP> <PRC_PROCED>1</PRC_PROCED> <CUST_GROUP>02</CUST_GROUP> <SALES_DIST>US0015</SALES_DIST> <PRICE_LIST>03</PRICE_LIST> <INCOTERMS1>CIF</INCOTERMS1> <INCOTERMS2>Chicago</INCOTERMS2> <MAX_PL_DLV>9</MAX_PL_DLV> <ORDER_COMB>X</ORDER_COMB> <DLV_PRIO>02</DLV_PRIO> <CURRENCY>USD</CURRENCY> <SHIP_COND>02</SHIP_COND> <ORDER_PROB>100</ORDER_PROB> <SALES_OFF>3010</SALES_OFF> <SALES_GRP>311</SALES_GRP> </SoldToParty> </SalesOrder.CreateFromDat1.Response>
2.
The data is fetched based on the sales order Customer and Sales Organization specified in the input XML file. The sales order details are fetched and written into bapi_salesorder_getlist.xml file. In case of error,
Get_SalesOrder number, Type of Material
46
| Chapter 3
bapi_salesorder_getlist_error.txt bapi_salesorder_getlist.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <SalesOrder.GetList.Response xmlns = "urn:sap-com:document:sap:business" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"> <SalesOrders> <item> <SD_DOC>0000006369</SD_DOC> <ITM_NUMBER>000010</ITM_NUMBER> <MATERIAL>100-100</MATERIAL> <DOC_TYPE>TA</DOC_TYPE> <DOC_DATE>20011009</DOC_DATE> <REQ_QTY>10</REQ_QTY> <REQ_DATE>20011009</REQ_DATE> <PURCH_NO>acbootsph987654321</PURCH_NO> <BATCH></BATCH> <VALID_FROM>00000000</VALID_FROM> <VALID_TO>99999999</VALID_TO> <SOLD_TO>0000450505</SOLD_TO> <NAME>ac boots us customer</NAME> <NET_PRICE>11.11</NET_PRICE> <SALES_UNIT>ST</SALES_UNIT> </item> <item> <SD_DOC>0000006369</SD_DOC> <ITM_NUMBER>000010</ITM_NUMBER> <MATERIAL>100-100</MATERIAL> <DOC_TYPE>TA</DOC_TYPE> <DOC_DATE>20011009</DOC_DATE> <REQ_QTY>10</REQ_QTY> <REQ_DATE>20011026</REQ_DATE> <PURCH_NO>acbootsph987654321</PURCH_NO> <BATCH></BATCH> <VALID_FROM>00000000</VALID_FROM> <VALID_TO>99999999</VALID_TO> <SOLD_TO>0000450505</SOLD_TO> <NAME>ac boots us customer</NAME> <NET_PRICE>11.11</NET_PRICE> <SALES_UNIT>ST</SALES_UNIT> </item> </SalesOrders> </SalesOrder.GetList.Response>
| 47
Chapter 4
This example shows how to use several adapter services within a TIBCO ActiveMatrix BusinessWorks process to get and synchronize a Purchase Order stored in the SAP system. All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\PurchaseOrder
This example uses Java Messaging Service (JMS) as its transport type.
Topics
Example Description, page 48 Setup the Example, page 49 Test the Example, page 51 Expected Results, page 52
48
| Chapter 4
Example Description
This example shows how the adapters Subscription and Request-Response services can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has two processes, Get_PurchaseOrder and Sync_PurchaseOrder. uses the adapters Request-Response Service to fetch data from SAP for a particular purchase order. The data is fetched based on the Purchase Order number you specify in the input XML file. The data is sent back by the adapter to TIBCO ActiveMatrix BusinessWorks and is written into an output XML file.
Get_PurchaseOrder
Any update in the input file triggers the Get_PurchaseOrder process. TIBCO ActiveWorks BusinessWorks maps the data to the schema using a parser and mapper, and then passes the data to an invoke task. The Invoke task sends a request to the adapter Request-Response service. The Request-Response service fetches purchase order details from SAP using bapi_po_getdetail and sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders the data into an XML format and writes that to an output file. subscribes to update or modification messages from SAP whenever Purchase order details are modified or updated in the SAP system. On receiving the Purchase order details, TIBCO ActiveWorks BusinessWorks writes the IDoc to an XML file.
Sync_PurchaseOrder
For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.
50
| Chapter 4
10. Validate the project to ensure there are no errors. 11. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 12. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 13. Run the adapter from the command line
adr3--propFile
<adapter_home>\bin\adr3.tra
14. Exit TIBCO Designer. Task B Start EMS Server This example uses JMS as the transport type. Ensure that the TIBCO Enterprise Message Service server is running and accessible to the machine on which the adapter is installed before running any of the processes.
52
| Chapter 4
Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\PurchaseOrder
Get_PurchaseOrder
The data is fetched based on the purchase order number specified in the input XML file. The purchase order details are fetched and written into bapi_po_getdetail.xml file. In case of error, bapi_po_getdetail_error.txt is created. Sample of the bapi_po_getdetail.xml file is shown next.
<?xml version="1.0" encoding="US-ASCII"?> <ns0:PurchaseOrder.GetDetail.Response xmlns:ns0="urn:sap-com:document:sap:business" PurchaseOrder="4500000140"> <PoAddress> <ADDRNUMBER>0000006945</ADDRNUMBER> <ADDRHANDLE/> <NATION/> <DATE>00010101</DATE> <DATE_FROM/> <DATE_TO/> <TITLE/> <NAME1>Electronic Components Distributor</NAME1> <NAME2/> <NAME3/> <NAME4/> <NAME_TXT/> <NAME_CO/> <CITY1>Foster City</CITY1> <CITY2/> <CITY_CODE/> <CITYP_CODE/> <CHCKSTATUS/> <POST_CODE1/> <POST_CODE2/> <POST_CODE3/> <PO_BOX/> <PO_BOX_NUM/> <PO_BOX_LOC/> <CITY_CODE2/> <PO_BOX_REG/> <PO_BOX_CTY/> <POSTALAREA/> <TRANSPZONE/> <STREET>Tower Lane 1082</STREET>
Sync_PurchaseOrder The IDoc DEBMAS is stored in Orders01.xml file. Sample of the Orders01.xml file is given next.
Expected Results 53
<ORDERS01> <IDOC> <EDI_DC40> <TABNAM>EDI_DC40</TABNAM> <MANDT>800</MANDT> <DOCNUM>0000000001133323</DOCNUM> <DOCREL>45B</DOCREL> <STATUS>30</STATUS> <DIRECT>1</DIRECT> <OUTMOD>2</OUTMOD> <EXPRSS/> <TEST/> <IDOCTYP>ORDERS01</IDOCTYP> <CIMTYP/> <MESTYP>ORDERS</MESTYP> <MESCOD/> <MESFCT/> <STD/> <STDVRS/> <STDMES/> <SNDPOR>SAPIDS</SNDPOR> <SNDPRT>LS</SNDPRT> <SNDPFC/> <SNDPRN>ID3CLNT800</SNDPRN> <SNDSAD/> <SNDLAD/> <RCVPOR>A000000035</RCVPOR> <RCVPRT>LS</RCVPRT> <RCVPFC>LS</RCVPFC> <RCVPRN>LSCHANDRA</RCVPRN> <RCVSAD/> <RCVLAD/> <CREDAT>20030916</CREDAT> <CRETIM>102843</CRETIM> <REFINT/> <REFGRP/> <REFMES/> <ARCKEY/> <SERIAL>20030203171009</SERIAL> </EDI_DC40>
54
| Chapter 4
| 55
Chapter 5
This example shows how to use the adapters Request-Response service within a TIBCO ActiveMatrix BusinessWorks process to get an Employee record stored in the SAP system. All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\Employee
Topics
Example Description, page 56 Setup the Example, page 57 Test the Example, page 59 Expected Results, page 60
56
| Chapter 5
Example Description
This example shows how the adapters Request-Response service can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has one process, Get_Employee.
Get_Employee uses the adapters Request-Response Service to fetch data from SAP for a particular employee. The data is fetched based on the Employee number you specify in the input XML file. The data is sent back by the adapter to TIBCO ActiveMatrix BusinessWorks and is written into an output XML file.
Any update in the input file triggers the Get_Employee process. TIBCO ActiveWorks BusinessWorks maps the data to the schema using a parser and mapper, and then passes the data to an invoke task. The Invoke task sends a request to the adapter Request-Response service. The Request-Response service fetches employee details from SAP using bapi_employee_getdata and sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders the data into an XML format and writes that to an output file. For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.
58
| Chapter 5
Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 12. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 13. Run the adapter from the command line
adr3--propFile
<adapter_home>\bin\adr3.tra
60
| Chapter 5
Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\Employee
The data is fetched based on the Employee number specified in the input XML file. The employee details are fetched and written into bapi_employee_getdata.xml file. In case of error, bapi_employee_getdata_error.txt is created. Sample of the bapi_employee_getdata.xml is given next.
Get_Employee
<?xml version="1.0" encoding="UTF-8"?> <ns0:Employee.GetList.Response xmlns:ns0="urn:sap-com:document:sap:business"> <Archivelink> <item/> </Archivelink> <Communication> <item/> </Communication> <InternalControl> <item/> </InternalControl> <OrgAssignment> <item/> </OrgAssignment> <PersonalData> <item/> </PersonalData> <Return> <TYPE/> <ID/> <NUMBER/> <MESSAGE/> <LOG_NO/> <LOG_MSG_NO/> <MESSAGE_V1/> <MESSAGE_V2/> <MESSAGE_V3/> <MESSAGE_V4/> <PARAMETER/> <ROW/> <FIELD/> <SYSTEM/> </Return> </ns0:Employee.GetList.Response>
| 61
Chapter 6
This example shows how to use the adapters Request-Response service within a TIBCO ActiveMatrix BusinessWorks process to get and synchronize material details stored in the SAP system. All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\ItemMaster
Topics
Example Description, page 62 Setup the Example, page 63 Test the Example, page 65 Expected Results, page 66
62
| Chapter 6
Example Description
This example shows how the adapters Subscription and Request-Response services can be used in a TIBCO ActiveMatrix BusinessWorks process. The example has two processes, Get_ItemMaster and Sync_ItemMaster. uses Request-Response Service to fetch details from SAP for a particular material. The data is fetched based on the Material number specified in the input XML file. The data is sent back by the adapter to TIBCO ActiveMatrix BusinessWorks and is written into an output XML file.
Get_ItemMaster
Any update in the input file triggers the Get_ItemMaster process. TIBCO ActiveWorks BusinessWorks maps the data to the schema using a parser and mapper, and then passes the data to an invoke task. The Invoke task sends a request to the adapter Request-Response service. The Request-Response service fetches material details from SAP using bapi_material_get_detail and sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, renders the data into an XML format and writes that to an output file. subscribes to update or modification messages from SAP whenever Material details are modified or updated in the SAP system. On receiving the Material details, TIBCO ActiveWorks BusinessWorks writes the IDoc to an XML file.
Sync_ItemMaster
For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.
64
| Chapter 6
Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 12. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 13. Run the adapter from the command line
adr3--propFile
<adapter_home>\bin\adr3.tra
66
| Chapter 6
Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\ItemMaster
Get_ItemMaster
The data is fetched based on the Material number specified in the input XML file. The material details are fetched and written into bapi_material_get_detail.xml file. In case of error, bapi_material_get_detail_error.txt is created. Sample of the bapi_material_get_detail.xml is given next.
<?xml version="1.0" encoding="US-ASCII"?> <ns0:Material.GetDetail.Response xmlns:ns0="urn:sap-com:document:sap:business" Material="100-100"> <MaterialGeneralData> <MATL_DESC>Cast iron spiral casing</MATL_DESC> <OLD_MAT_NO/> <MATL_TYPE>HALB</MATL_TYPE> <IND_SECTOR>M</IND_SECTOR> <DIVISION>01</DIVISION> <MATL_GROUP>001</MATL_GROUP> <PROD_HIER>001000010500000115</PROD_HIER> <BASIC_MATL>GG-25</BASIC_MATL> <STD_DESCR/> <LAB_DESIGN/> <PROD_MEMO/> <PAGEFORMAT/> <CONTAINER/> <STOR_CONDS/> <TEMP_CONDS/> <BASE_UOM>ST</BASE_UOM> <EAN_UPC/> <EAN_CAT/> <SIZE_DIM/> <GROSS_WT>3.0</GROSS_WT> <NET_WEIGHT>3.0</NET_WEIGHT> <UNIT_OF_WT>KG</UNIT_OF_WT> <VOLUME>0.0</VOLUME> <VOLUMEUNIT/> <LENGTH>0.0</LENGTH> <WIDTH>0.0</WIDTH> <HEIGHT>0.0</HEIGHT> <UNIT_DIM/> <MANU_MAT/> <MFR_NO/> <BASE_UOM_ISO>ST</BASE_UOM_ISO> <UNIT_OF_WT_ISO>KGM</UNIT_OF_WT_ISO> <VOLUMEUNIT_ISO/> <UNIT_DIM_ISO/> <CREATED_ON>19941107</CREATED_ON> <CREATED_BY>BALLER</CREATED_BY>
Expected Results 67
<LAST_CHNGE>20030217</LAST_CHNGE> <CHANGED_BY>ABAPTRG1</CHANGED_BY> </MaterialGeneralData> <Return> <TYPE>S</TYPE> <ID/> <NUMBER/> <MESSAGE/> <LOG_NO/> <LOG_MSG_NO>000000</LOG_MSG_NO> <MESSAGE_V1/> <MESSAGE_V2/> <MESSAGE_V3/> <MESSAGE_V4/> <PARAMETER/> <ROW/> <FIELD/> <SYSTEM/> </Return> </ns0:Material.GetDetail.Response>
The IDoc MATMAS is stored in matmas.xml file. Sample of the matmas.xml is given next.
Sync_ItemMaster
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <MATMAS01> <IDOC> <EDI_DC40> <TABNAM>EDI_DC40</TABNAM> <MANDT>800</MANDT> <DOCNUM>0000000001133324</DOCNUM> <DOCREL>45B</DOCREL> <STATUS>30</STATUS> <DIRECT>1</DIRECT> <OUTMOD>2</OUTMOD> <EXPRSS></EXPRSS> <TEST></TEST> <IDOCTYP>MATMAS01</IDOCTYP> </EDI_DC40> <E1MARAM> <MSGFN>005</MSGFN> <MATNR>100-100</MATNR> <ERSDA>19941107</ERSDA> <ERNAM>BALLER</ERNAM> <LAEDA>20020124</LAEDA> <AENAM>ABAPTRG1</AENAM> <PSTAT>KCVEDPALSQBGF</PSTAT> <LVORM></LVORM> <MTART>HALB</MTART> <E1MAKTM> <MSGFN>005</MSGFN> <SPRAS>D</SPRAS> <MAKTX>Spiralgehuse GG</MAKTX> <SPRAS_ISO>DE</SPRAS_ISO> </E1MAKTM>
68
| Chapter 6
| 69
Chapter 7
This example shows how to use the adapters services within a TIBCO ActiveMatrix BusinessWorks process. The TIBCO ActiveMatrix BusinessWorks process uses BDC (sequence of transactions) in the SAP system.to create a Purchase order in the SAP system. For more details, see TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment. All files relevant to this example are located in the following location. <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\BDC
Topics
Example Description, page 70 Setup the Example, page 72 Test the Example, page 74 Expected Results, page 75
70
| Chapter 7
Example Description
This example shows how the adapters services and a batch (sequence of transactions) in the SAP system can be used in a TIBCO ActiveMatrix BusinessWorks process. The batch is invoked from the TIBCO ActiveMatrix BusinessWorks process to create a Purchase Order in the SAP system. The example has one process, BDC_Process.
BDC_Process
- The input XML file (PurchaseOrderIn.xml) contains the data to create a purchase order in the SAP system. Any update in the input file triggers the BDC_Process process. In the process, the XSLT transformation with the help of the XML parser and the mapper constructs the data required for the adapter Request-Response service. The Invoke task triggers the Request-Response service specifying the data and the name of the batch (give the exact name) in the SAP system. The Request-Response service executes the RFC_Call_Transaction, which in turn executes BDC in SAP to create a purchase order. The Request-Response service then sends back the reply to TIBCO ActiveWorks BusinessWorks. TIBCO ActiveWorks BusinessWorks receives the reply, in case of successful execution, the Purchase order number is returned in an XML file, else an error message is written to a file. The sequence of events in the example is listed below: 1. Create a batch in the SAP system. For details, see TIBCO ActiveMatrixAdapter for SAP Configuration and Deployment. 2. The PurchaseOrderIn.xml contains the data for the creation of the purchase order in SAP 3. The XSL file (POSchema.xsl) contains the purchase order schema. 4. The XSLT task maps the XSL to the PurchaseOrderIn.xml 5. Output for the XSLT task is an XML file, which is parsed and mapped to the XSD schema and then given to the Invoke task in the TIBCO ActiveMatrix BusinessWorks process. 6. The invoke task sends a request to the adapter specifying the data and the name of the batch (give the exact name) in the SAP system. 7. The adapter invokes the RFC_Call_Transaction in the SAP system. 8. The RFC_Call_Transaction creates the PurchaseOrder in SAP through a series of recorded transactions as specified by the batch. 9. In case of successful execution, the Purchase order number is returned else an error message is written to a file.
Example Description 71
For each of the above TIBCO ActiveMatrix BusinessWorks process, modify the data in the input XML file corresponding to your SAP system.
72
| Chapter 7
4. Save the project as a multi-file project by the name BDC. 5. Select the BDC process. 6. Click the File Poller icon. In the configuration panel, File Browse and select the input XML file. Click Apply. 7. Check the checkbox for Include Existing Files. 8. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber TIBCO_HOME (Home directory of the TIBCO installation) UserName
Name
field, click
9. Test the connection to ensure connectivity. 10. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 11. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 12. Run the adapter from the command line
adr3--propFile
<adapter_home>\bin\adr3.tra
74
| Chapter 7
Expected Results 75
Expected Results
The example results can be viewed in the respective XML files written to: <install-path>\tibco\adapter\adr3\<version_number>\examples\BusinessWork
s\BDC
The results are directly reflected in the SAP system. The data is created based on the purchase order details specified in the input XML file and a purchase order is created in the SAP system. An output file, bdc_output.txt (containing the Purchase Order number of the purchase order created in SAP ) is created. In case of error, rfc_call_transaction_error.txt is created. Sample of the bdc_output.txt file is shown next.
BDC_Process Reply= class/45B/basic/structures/MESSAGEINF { MSGTY=S MSGID=06 MSGNO=017 MSSPC= MSGTX=Standard PO created under the number 4500010303 }
76
| Chapter 7
| 77
Chapter 8
This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process. All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\Advan cedFeatures\DynamicLogOn
Topics
Example Description, page 78 Setup the Example, page 79 Test the Example, page 81 Expected Results, page 82
78
| Chapter 8
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.
4. Save the project as a multi-file project by the name DynamicLogOn. 5. Select the DynamicLogOn process. 6. Specify appropriate values for the connection parameters in the Input tab of the Invoke Logon Service activity of the DynamicLogon process. 7. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber UserName 8. Test the connection to ensure connectivity. 9. Validate the project to ensure there are no errors. 10. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 11. Modify the repourl and configurl parameters in adr3.tra under
TIBCO ActiveMatrix Adapter for SAP Examples
80
| Chapter 8
<install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 12. Run the adapter from the command line.
adr3--propFile
<adapter_home>\bin\adr3.tra
82
| Chapter 8
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.
| 83
Chapter 9
TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI
This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process. All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\Advan cedFeatures\ExternalCommit
Topics
Example Description, page 84 Setup the Example, page 85 Test the Example, page 87 Expected Results, page 88
84
| Chapter 9
TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI
Example Description
This example deals with using TIBCO ActiveMatrix BusinessWorks to commit a transaction in the SAP system using the adapter. BAPI_SALESORDER_CREATEFROMDAT1 is the BAPI which is used for the creation of a sales order. This BAPI updates the necessary tables and waits for an external commit. In this example, BAPI_SALESORDER_CREATEFROMDAT1 is invoked to create a sales order and then BAPI_TRANSACTION_COMMIT is invoked to commit the transaction. Map the SessionID for the RFCClosure details in the reply of the SalesOrderCreate task to the SessionID for the RFCClosure details in the request of the SalesOrderCommit task. The screen is shown next.
4. Save the project as a multi-file project by the name ExternalCommit. 5. Select the ExternalCommit process. 6. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber UserName 7. Test the connection to ensure connectivity. 8. Validate the project to ensure there are no errors. 9. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 10. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin
86
| Chapter 9
TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI
folder to point to the dat file. 11. Run the adapter from the command line
adr3--propFile
<adapter_home>\bin\adr3.tra
88
| Chapter 9
TIBCO ActiveMatrix BusinessWorks: Integration of External Commit with the Adapter using BAPI
Expected Results
See the output in the console window of the TIBCO ActiveMatrix BusinessWorks engine. The console window of the inbound instance also indicates that a request from TIBCO ActiveMatrix BusinessWorks for BAPI_SALESORDER_CREATEFROMDAT1 was made and a request for BAPI_TRANSACTION_COMMIT to commit the operation was made. In the SAP console VA03, you can see the sales order created.
| 89
Chapter 10
This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process. All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\Advan cedFeatures\DataCaching
Topics
Example Description, page 90 Setup the Example, page 91 Test the Example, page 93 Expected Results, page 94
90
| Chapter 10
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.
4. Save the project as a multi-file project by the name DataCaching. 5. Select the DataCaching process. 6. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber UserName 7. Test the connection to ensure connectivity. 8. Validate the project to ensure there are no errors. 9. Convert the multi-file format to a dat file. 10. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 11. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin
92
| Chapter 10
folder to point to the dat file. 12. Run the adapter from the command line
adr3--propFile
<adapter_home>\bin\adr3.tra
94
| Chapter 10
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.
| 95
Chapter 11
This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process. All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\Advan cedFeatures\IDocFiltering
Topics
Example Description, page 96 Setup the Example, page 98 Test the Example, page 100 Expected Results, page 101
96
| Chapter 11
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.
Example Description 97
2. Filter out an IDoc segment or field by selecting the check box provided against each of the IDoc segments or fields. For example, in the screen given next, the segment E1MARCM and its children segments are being filtered.
To filter an entire IDoc segment and its children segments, select the check box against that segment. The children segments are automatically filtered at run-time Segments that are defined as mandatory in the SAP system are not filtered even if the check boxes against these segments are selected.
98
| Chapter 11
4. Save the project as a multi-file project by the name IDocFiltering. 5. Select the IDocFiltering process. 6. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber UserName OutputFile 7. Test the connection to ensure connectivity. 8. Validate the project to ensure there are no errors. 9. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 10. Modify the repourl and configurl parameters in adr3.tra under
<install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 11. Run the adapter from the command line
adr3--propFile
<adapter_home>\bin\adr3.tra
100
| Chapter 11
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.
102
| Chapter 11
| 103
Chapter 12
This example shows how to use the adapter features within a TIBCO ActiveMatrix BusinessWorks process. All files relevant to this example are located in the following location.
TIBCO_HOME\adapter\adr3\<version_number>\examples\BusinessWorks\Advan cedFeatures\IDocReporting
This example uses Java Messaging Service (JMS) as its transport type.
Topics
Example Description, page 104 Setup the Example, page 107 Test the Example, page 109 Expected Results, page 110
104
| Chapter 12
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.
4. Associate this publisher endpoint to the Subscription Service by referring to this endpoint in the Confirm Publisher reference field. The screen is given next.
5. The Publisher Endpoint destination name and the Queue name for the activity Wait for Adapter Message in TIBCO ActiveMatrix BusinessWorks should be
106
| Chapter 12
the same. In this example, the Queue name is test_report. The screen is given next.
4. Save the project as a multi-file project by the name IDocReporting. 5. Select the IDocReporting process. 6. Include appropriate values for the following global variables: AppServer Client GatewayHost GatewayService Password ProgramID SystemNumber UserName IDocOutput ErrorOutput ExceptionOutput 7. Test the connection to ensure connectivity. 8. Validate the project to ensure there are no errors. 9. Convert the multi-file format to a dat file. Export the multi-file project to a dat. Select Project>Export Full Project from the menu. Browse and select the location of the directory you wish to save the
108
| Chapter 12
dat file to. Ensure that the directory is different from the multi-file project. Enter the name of the project and click OK. 10. Modify the repourl and configurl parameters in adr3.tra under <install-path>\tibco\adapter\adr3\<version_number>\bin folder to point to the dat file. 11. Run the adapter from the command line
adr3--propFile
<adapter_home>\bin\adr3.tra
110
| Chapter 12
Expected Results
The example results can be viewed in the respective .txt files written to:
IDocOutput.txt
or or
ErrorOutput.txt
ExceptionOutput.txt
| 111
Index
A
API xii
I B
Business Object Examples 2 ItemMaster 5 ItemMaster Business Object 5
L C
Location 8 Create a Database Table in the SAP System 10 Create RFC Functions 15 Creating a Database Table in the SAP System 10 Creating an Inbound Instance 27 Creating an Outbound Instance 24 Creating Outbound and Inbound Instances Using TIBCO Designer 24 Creating RFC Functions 15 Customer 4 customer support xiv
O
Overview 2
P
Prerequisites 7 PurchaseOrder 5 PurchaseOrder Business Object 5
D
Deploy and Run the Example 34
R E
Employee 5 Employee Business Object 5 ENV_HOME x Example Description 32, 40, 48, 56, 62, 70 Running the example 27, 30 RV xiii RVCM xiii RVDQ xiii
112
|
S
Index
SalesOrder 4 Selecting a Service 25 Selecting Schema 25 Setting up Connection 24, 27 Setup for all the processes 33 Setup the Example 33, 41, 49, 57, 63, 72 Storing Shared Objects in One Location 22 support, contacting xiv
T
Task A Create_SalesOrder and Get_SalesOrder Setup 41 Task A Deploy the Example 34 Task A Get_PurchaseOrder and Sync_PurchaseOrder Setup 49 Task B Run the Example 34 Task B Start JMS Server 42, 50 technical support xiv Test the Example 43, 51, 59, 65, 74 Testing the Function Modules 22 TIBCO_HOME x
U
Using TIBCO ActiveMatrix BusinessWorks 7
W
Working with dat files in TIBCO Designer 8