This tutorial illustrates how you can use IBM® App Connect Professional on Cloud to synchronize account records in SAP in a private network with Salesforce.com’s cloud offerings.

Introduction

This tutorial provides an example of cloud data synchronization (cloud data sync), using IBM App Connect Professional on Cloud to synchronize customer data between SAP in a private network and Salesforce.com’s cloud offerings.

Figure 1. IBM App Connect Professional performing cloud data sync between SAP and Salesforce.com.
Synchronizing account records between SAP in a private network and Salesforce.com’s cloud offerings

A company has an SAP enterprise resource planning (ERP) system in its own private network and uses Salesforce.com as their customer relationship management (CRM) system in the cloud. The CRM system is used by the call center and the sales teams to communicate with their customers. To work with the CRM system, account data is needed. This account data is available in SAP but has to be synchronized with data in Salesforce.com.

The company made the following decisions about data management:

  • New customer accounts are created in SAP.
  • Users of Salesforce.com are allowed to modify customer data such as addresses, but that needs to be reflected in the master SAP records.

IBM App Connect Professional is used to keep the data of the two systems synchronized. The App Connect Secure Connector provides secure communication through the company’s firewall.

Disclaimer

The intent of this tutorial is to demonstrate the use of IBM App Connect Professional to integrate third-party applications and does not claim any endorsement or affiliation with the listed products. All product and company names are trademarks or registered trademarks of their respective holders, and IBM disclaims any ownership in such third-party marks. Use of such third-party marks does not imply any affiliation with or endorsement by or for IBM or IBM WebSphere Cast Iron Cloud Integration. The use of any third-party trademarks, logos, or brand names is for informational and instructional purposes only, and does not imply that such trademark owner has authorized IBM to promote its products or services.

Overview of use cases

This tutorial implements the first of two use cases that provide bi-directional data sync between SAP and Salesforce.com:

  • Synchronizing new and updated customer data from SAP into Salesforce.com

    For this use case you create an integration project by using IBM App Connect Professional’s configuration-not-coding approach and exploiting a pre-built Template Integration Project (TIP) that includes preferred practices.

    When the integration is triggered by an HTTP request, customer records are read from SAP and corresponding accounts upserted in Salesforce.com: if an account does not exist in Salesforce.com, the account is created; otherwise, if a SAP customer record has changed the account is updated.

  • Synchronizing updated account data from Salesforce.com into SAP

    For this use case, the subject of a separate tutorial, you create an integration project without using a TIP, but exploit artifacts from the first use case. This tutorial explores the details of an integration project that implements cloud data sync from Salesforce.com to SAP. You run the integration to reflect into SAP changes made to customer accounts in Salesforce.com.

Learning objectives

  • See how easy it is to sync data between SAP in a private network and Salesforce.com cloud offerings
  • Understand how to create an integration project from a template
  • Get a meaningful experience of using the web management console and Studio of IBM App Connect Professional
  • See how easy it is to configure and use the App Connect Secure Connector for secure connection between the public cloud and a private network.

Expected results

Several customer records are read from SAP and stored in account records in Salesforce.com.

Time required

This tutorial should take approximately 60 minutes to finish. If you explore other concepts related to this tutorial, it could take longer to complete.

Audience

Developers of integration solutions interested in using IBM App Connect Professional for cloud data sync.

Skill level

Any skill level for IBM App Connect Professional.

A good SAP skill level, to be able to configure SAP and create new test accounts.

Conventions and capabilities used in this tutorial

Terminology:
Endpoint
An application that App Connect connects to.
Orchestration
A flow that represents an integration use case in App Connect Professional.
Studio
The development environment in App Connect Professional, downloaded on request as a Java web start application.
Web management console
The web-browser application used to manage App Connect Professional, and for some development of integration projects
App Connect Secure Connector
The App Component that enables secure connectivity between applications running behind a firewall and applications running in the public cloud.
Template used: T0037 – SAP Customers To Salesforce Accounts
This TIP searches for customer records in SAP and upserts the data into account records in salesforce.com. (If an account record does not exist in salesforce.com, the account is created. If the account exists, it is updated.)
Activities used:
  • HTTP Receive Request
  • SAP – Invoke BAPI (to call a Business Object Method (BAPI) that is enabled at the specified SAP endpoint)
  • Try…Catch (to report any failure to insert a record into Salesforce.com)
  • If Then…Else (to add business rules or business logic)
  • Salesforce – Create Objects

