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 ActiveMatrix BusinessWorks™ version supported. For supported versions, refer to the readme file.

Note:
  • While importing the projects, if any warnings are encountered, use the Quick Fix option to resolve the warning.
  • The existing IDoc_Examples and RFC_BAP_Examples samples should not be used for migration from SAP ECC to SAP S/4HANA
  • While importing the examples to a new workspace if XSLT errors are observed, select the Show Check and Repair option in the mapper to resolve the error and perform automatic fix.

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 where the IDoc is processed by activity using TIBCO Enterprise Message Service.

    • 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 where the IDoc is processed by activity using Apache Kafka.

    • ReceiveIDocsFromSAPNoMessaging

      Use an IDoc Listener activity to listen on the SAP system and receive IDocs published from the SAP system where the IDoc is processed by activity without the need for TIBCO Enterprise Message Service or Apache Kafka.

    • ProcessVendorMasterIDocsNoMessaging

      Use the IDoc Converter activity to output the CREMAS01 IDoc outputted by the IDoc Listener activity, and parse the IDoc. Use an IDoc Acknowledgment activity to acknowledge the parsed CREMAS01 IDoc. The retrieved IDoc number and type are displayed on the console view.

    • ProcessCustomerMasterIDocsNoMessaging

      Use the IDoc Converter activity to output the DEBMAS01 IDoc outputted by the IDoc Listener activity, and parse the IDoc. Use an IDoc Acknowledgment activity to acknowledge the parsed DEBMAS01 IDoc. The retrieved IDoc number and type are displayed on the console view.

  • 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. IDoc confirmation information is displayed on 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.

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.

    Note:
    • Before running this example, maintain the module properties used by the input schema of the Dynamic Connection activity to establish a dynamic connection.
    • An exception of data conversion might occur depending on the data returned from the SAP system.
  • 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.

    Note: An exception of the data conversion might occur depending on the data returned from the SAP system.
  • 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 vendor number is valid, the returned vendor name and number are displayed in the console view.
    • Otherwise, the return message is displayed in the console view.

    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 customer number is valid, the returned customer name and number are displayed in the console view.

    • Otherwise, the return message is displayed in the console view.

    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 activities, 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.