I’ve written a bunch of Sample Scripts, in Postman, that demonstrate how the ‘export data’ API retrieves data from models stored inside SAP Analytics Cloud. These samples are now available.

This blog first takes a step back and provides an overview of other means and ways to extract data before then introducing the sample scripts themselves. If you are thinking of using the export data API, then these samples and the associated User Guide can remove some barriers to adopting the API since much of the code and logic can easily be re-used and they provide a useful insight into how the API works and behaves.

A number of, currently undocumented but supported features, also form part of these samples. It means the samples and this associated User Guide provide a practical starting point to ensure your coding project gets off to the best start possible.

Overview

SAP Analytics Cloud is often chosen as an enterprise planning solution. The planning data, held in SAP Analytics Cloud, occasionally needs to be further integrated in other systems to complete the business planning process in some way or another. This new ‘export data’ API provides another option to the many already existing options that is described now.

There are many means and ways to export data from SAP Analytics Cloud to other systems and these include using the:

A new method is available with SAP Analytics Cloud Q2 2022 Quarterly Release called the ‘export data’ API. This is an extension to the OData standard and allows the retrieval of all the data from acquired models (both analytic and planning models) on a ‘pull’ basis, unlike the above methods which operate on a ‘push’ basis. The official documentation describes it as

… a PULL based API data extraction API that helps with data integration from SAP Analytics Cloud to SAP Data Warehouse Cloud, SAP BW, SAP HANA, and other third-party tools. The API doesn’t have a dedicated user-interface, and simply extracts data and information about providers.

Sample Scripts

These sample scripts, written in Postman, demonstrates each of the API endpoints. The samples are provided on an ‘as is’ basis and they only retrieve data from SAP Analytics Cloud models, they don’t do anything with the data once it’s been retrieved. Though, some of the samples writes the data to the console, but that’s it. It means these samples are just to demonstrate the API endpoints along with many aspects such as how:

  • sessions and errors can be managed
  • ‘pages’ of data can be retrieved when multiple pages are available (the samples automatically fetch all the pages of data)
  • optional request parameters can be used

If you’re using an SAP connector then there’s no code to develop, it’s just plug and play:

Target system that will pull data from SAC: Related article:
Data Warehouse Cloud and Data Intelligence blog
SAP HANA, SAP BW on HANA, SAP BW/4HANA blog

However, if you are using your own custom application then you will need to write code.

Postman, which is freely available, is a commonly used tool for implementing API workflows. Postman provides a good basis to demonstrate how requests are made to the API, and optionally export code snippets in various languages, such as Java, Python, C, PHP, Node.js and many others. This means development time can be reduced, but nevertheless you will need to adapt the scripts for your own use, either to process the data or upload it to a target data source for further processing.

The list of the samples I’ve provided are:

  • Export Data 761-Test-Environment Setup
  • Export Data 762-Metadata
  • Export Data 763-Namespaces (sets Environment ExportData_NamespaceID)
  • Export Data 764-Namespaces ID
  • Export Data 765-Namespaces ID Provider
  • Export Data 766-Fcj-Provider Metadata
  • Export Data 767-Fcj-Service Document
  • Export Data 768-Fcj-Fact Data
  • Export Data 769-Fcj-Master Data
  • Export Data 770-Fcj-Audit Data
  • Export Data 771-Fcj-Dimension Master Data

Resources

SAP Analytics Cloud Export Data API Sample Scripts User Guide Version 0.7.1 – August 2022
.pdf Download
.pdf Preview
Samples (the code) Version 0.7.1 – August 2022
Github (zip downloadChange log

Frequently Asked Questions

Q1: When retrieving a dimension the columns ‘read’ and ‘write’ (that are used by SAP Analytics Cloud for Data Access Controls) are not returned, why is this?

A1: Data Access Controls and Data Locks are not part of the master data but an extension to the dimension metadata for use only by SAP Analytics Cloud, they have a dependency on them. They are not available for data retrieval and they don’t form part of the API. There are no plans to change this.

 

Q2: When retrieving a dimension the column ‘parent‘ (that is used by SAP Analytics Cloud for hierarchical data structures) are not returned, why is this?

A2: The hierarchy is part of an internal hierarchy extension and doesn’t form part of the data retrieval and they don’t form part of the API. There are no plans to change this.

 

Q3: Calculated measures are not retrieved, why is this?

A3: The API is for data retrieval only and a calculated measure is out of scope for this reason (the API is only for data retrieval not for any form of ‘query’ aspect). They are not available for data retrieval and they don’t form part of the API. There are no plans to change this. As a workaround, these measures could be materialised via a data action making them then retrievable.

 

Feedback

I’ve invested a great deal of time and effort into these materials and so your feedback is very welcome and will help judge if I should continue to create these kind of resources

Please do:

  • Comment if you use these resources in anyway (or if you’re shy, just hit the like button!)
  • Share which sample scripts you’ve used. Other customers would love to hear if you’ve used the scripts. It will give them a sense of how reliable they are! 😉
  • Share your experience
  • Share how much time you saved because of these resources, would you had been as successfully without them?

Before posting any questions please:

  • Do read the contents of the User Guide. I appreciate you may not have the time to read it all. If you’re looking for a quick answer and don’t have the time, feel free to post a question to the community rather than here, it will help keep the number of questions here reduced and it will help others find answers easier (than searching this blogs’ Q and A). You can always ‘@tag’ me in your post so I get a notification, and you can always post a link to your question from a comment to this blog if you think that might help others.
  • If you’ve got a question about the API in general, then post a question to the community rather than here

Feel free to follow this blog post for updates. I’ll update the version numbers in this blog post when there’s one to update.

Many thanks

Matthew Shaw @MattShaw_on_BI

https://people.sap.com/matthew.shaw/#content:blogposts

 

Other related articles

https://blogs.sap.com/tag/sap-analytics-cloud-data-export-service/

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x