Skip to Content

Hello All,

In my previous blog, I was explaining the way to integrate Live Twitter Tweets into SAC.

In this blog, I would like to share the steps involved to integrate and explore the Facebook “Likes” into SAP Analytics Cloud(SAC).

Here the workflow is getting the Facebook Likes into SAP HANA via Data Provisioning Agent and exposing them through the BW Open ODS View to SAC.

The following diagram, explains the architecture of the same.

 

We created a Facebook Application through https://developers.facebook.com which holds the information about,

App ID

App secret

User ID

Access Token

 

The Access Token is valid for an Hour, but you can regenerate it again from the Facebook App created.

 

The following two files have to be placed under the lib folder of DP Agent

facebook4j-core-1.1.12.jar

camel-facebook-2.15.3.jar

 

The Adapter.xml resides under C:\usr\sap\dataprovagent\camel has to be updated with the Facebook Adapter details. This is the location where the DP Agent installed.

These information are given to the Remote Source created under SAP HANA Web based Development Workbench(This workbench can be accessed through http://HANAServer :80<instance no>/sap/hana/ide/catalog/)

 

 

Once the Remote Source created, the tables would be listed under that.

 

Create a New Virtual Table which will create an entry under your schema->Tables.

Opening the content of the table, lists the Television programs the user liked in Facebook

 

The following blog explains, how this can be achieved.

https://blogs.sap.com/2016/01/29/sap-hana-academy-discover-how-to-use-the-apache-camel-facebook-component/

 

Once the Facebook Likes are into HANA, you can expose this as a native HANA View(Analytics/Calc View) or via BW (through Open ODS View or so) to SAC.

 

To get the Live data, a Live Connection can be created in SAC to HANA directly or to the BW on HANA system(if the data exposed via Open ODS View).

Getting Live data involves configuring CORS(Cross Origin Resource Sharing) in the backend(either HANA or BW).You can refer the SAC Help document about these CORS configurations.

 

In this example, I have a BW on HANA system, where the Facebook Likes(which resides on HANA table) are exposed via Open ODS View to the SAC.

The steps involved here are,

  1. Make sure that the Likes are stored in the HANA table
  2. In SAP HANA Studio, go to the BW Modelling perspective, and create an InfoArea
  3. Create an Open ODS View on top of the HANA Data source
  4. Create a Composite Provider on top of the Open ODS View
  5. Create a BEx Query on top of a Composite Provider
  6. Create an Import Connection to the BW on HANA system, in SAC (You need the Cloud Connector and Cloud Agent configured. For more details on this, you can find SAC Help document)
  7. Using this connection, create a Model and then the Story on top of it

 

Steps 2,3 and 4 can be done with BW Modelling perspective of HANA Studio

Step 5, needs BEx Query Designer

Steps 6 and 7 need to be done in SAC

 

 

Since we are using the Import type Connection, you can schedule the Data import every hr or so, to get the latest data Or you can also trigger import just by clicking the “Update Model Now” option in the Data Model->Data Sources tab

 

Once you refresh the Story, the Facebook Likes would be shown in SAC.

 

Hope you would have found this topic interesting and thanks for reading it.

Please feel free to leave your Comments/Feedbacks.

 

Rgds,

Murali

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Paul Carney

    That’s a great blog. Thanks for demonstrating some useful integration capabilities between social media platforms and SAC. Shows nicely how to leverage HANA Modelling here too.

    (1) 

Leave a Reply