Online resources

Tip: If you have difficulty with the resource links, open the following address in your web browser to browse and select files: ftp://public.dhe.ibm.com/software/integration/hybrid_integration/appconnect/

Requirements

Before starting this tutorial, ensure that you have the following requirements ready:

Requirements detail
  • IBM App Connect Professional.

    This tutorial was prepared using the free full-featured IBM App Connect Professional trial. Try IBM App Connect Professional for free.

  • A Salesforce.com account that is to be used to read account data from Salesforce.com and to create and update account data in Salesforce.com.

    This tutorial was prepared using a free Salesforce Developer account.

    Note the username, password, and security token of the Salesforce.com account, for use when configuring connection to Salesforce.com.

    Tip: The security token is needed because connectivity is provided through the Salesforce.com API. For information about finding your Salesforce.com security token, see Reset Your Security Token in the Salesforce help.
    In Salesforce.com, you must define the following custom fields for the Account object:

    • An external ID field of type text and an external ID named ExtAccountID or similar. The external ID is to be used to contain the SAP customer number in a format of SAP_xxxxxx.
    • An external field of type text that is named SalesOrganization or something similar.
  • SAP system and user.

    You must have access to an SAP system with valid customers.

    You must have an SAP user account that can read customer data from SAP and be allowed to update customer data in SAP.

  • Prepare support for SAP connectivity.

    To be able to connect to SAP from App Connect Professional, you need to install a few SAP libraries into App Connect and install the App Connect Secure Connector on a computer on your network with access to the SAP system. To prepare support for SAP connectivity, complete the steps in Preparing SAP connectivity for App Connect Professional

  • Use a web browser such as Internet Explorer, Mozilla Firefox, Apple Safari, or Pale Moon to log in to App Connect Professional.

    In this tutorial, you use the Studio (a Java™ Web Start Application) of App Connect Professional to edit an integration project. To run a Web Start application (like Studio) from your web browser, Oracle recommends using a web browser such as Internet Explorer, Mozilla Firefox, Apple Safari, or Pale Moon. Alternatively, you can download the Studio JNLP file to your computer and then run that file locally with the Java Web Start application (javaws) of the latest java version installed on your computer. For more information, see the blog post, Java Web Start in or out of the browser.

    Tip: To run Studio as a Java Web Start application from your web browser, ensure that you have selected the Java option “Enable Java content in the browser” and added the following site to the exceptions list: https://castiron.ibmcloud.com/

Summary

Creating the project in the web management console

You first create an integration project from a template in the web management console and use a wizard to configure most of the properties required for the project.

