Skip to Content

Searching Twitter in ABAP

The contents of this paper are not subject to any license agreement with SAP. The concept / code outlined below is not intended to be binding upon SAP to any course of business / product strategy and / or development. This is subject to change and may be changed by SAP at any point in time. SAP assumes no responsibility for errors or omissions in this document.

For people who have seen my previous posts and have followed upon to view the Twitter Integration Posts by Venky or viewed the Ecohub package, the next set of questions that they ask is:

  • How can I actually read twitter feeds from within my ABAP system?

I attempt to present a very simple way to achieve this. It is definitely not production quality in design or implementation, but does serve to showcase what can be done. The following steps below outline the process of getting data from twitter:

  1. Define the search URL
  2. Create an HTTP Client connection and authenticate
  3. Process the result of the call

1. Define the search URL

Let us take an example, say you want to search twitter for SAP. The relevant Twitter API (which can change) is:

This creates an ATOM Feed as a result. (You can directly test this in a browser).

Define URL

Define URL2

2. Create an HTTP Client connection (zcl_twitter_access=>call_url(…)  and authenticate

Create and Authenticate

3. Process the result of the call to get an XML

Process Result

So, now you have the data from twitter. What do you do with it? Use your imagination, there can be several applications that you can build from reading twitter feeds:

  • Show them
  • Analyze the tweets

 I could go on about the architecture of ICM and how this works internally from SAP BASIS if you like, but that is something that is a subject for another day…

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