CubeServ Blog
Stay up-to-date on the data-driven business with tools for analytics from SAP & Co. and do not miss any news, downloads & events.

Transfer data to SAP BW via REST API

REST API technology is very often used for a data exchange. Many applications and databases offer a REST API interface. This interface can be used to transfer data from other data sources to the SAP Business Warehouse (BW) for further processing.

Our training video shows in a demo example, based on the EUROSTAT database, the special features of the REST API interface in ABAP programming.

Four steps to load EUROSTAT data into SAP BW

1. Check URL format

The URL format can be checked on the Eurostat website.

The structure of the REST request is as follows:

Struktur der REST-Anfrage

2. Select the appropriate data source code in the database

Statistics from Eurostat. The process is described in detail in the training video.

Printscreen von der eurostat-Webseite

3. Create an ADSO IN SAP BW

Create an ADSO for direct data specification:

Allgemein: REST-API in SAP BW

4. ABAP code

The most important information and functions:

REST API URL:
http://ec.europa.eu/eurostat/wdds/rest/data/v2.1/json/de/demo_mlexpec?sex=F&age=Y20&geo=EU27_2020&time=2020

Define HTTP client instance:

Create REST client object:

REST-Client-Objekt erstellen

Call GET http method:

GET http-Methode aufrufen

Request received from server in JSON format:

Request vom Server im JSON-Format erhalten

Parse data fields:

Assign structures component by component:
ASSIGN COMPONENT <component> OF STRUCTURE <structure> TO <fs>.

Eurostat data structure:
Eurostat-Datenstruktur

e.g.: geo -> category -> label ->< current label ID > -> < current value >.

The complete source code can be viewed on Github.

General information about the REST API technology:

How does the REST API work?

REST (REpresentational State Transferknown) API (Application Programming Interface) is a programming interface based on the paradigms and behaviors of the World Wide Web (WWW) and describes an architectural approach for system communication between client and server in networks.

Resources should be uniquely identifiable by a single URL.

REST API architectural criteria are:

  • Client-server model: a client/server architecture consisting of clients, servers, and resources that manages requests via HTTP.
  • Statelessness: This means that each request from a client contains all the information that a server needs.
  • Caching: Clients can also save responses sent by the server and reuse them later for similar requests.
  • Unified interface: components of REST services use a unified, common interface, decoupled from the implemented service, to transfer information in a standardized way.
  • Layered system: multi-layered, hierarchical systems, i.e., each component can only see directly adjacent layers.
  • Code-On-Demand: the functions of clients can be extended via executable program parts – e.g. in the form of applets or scripts.

The following HTTP methods are used:

  • GET: retrieve data from the server
  • POST: transmit data to the server
  • PUT: modify existing data on the server
  • DELETE: delete existing data on the server

Supported data formats:

  • JSON (JavaScript Object Notation)
  • XML (Extensible Markup Language)

More training videos

Berichte im eigenen Design
SAP Analytics Cloud
Marina Yesayan

Create SAP reports in your design

In SAP Analytics Cloud (SAC), there are various graphical elements that you can use to present data in a comprehensible way. Our training video shows how you can integrate your own graphical elements into SAC and adapt them to your design.

Subscribe our Newsletter

Keep up to date on SAP Analytics Cloud, SAP Data Hub, and Big Data, and do not miss any news, downloads & events.

Author
Expert Team