Procedure details
  1. Log in to IBM App Connect Professional.

    This displays the web management console, showing the tabs for Create, Modify, and Run; the three main steps to get your integration solution running.

    Figure 2. The web management console after logging in to IBM App Connect Professional on Cloud
    (Click image to view full size.)
  2. In the web management console, click the Create tab. You use the Create tab to select a template to create an integration project or create a project from scratch.

    In this tutorial, we want to find and select the template to synchronize SAP to Salesforce.com. For example:

    1. Expand the Source Endpoint drop-down menu
    2. Type s and then scroll down to and select SAP.
    3. Expand the Target Endpoint drop-down menu
    4. Type s and then scroll down to and select salesforce.com.
    5. Select Search (next to the Target Endpoint drop-down menu).

      This displays a table of templates for integration from SAP to Salesforce.com.

    6. Scroll down and then select the template T0037 – SAP Customers To Salesforce Accounts

      The template row indicates that the TIP is certified by IBM as depicting a common use case and using preferred practices.

      Figure 3. Web management console, selecting the T0037 template to create a new project
      (Click image to view full size.)
    7. Select Create a project based on this template.

      After a short while, the TIP configuration wizard is displayed.

      Figure 4. The TIP configuration wizard, as first opened
      (Click image to view full size.)
  3. On the wizard Introduction page, click Next.
  4. On the Prerequisites page, ensure that you have completed the prerequisites mentioned.

    For more information about the prerequisites, see Requirements.

    To continue, click Next.

  5. On the Enter Credentials page, enter the credentials for your SAP and Salesforce accounts.

    1. Enter your user name and password for Salesforce.com.

      The password value for Salesforce.com is the account password concatenated with the security token. For example, for password mysfpwd and security token 1AB2CdEfg3HijkLM4NOpqrsTu, the password to enter would be: mysfpwd1AB2CdEfg3HijkLM4NOpqrsTu.

    2. Enter the details needed to connect to your SAP system.

      In this example, we obtained the SAP hostname (IP address), system number, client number, user name, and password from our SAP administrator.

    3. Adjust the other settings: the SAP Sales Organization, the SAP Country, and SAP Search flag to fit your environment. These are the default values used by App Connect to search for customer records in SAP. (You can change the search values later.)
  6. On the Verify Salesforce.com connectivity page, click Test Connection to verify that IBM App Connect Professional can connect to your Salesforce.com account.

    This page provides options for your to customize the Salesforce.com connectivity, if you need to. In this tutorial, we log in normally with the Salesforce.com account name and password (concatenated with the security token) as specified earlier.

    Figure 5. The TIP configuration wizard, Verify Salesforce.com connectivity page
    (Click image to view full size.)

    Click Next to continue.

  7. On the Verify SAP connectivity page, verify that IBM App Connect Professional can connect to your SAP system.

    This page provides options for your to customize the SAP connectivity, if you need to. In this tutorial, we log in with the SAP user name and password specified earlier for authentication.

    Before you test a connection to SAP in a private network, ensure that the App Connect Secure Connector is running, and that your computer can connect to the SAP endpoint (for example, can ping the SAP hostname or IP address).

    To verify that IBM App Connect Professional can connect to your SAP system, click Test Connection.

    Figure 6. The TIP configuration wizard, Verify SAP connectivity page
    (Click image to view full size.)

    Click Next to continue.

    Tip: If you have a problem connecting to SAP, here are some things to check:

    1. The App Connect Secure Connector is running, as indicated by the Status RUNNING on the Production environment tab of the web management console; System > Secure Connectors
      . (See the figure Figure 6.)
    2. The App Connect Secure Connector has been installed on a computer that can connect to the SAP endpoint, and has been configured properly. For more information about installing and configuring the Secure Connector, see Installing the App Connect Secure Connector.
    3. You have installed the SAP libraries into App Connect, as described in Installing SAP library files for use in App Connect Professional
    4. Check if you need to update any of the SAP library files, as described in Checking and updating installed SAP library files.
  8. On the Change search criteria for SAP Customer list page, leave the default settings.

    On this page, you can change how to get Customer records from SAP. In the To Activity cell there are three parameters that have the letter D to the right of the name. This letter indicates that a default value is defined for these values, to be matched when searching for Customer records in SAP. The elements hold country and sales organization information and a search flag. The default values refer to the configuration properties that you specified earlier. If you want to change the default value of a parameter, you can right-click the parameter name and then select from the context menu.

    Click Next to continue.

  9. On the Get salesforce.com custom fields page, select the primary ID and custom fields for sync with Salesforce.

    On this page, you can select the primary ID that is used to identify whether a create or update occurs in Salesforce.com. In addition, you can select the fields that you want to send to Salesforce.com.

    Tip: Custom fields in Salesforce.com end with __c.
    Figure 7. The TIP configuration wizard, Get salesforce.com custom fields page
    (Click image to view full size.)

    Note in Figure 7 that the fields displayed are not identical to the fields of your Salesforce.com account. Specifically, the SalesOrganization field is missing, and is to be added.

    1. To retrieve the list of fields that are available for your Salesforce.com environment, click the blue circle.

      The wizard connects to Salesforce.com and after a short while retrieves the current list of standard and customer fields, also called meta data, for your Account object.

    2. Verify that the list is updated with the ExAccountID__c and SalesOrganization__c fields and that they are selected, as shown in the following figure:

      Figure 8. The TIP configuration wizard, new fields for account object
    3. Select ExtAccountID_c in the list of custom fields, and verify that ExtAccountID__c is selected in the External ID field (shown at the top of the window), as shown in the figure Figure 7.
    4. Clear fields that you do not need, for example the fields for shipment details, such as ShippingCity.

    Click Next to continue.

  10. On the Change Account Mapping page, add a mapping for SalesOrganisation__c and update the mapping for ExtAccountID.

    Figure 9. The TIP configuration wizard, Change Mapping page
    (Click image to view full size.)

    As shown in the figure Figure 9, the field for the sales organization on the right side is not mapped. To store the sales organization into Salesforce.com, you must map information into the field. Also, we want to change the default mapping for the ExtAccountID__c field.

    1. Map the sales organization field.

      1. Right-click the SalesOrganisation__c field
      2. Select Define Default Value
      3. Click the symbol on the right of the entry field
      4. Select the configuration property SAPSalesOrg
      5. Click OK.
      Figure 10. The TIP configuration wizard, Mapping the SAP sales organization

      The SalesOrganisation__c is shown with a default mapping (D symbol)

    2. Update the ExtAccountID mapping.

      Follow the link from the SAP field CUSTOMER field on the left to the Salesforce.com ExtAccountID__c field on the right. This is a direct mapping, meaning that the content is copied from the source to the target.

      However, for this use case, we want Salesforce.com to use the SAP customer number with the following format:

      SAP_SAPcustomernumber
      

      Therefore, you must modify the mapping, and enhance it with a concatenate function.

      1. Click the function symbol (f) to the left of the Back button, located at the bottom of the panel, as indicated in the figure Figure 9.
      2. Drag the Concatenate function and drop it onto the line between CUSTOMER and ExtAccountID__c.
      3. Double-click the Concatenate (&) symbol, to open the concatenate function.
      4. Enter SAP_ for the second input string, and then click Up to concatenate ‘SAP_’ before the customer value.
        Figure 11. The TIP configuration wizard, Updating the ExtAccountID__c mapping
        (Click image to view full size.)
      5. Click OK, and then right-click the Concatenate function symbol (&), and select Apply Function Graph.

      The ExtAccountID__c mapping is now shown as in the figure . The mapping is now finished from SAP to Salesforce.com.

      Figure 12. The TIP configuration wizard, the completed ExtAccountID__c mapping

    Click Next to continue.

  11. On the Map Account fields page, leave the default mappings.

    On the Map Account fields page, you may update the map used to sync data from SAP to the Salesforce Accounts.

    Click Next.

  12. On the Verify Integration page, click Save.

    The project is added to the Modify tab, which is opened automatically.

    Figure 13. The TIP configuration wizard , new project opened in the Modify tab
    (Click image to view full size.)
    Hint: In this example, the project was saved with a new name, SAPCustomerToSFDCAccounts. (If you are not offered the chance to save the project with a new name, you can save the project with a new name when editing in the Studio.)
    Tip: Before we can verify this integration project, or publish it into production to run in App Connect Professional on Cloud, we need to edit the project in the Studio to change a few configuration options.

