Salesforce Opportunity to SAP Order

The SalesforceOpportunityToSAPOrder example shows how to set up communication between the SAP system and Salesforce.com by using the adapter.

  • SyncOpportunity_OutboundListener and SyncOpportunityProcess processes

    The workflow action is triggered to send outbound messages to the SyncOpportunity_OutboundListener process when you create a record of the Opportunity object with the stage of Closed Won or edit a record of the Opportunity object by setting the stage to Closed Won in Salesforce.com.

    After the SyncOpportunity_OutboundListener process receives the messages, the SyncOpportunityProcess processes is triggered. The adapter invokes the BAPI_SALESORDER_CREATEFROMDAT1 function module to create a sales order in the SAP system based on the outbound messages. In the the BusinessWorks 5 example, when an error occurs in the invocation, this error is written to the OrderStatus.xml file. In the BusinessWorks 6 example, there is no output for the invocation error.

    If the adapter configuration fails to create the sales order, the adapter invokes the BAPI_TRANSACTION_ROLLBACK function module to roll back the sales order.

    Otherwise, the adapter invokes BAPI_TRANSACTION_COMMIT function module to commit the created sales order. Then update the opportunity object in Salesforce.com with the sales order number.

  • UpdateOpportunityFromSAPDelivery process

    This process is triggered when the Publication Service service named as DELVERY05Publisher publishes a DESADV IDoc containing the Opportunity ID. This process updates the Opportunity object in Salesforce.com with the SAP delivery number as the tracking number.