Thursday 14 September 2017

Salesforce.com adapter for SAP SDI: replication of Salesforce data into HANA tables.

1. Overview


The Advantco SFDC adapter is an adapter for SAP HANA Smart Data Integration (SDI), its purpose is to batch load or to replicate changed data in real time from Salesforce.com to the SAP HANA tables.

This blog describes in detail how to replicate Account data from Salesforce.com in HANA tables.

2. Adapter Architecture

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

The SFDC Adapter acts as a bridge. It open a connection to the Salesforce and read the source data and translate the values into the Hana datatype value.

3. Key features


Below are some of main features covered by this adapter.
  • SQL Query execution: SFDC Adapter convert the SAP HANA SQL syntax to SOQL syntax automatically
  • Virtual Table as a Source
  • Real-time change data capture (CDC).
  • Support SOAP/Bulk API

4. Account Retrieval Use Case


The goal is to make this data of Account on Salesforce available in SAP HANA by Querying the remote Account via Virtual table (data is not physically moved to the cloud, but remains in its original source.)

4.1. Create a Remote Source

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

Save and click Test connection:

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

We can browse the metadata tables which are provided by the adapter, each table correspond to one sObject.

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

4.2. Grant privileges for _SYS_REPO

Execute the sql statement below:

GRANT CREATE VIRTUAL TABLE, CREATE REMOTE SUBSCRIPTION, DROP ON REMOTE SOURCE “Salesforce” TO _SYS_REPO;

The result as below:

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

4.3. Create a Virtual Table

After creating a Salesforce remote source, we can create a virtual table to retrieve data for account as below:

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

Input virtual table name and select “ADVANTCO_SFDC” for schema

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

Go to “ADVANTCO_SFDC” schema and refresh “Tables” node:

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

4.4. Query on Virtual table

Open the SQL console, input and run the sql statement with the result as below:

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

5. Account Replication Use Case

The goal is to make this data of Account on Salesforce available in SAP HANA by using replication task feature

5.1. Create a Replication Task

Create the Replication task as below:

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

Input the name:

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

Select the remote source, the target schema:

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

Select “Account” remote table and choose “Initial load only” for the preplication behaviour.

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

5.2. Run replication task

After save the replication task, click run task with the result as below:

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

5.3. View result

After the replication task done, go to the “ADVANTCO_SFDC” schema to open content of “RT_Account” Table with the result as bellow:

SAP SD, SAP Tutorials and Materials, SAP Guides, SAP SDI, SAP Hana Tables, SAP HANA Studio

No comments:

Post a Comment