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.
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.
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.
- 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.
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
- 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.
- 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.
Several customer records are read from SAP and stored in account records in Salesforce.com.
This tutorial should take approximately 60 minutes to finish. If you explore other concepts related to this tutorial, it could take longer to complete.
Developers of integration solutions interested in using IBM App Connect Professional for cloud data sync.
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
- An application that App Connect connects to.
- A flow that represents an integration use case in App Connect Professional.
- 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
Before starting this tutorial, ensure that you have the following requirements ready:
- 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/
You create and run an integration project in IBM App Connect Professional that synchronizes customer data from a SAP ERP system to create Account records in Salesforce.com.
- Use the web management console to create an integration project from a template.
- Open the project in the Studio to make a few changes to the configuration of your project.
- Test the project in the Studio to verify that customer data in SAP can be synchronized with Salesforce.com.
- Deploy the project to run in App Connect Professional on cloud.
- Invoke the project running in the Production environment of App Connect Professional on cloud
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.
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.
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:
- Expand the Source Endpoint drop-down menu
- Type s and then scroll down to and select SAP.
- Expand the Target Endpoint drop-down menu
- Type s and then scroll down to and select salesforce.com.
Select Search (next to the Target Endpoint drop-down menu).
This displays a table of templates for integration from SAP to Salesforce.com.
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.
Select Create a project based on this template.
After a short while, the TIP configuration wizard is displayed.
- On the wizard Introduction page, click Next.
On the Prerequisites page, ensure that you have completed the prerequisites mentioned.
For more information about the prerequisites, see Requirements.
To continue, click Next.
On the Enter Credentials page, enter the credentials for your SAP and Salesforce accounts.
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.
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.
- 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.)
- Enter your user name and password for Salesforce.com.
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.
Click Next to continue.
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.
Click Next to continue.Tip: If you have a problem connecting to SAP, here are some things to check:
- The App Connect Secure Connector is running, as indicated by the Status RUNNING on the Production environment tab of the web management console; Figure 6.) . (See the figure
- 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.
- You have installed the SAP libraries into App Connect, as described in Installing SAP library files for use in App Connect Professional
- Check if you need to update any of the SAP library files, as described in Checking and updating installed SAP library files.
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.
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.
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.
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.
- 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:
- 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.
- Clear fields that you do not need, for example the fields for shipment details, such as ShippingCity.
Click Next to continue.
- To retrieve the list of fields that are available for your Salesforce.com environment, click the blue circle.
On the Change Account Mapping page, add a mapping for SalesOrganisation__c and update the mapping for ExtAccountID.
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.
Map the sales organization field.
- Right-click the SalesOrganisation__c field
- Select Define Default Value
- Click the symbol on the right of the entry field
- Select the configuration property SAPSalesOrg
- Click OK.
The SalesOrganisation__c is shown with a default mapping (D symbol)
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:
Therefore, you must modify the mapping, and enhance it with a concatenate function.
- 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.
- Drag the Concatenate function and drop it onto the line between CUSTOMER and ExtAccountID__c.
- Double-click the Concatenate (&) symbol, to open the concatenate function.
- Enter SAP_ for the second input string, and then click Up to concatenate ‘SAP_’ before the customer value.
- 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.
Click Next to continue.
- Map the sales organization field.
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.
On the Verify Integration page, click Save.
The project is added to the Modify tab, which is opened automatically.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.
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.
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.
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.
Select Next to continue.
- On each page, select Next, until you see the Publish Project page.
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.
The project is opened in the Studio to show its orchestration (flow).
Set options to run the project in the cloud, and determine the URL to be used.
- Edit the HTTP Receive Request node; for example, select the node on the palette.
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.)
- On the Pick Endpoint view, click Edit.
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:
- Edit the SAP endpoint node; for example, select the node on the palette.
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.
- Click OK.
Validate the project by selecting
, or by selecting the Toolbar ‘tick’ icon:
You should see the success message The Studio Project is Valid.
Close the message window.
Save your project to the cloud.
- 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.
- Select 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.
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.
- 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.
- Before starting the orchestration, edit the SAP endpoint node, and temporarily disable use of the Secure Connector:
- Clear the check box Endpoint Runs Behind Firewall (temporarily to verify the project in the Studio).
- 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.
Click the Verify tab
This shows the controls for running the orchestration, and the records of each previous instance that the orchestration was run.
Start the orchestration
For example, click the Start Orchestration icon:
The control changes to show Stop Orchestration.
Start the HTTP Post Utility
The orchestration is triggered by an HTTP request. So, start the HTTP post utility using.
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.
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.
Log into Salesforce.com, and verify that the accounts were created.
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.
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.
- In the web management console, select the Modify tab.
Publish the project to the Production environment.
In the Actions column for the project, select Publish Project.
Select the Production tab.
You can see the SAPCustomerToSFDCAccounts (stopped) project in the list.
- Ensure that the App Connect Secure Connector is running before starting the project.
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.
About this task
This example uses the Postman utility.
For information about the HttpRequester add-on for Firefox, see HttpRequester.
- 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.
In Postman, complete the following steps to invoke the project:
- Select the GET method.
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:
- Select the Authorization tab, choose Basic Auth, and then set Username and Password to the values for your IBM ID.
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
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.
- Optional: To browse any of the Accounts, select the Account Name link.
- In SAP, change one or more of the customer records. For example:
- In Postman, invoke the integration project again. Click Send.
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.
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.
- Used the web management console to create an integration project from a template.
- Edited the project in the Studio to make a few changes to the configuration of your project.
- Verified the project by running it in the Studio.
- 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.
- Used a web browser to log in to your Salesforce.com account and checked that the Accounts were created from the SAP data.
- Deployed the project to run in App Connect Professional on cloud.
- Invoked the project running in the Production environment of App Connect Professional on cloud
- Used the Postman utility to invoke the project to create account records in Salesforce.com for customer data from SAP.
- Used a web browser to log in to your Salesforce.com account and checked that the Accounts were created from the SAP data.
- In SAP, changed one or more customer records.
- 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.