Working with Sample Projects
The plug-in packages sample projects with the installer. The sample projects show how TIBCO ActiveMatrix BusinessWorks Plug-in for SAP works.
After installing the plug-in, you can locate the sample projects in the TIBCO_HOME/bw/palettes/sap/version_number/examples directory.
The plug-in provides two sample projects, IDoc_Examples and RFC_BAPI_Examples.
IDoc_Examples
The IDoc_Examples project shows how to use the IDoc Listener, IDoc Parser, IDoc Acknowledgment, IDoc Reader, and IDoc Confirmation activities to delivery IDocs between the plug-in and the SAP system.
This project contains the following processes:
- Outbound scenario
- ReceiveIDocsFromSAP
Use an IDoc Listener activity to listen to the SAP system and receive IDocs published from the SAP system.
- ProcessVendorMasterIDocs
Use an IDoc Parser activity to retrieve the CREMAS01 IDocs processed by the IDoc Listener activity, and then parse the IDocs. Then, use an IDoc Acknowledgment activity to acknowledge the parsed CREMAS01 IDocs. The retrieved IDoc number and type are displayed in the console view.
- ProcessIDocFromSAPNoXML
Use a JMS Receive Message activity to read the received CREMAS01 IDocs in a raw format.
- ProcessCustomerMasterIDocs
Use an IDoc Parser activity to retrieve the DEBMAS01 IDocs processed by the IDoc Listener activity, and then parse the IDocs. Then, use an IDoc Acknowledgment activity to acknowledge the parsed DEBMAS01 IDocs. The retrieved IDoc number and type are displayed in the console view.
- ReceiveIDocsFromSAP
- Inbound scenario
- StageVendorMasterIDocs
Use a JMS Send Message activity to send a specified CREMAS01 IDoc to the EMS server.
- PostVendorMasterIDocs
Use an IDoc Reader activity to post the CREMAS01 IDoc sent to the EMS server in the StageVendorMasterIDocs.bwp process to the SAP system. The TID and the message ID of the IDoc are displayed in the console view.
- ConfirmVendorMasterIDocs
Use an IDoc Confirmation activity to confirm the CREMAS01 IDoc posted to the SAP system by the IDoc Reader activity.
- StageVendorMasterIDocs
RFC_BAPI_Examples
The RFC_BAPI_Examples project shows how to use the Dynamic Connection, RFC BAPI Listener, Invoke RFC BAPI in SAP, and Reply from RFC BAPI in SAP activities to create or terminate dynamic connections, handle the exceptions, control the commit of a transaction externally, and achieve the request/response scenario.
This project contains the following processes:
- DynamicConnection
Use a Dynamic Connection activity to establish a dynamic connection, and an Invoke RFC BAPI in SAP activity to retrieve the entries in the T000 table in the SAP system by invoking the RFC_GET_TABLE_ENTRIES function module. Then, use another Dynamic Connection activity to terminate the dynamic connection.
In this example, the connection managed by the Dynamic Connection activity is not being used as an inbound transaction.
- ExceptionHandling
Use an Invoke RFC BAPI in SAP activity to retrieve the entries in the T000 table in the SAP system by invoking the RFC_GET_TABLE_ENTRIES function module.
If an exception occurs in the plug-in, the error code and message are displayed in the console view.
If an exception occurs in the SAP system, the error message is displayed in the console view.
- InvokeBAPIWithExternalCommit
Use an Invoke RFC BAPI in SAP activity to create a sales order in the SAP system by invoking the BAPI_SALESORDER_CREATEFROMDAT1 function module.
If the Invoke RFC BAPI in SAP activity fails to create the sales order, the sales order is rolled back by invoking the BAPI_TRANSACTION_ROLLBACK function module. The return message is displayed in the console view.
Otherwise, the sales order is committed by invoking the BAPI_TRANSACTION_COMMIT function module. Then, the delivery date and the number of the created sales order are got by invoking the BAPI_SALESORDER_GETSTATUS function module, and displayed in the console view.
- Request_Reply
Use an RFC BAPI Listener activity to receive the request of the BAPI_XBP_EVENT_RAISE RFC/BAPI function module.
If the event ID is VENDOR, an Invoke RFC BAPI in SAP activity invokes the BAPI_VENDOR_GETDETAIL function module in the SAP system to check if the vendor number is valid.
If the event ID is CUSTOMER, an Invoke RFC BAPI in SAP activity invokes the BAPI_CUSTOMER_GETDETAIL2 function module in the SAP system to check if the customer number is valid.
If the event ID is neither VENDOR nor CUSTOMER, the return message with the content of Bad EventID is displayed in the console view.
- Importing Sample Projects
Before running the project, you must import the sample project to TIBCO Business Studio. - Running the Project
After importing the sample project, you can run the project to see how the plug-in works.