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 Solutions works. After installing the plug-in, you can locate the sample projects in the following directory: TIBCO_HOME/bw/palettes/sap/version_number/examples.
The plug-in provides three sample projects, IDoc_Examples, RFC_BAPI_Examples, and Migration_Examples.
The examples mentioned in this section are compatible with only the latest ActiveMarix BusinessWorks™ version supported.
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 on 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.
- ReceiveIDocsFromSAPtoKafka
Use an IDoc Listener activity to listen on the SAP system and receive IDocs published from the SAP system to the Kafka messaging source.
- 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.
- PostVendorMasterIDocsNoMessaging
Use the Post IDoc to SAP activity to post the CREMAS01 IDoc passed as input to activity to the SAP system. The TID associated to the IDoc is 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.
- PostVendorMasterIDocMultiDestination
Use the IDoc Renderer and the PostIDoctoSAP activities to send same generated CREMAS01 raw IDoc data to multiple SAP destinations. Here using Dynamic Connection activity to provide different SAP connections to PostIDoctoSAP 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 T002 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.
Migration_Examples
The Migration_Examples project converts the Invoke RFC/BAPI in SAP activity of the TIBCO ActiveMatrix BusinessWorks™ Plug-in for SAP Solutions to the Consume OData Service activity of the TIBCO ActiveMatrix BusinessWorks™ Plug-in for OData Services for SAP S/4HANA .
This project contains the following process:
- CheckMaterialFromCustomerPlant
This process has two invoke activites, GetPlantFromCustomer (Invoke RFC BAPI in SAP) and Material ATP (Invoke RFC BAPI in SAP). This process retrieves information from the plant associated with the customer using the Customer ID and use the information received from the plant to check availability of the material.