Editing the project in the Studio

To enable a project to be run in App Connect Professional on cloud, you use the Studio to set options to run in the cloud and note the URL for the project that you use to interact with it.

Procedure details

About this task

The web management console is convenient for creating your first integration project, or the initial state of other projects, but there is more that you can do in the Studio to create and customize your projects.

For example, before you can run your new project in App Connect Professional on cloud, you use the Studio to select the option to run in the cloud and note the URL for the project that you use for data sync between SAP and Salesforce.com. You can also customize the URL and other aspects of the project.

Procedure

  1. In the web management console, in the Actions column for the project, select Edit Project in Designer.

    This downloads and runs the App Connect Studio launcher application (JNLP file) to start the Studio as a Java Web Start application. There is some delay as the launcher application and Studio are loaded and initialized.

    During the download, if you see a Java security request to run the App Connect Studio launcher application, select the option to run the application.

    Tip: After the first time that you launch the Studio from the web console, you can launch the Studio by opening the downloaded JNLP file, or again from a project’s Edit in Designer action of the web management console.
  2. When the Studio has downloaded, it opens the wizard to configure the project.

    In this tutorial, the wizard is only used to import the project into Studio, where the project is to be configured.

    Figure 14. Studio, project configuration wizard
    (Click image to view full size.)

    Select Next to continue.

  3. On each page, select Next, until you see the Publish Project page.
  4. On the Publish Project page, select Finish.

    This displays the Finished page, where you can publish a review of this TIP. You can do that at a later time.

    Select Close.

    The project is opened in the Studio to show its orchestration (flow).

  5. Set options to run the project in the cloud, and determine the URL to be used.

    1. Edit the HTTP Receive Request node; for example, select the node on the palette.
    2. On the Configure view, note the value of the parameter URL (Path After Hostname); by default, /SyncSAPSFDC.

      This is the unique value used to invoke this project when published. (Optionally, change the value, but if you do remember the new value to use later.)

    3. On the Pick Endpoint view, click Edit.
    4. In the Edit Endpoint window, in the Location section, select the check box Configure for App Connect on cloud and note the hostname and port to be used later:
      https://provide.castiron.ibmcloud.com:443
    5. Edit the SAP endpoint node; for example, select the node on the palette.
    6. Select the check box Endpoint Runs Behind Firewall and then enter the Secure connector Name SC4SAPConnectivity

      For projects running in the cloud (Production environment), the name of the secure connector needs to be provided in every endpoint which is behind the firewall. The one secure connector can be used by more than one endpoint/orchestration.

    7. Click OK.
  6. Validate the project by selecting Orchestration > Validate, or by selecting the Toolbar ‘tick’ icon: Validate icon

    You should see the success message The Studio Project is Valid.

    Close the message window.

  7. Save your project to the cloud.

    1. Ensure that you are still logged in to App Connect Professional on cloud. If you see a Login link at the bottom of the Studio, select the link to log in.

      Figure 15. Logging in to the Studio after a period of inactivity
    2. Select File > Save Project (To Cloud) or select the Toolbar ‘Save’ icon:

