{"id":46328,"date":"2023-05-07T19:04:25","date_gmt":"2023-05-07T17:04:25","guid":{"rendered":"http:\/\/54.194.80.134.nip.io\/transfer-data-to-sap-bw-via-rest-api\/"},"modified":"2023-10-30T09:12:20","modified_gmt":"2023-10-30T08:12:20","slug":"transfer-data-to-sap-bw-via-rest-api","status":"publish","type":"post","link":"https:\/\/www.cubeserv.com\/en\/transfer-data-to-sap-bw-via-rest-api\/","title":{"rendered":"Transfer data to SAP BW via REST API"},"content":{"rendered":"\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

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\u00a0SAP Business Warehouse (BW)<\/a> for further processing.<\/p>\n

Our training video shows in a demo example, based on the EUROSTAT database, the special features of the REST API interface in ABAP programming.<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

Four steps to load EUROSTAT data into SAP BW<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

1. Check URL format<\/h3>\n

The URL format can be checked on the Eurostat website<\/a>.<\/p>\n

The structure of the REST request is as follows:<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Struktur\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

2. Select the appropriate data source code in the database<\/h3>\n

Statistics from Eurostat<\/a>. The process is described in detail in the training video.<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Printscreen\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

3. Create an ADSO IN SAP BW<\/h3>\n

Create an ADSO for direct data specification:<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Allgemein:\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

4. ABAP code<\/h3>\n

The most important information and functions:<\/p>\n

REST API URL:
\n<\/strong>http:\/\/ec.europa.eu\/eurostat\/wdds\/rest\/data\/v2.1\/json\/de\/demo_mlexpec?sex=F&age=Y20&geo=EU27_2020&time=2020<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t

Define HTTP client instance:<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

Create REST client object:<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"REST-Client-Objekt\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

Call GET http method:<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"GET\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

Request received from server in JSON format:<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Request\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

Parse data fields:<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

Assign structures component by component:
\nASSIGN COMPONENT<\/span><\/em> <component> OF STRUCTURE<\/span> <\/em><structure> TO<\/span><\/em> <fs>.<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t
Eurostat data structure:<\/h6>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Eurostat-Datenstruktur\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

e.g.: geo -> category -> label ->< current label ID > -> < current value >.<\/p>\n

The complete source code can be viewed on Github<\/a>.<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t

\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

General information about the REST API technology:<\/h3>\n

How does the REST API work?<\/strong><\/p>\n

REST (RE<\/strong>presentational S<\/strong>tate T<\/strong>ransferknown) API (A<\/strong>pplication P<\/strong>rogramming I<\/strong>nterface) 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.<\/p>\n

Resources should be uniquely identifiable by a single URL.<\/p>\n

REST API architectural criteria are:<\/strong><\/p>\n