Verifying the project in the Studio

You can verify an integration project by running the orchestration in the Studio. This makes requests directly to SAP, to upsert customer data to Salesforce.com.

Procedure details

Before you begin

Before you verify the orchestration, check with your SAP administrator that the SAP query will not return hundreds of records, which can cause problems in Salesforce.com.

In the project, the SAP endpoint has been configured as running behind a firewall, with connection through the App Connect secure connector. Such connection cannot be verified in the Studio, so you have to select to verify the project using direct connection to SAP (otherwise known as “non-remoteable” verification). You can use either of the following techniques:

  1. When you start the orchestration (below), you should see the message:
    The orchestration contains one or more activities that are marked as running behind the firewall.  
    This kind of configuration cannot be verified within Studio, but only in the App Connect on cloud. 
    Do you wish to verify them as non-remoteable activities?
                                                  Yes | No

    To verify the project within the Studio, select Yes.

  2. Before starting the orchestration, edit the SAP endpoint node, and temporarily disable use of the Secure Connector:
    1. Clear the check box Endpoint Runs Behind Firewall (temporarily to verify the project in the Studio).
    2. Click Test Connection, to test that you can connect to the SAP system. You should see a message to indicate that you’ve successfully connected.

      If the Studio is unable to connect to SAP, check and, where needed, update the installed SAP library files.

Procedure

  1. Click the Verify tab

    This shows the controls for running the orchestration, and the records of each previous instance that the orchestration was run.

  2. Start the orchestration

    For example, click the Start Orchestration icon:

    The control changes to show Stop Orchestration.

  3. Start the HTTP Post Utility

    The orchestration is triggered by an HTTP request. So, start the HTTP post utility using Tools > HTTP Post Utility
    .

  4. Submit an HTTP GET request.

    Use the following URL to send the request: http://hostname/SyncSAPSFDC, where hostname is the host name of the computer where you are running Studio.

    Figure 16. Using the HTTP Post Utility to trigger the SyncSAPSFDC orchestration in the Studio.

    Studio shows that the orchestration is triggered and completes quickly, unless you have a lot of customer accounts that are processed or a connection problem. In the Verify tab, expand the tree for this instance of the orchestration, and verify the accounts that were processed.

    Figure 17. Instance record of the SyncSAPSFDC orchestration showing account created result.
  5. Log into Salesforce.com, and verify that the accounts were created.

    Figure 18. Salesforce.com, accounts created/upserted by the SyncSAPSFDC orchestration for data from SAP.

    If you edit an account, you can see the data added from the search parameters (like Sales organization), the mapping (external account ID SAP_nnnn) and from SAP.

    Figure 19. Salesforce.com, accounts created/upserted by the SyncSAPSFDC orchestration for data from SAP.
  6. You can now close the Studio.

    Remember: If you choose to save the project to the cloud, first ensure that you have selected the check box Endpoint Runs Behind Firewall on the SAP endpoint node.

Deploy the project to run in App Connect Professional on cloud.

To be able to run the project in App Connect Professional on cloud, you publish the project to the Production environment in the web management console and then start the project running.

Procedure details

Procedure

  1. In the web management console, select the Modify tab.
  2. Publish the project to the Production environment.

    In the Actions column for the project, select Publish Project.

  3. Select the Production tab.

    You can see the SAPCustomerToSFDCAccounts (stopped) project in the list.

  4. Ensure that the App Connect Secure Connector is running before starting the project.
  5. Start the project running.

    In the Actions column for the project, select Run Configuration.

    You can see that the project is moved into the running state, ready to be invoked to upsert customer data from SAP to Salesforce.com.

Invoke the project running in the Production environment of App Connect Professional on cloud

To invoke the project running in the Production environment, use your preferred technique to submit HTTP requests; for example, the Linux command line and curl, the HttpRequester add-on for Firefox, or another utility like Postman.

Procedure details

About this task

This example uses the Postman utility.

For information about the HttpRequester add-on for Firefox, see HttpRequester.

Procedure

  1. Optional: In your web browser, log in to Salesforce, and then refresh the Accounts view to see the list of accounts before the project has been invoked. Ideally, delete any accounts created when testing the project in the Studio.


  2. In Postman, complete the following steps to invoke the project:

    1. Select the GET method.
    2. Enter the URL string containing the App Connect Professional hostname and port that you noted when configuring the project in the Studio. Append the environment value, Deployment, and the URL parameter (for example, /SyncSAPSFDC) that you configured earlier to be used to invoke the project.

      The URL, should be like the following:

      https://provide.castiron.ibmcloud.com:443/env/Production/SyncSAPSFDC
    3. Select the Authorization tab, choose Basic Auth, and then set Username and Password to the values for your IBM ID.
    4. To invoke the integration project, click Send.

      If you have done everything right, you get a 200 success message in Postman: Message accepted by the Cast Iron Cloud

      Figure 20. Postman utility, success message after invoking the project to sync data from SAP to Salesforce.com
      (Click image to view full size.)
  3. In Salesforce, refresh the Accounts view.

    You should now see the Account records created in Salesforce, for customer data created from SAP by App Connect Professional.

    Figure 21. Salesforce.com, accounts created/upserted by the SyncSAPSFDC orchestration for data from SAP.
  4. Optional: To browse any of the Accounts, select the Account Name link.

    Figure 22. Salesforce, details view of an account created for data from SAP.
  5. In SAP, change one or more of the customer records. For example:

    Figure 23. SAP, changed customer record
  6. In Postman, invoke the integration project again. Click Send.
  7. In Salesforce, refresh the Account detail view.

    You should now see the changes to the Account record in Salesforce, for customer data upserted from SAP by App Connect Professional.

    Figure 24. Salesforce, details view of an account upserted for data from SAP.

Conclusion

In a matter of minutes, you created and ran an integration project in IBM App Connect Professional to sync customer data from a SAP system on a private network, to create and update Account records in Salesforce.com.

  1. Used the web management console to create an integration project from a template.
  2. Edited the project in the Studio to make a few changes to the configuration of your project.
  3. Verified the project by running it in the Studio.
    1. Used the HTTP Post Utility in the Studio to trigger the orchestration and get some customer data from SAP and pass the data into account records in Salesforce.com.
    2. Used a web browser to log in to your Salesforce.com account and checked that the Accounts were created from the SAP data.
  4. Deployed the project to run in App Connect Professional on cloud.
  5. Invoked the project running in the Production environment of App Connect Professional on cloud
    1. Used the Postman utility to invoke the project to create account records in Salesforce.com for customer data from SAP.
    2. Used a web browser to log in to your Salesforce.com account and checked that the Accounts were created from the SAP data.
    3. In SAP, changed one or more customer records.
    4. Used the Postman utility to invoke the project again to update the account records in Salesforce.com for customer data changed in SAP.

This has shown use of App Connect to sync customer data from SAP to create accounts in Salesforce.com, and then to update those accounts for changes made to customer data in SAP.

This completes the tutorial.

Join The Discussion

Your email address will not be published. Required fields are marked *