In this post, I will be covering the second part of the three part series on SAP Ariba Analytical Reporting API.
Understanding the basic data model of Analytical reporting database, Reporting API structures and its limitation will ensure a smooth project implementation of data extraction utilizing this API.
Below are the summary for each of the part:
- SAP Ariba Analytical Reporting Data Model
I will briefly cover the Reporting Dimension(s) and Fact(s) classes as Database object, Hierarchies, References, and ASM Data load.
- SAP Ariba Reporting API Structure
I will cover the Synchronous and Asynchronous Method of data extraction, getting Metadata, using OOTB and custom ViewTemplates, Filtering data, using available Parameters, and reading the Rate limit.
- Best practice: SAP Ariba Analytical Reporting API
I will discuss the typical use case of the API along with Q&A, FAQ, and Tips.
Part 2: SAP Ariba Reporting API Structure
While this post is focused on Analytical Reporting API, the general structure of SAP Ariba Reporting API is the same for all 3 branches of Reporting: Analytical Reporting API, Operational Reporting API for Procurement, and Operational Reporting API for Sourcing.
There are two methods of getting Data:
- Synchronous Method
Instant result, data is batched and paginated with PageToken, recommended for a very small subset of data. Client application submit a request and wait for the response
- Asynchronous Method
Request for data is submitted via scheduling a reporting job. Result data output is in ZIP files, recommended for a larger subset of data.
Client application submit a job request to a queue and periodically polls the status of the job. Upon completion, client application downloads the results one file at a time.
Pagination of jobs are supported. I will discuss more on this at the Real life example section.
Before continuing with the Reporting API structure, I need to mention that there are limitations imposed on Reporting APIs:
- Time span Limit
The number of transactions posted within a certain time period may not exceed a certain maximum.
Timespan for data is 1 year on Analytical, Procurement, and Sourcing Reporting.For example:
Using filter TimeCreated >= 1 January 2021 and TimeCreated <= 1 February 2022 will not work as the timespan is more than 1 year.
- Volume Limit
Total result of data retrieved shouldn’t exceed a certain size.Analytical Reporting API:
- Asynchronous is 50,000 records or 10 files containing 5000 records per file.
- Synchronous 50,000 records and 50 records per page.
Procurement and Sourcing Reporting API:
- Asynchronous is 10,000 records or 10 files containing 1000 records per file.
- Synchronous is 10,000 records and 40 records per page.
- Rate Limit
The number of API calls made every second/minute/day/week/month may not exceed a certain limit.
Same rate for Analytical, Procurement, and Sourcing Reporting API:
- Synchronous end point: 1 per second, 3 per minute, 50 per hour, 300 per day.
- Asynchronous Job Post request: 1 per second, 2 per minute, 8 per hour, 40 per day.
- Asynchronous Job Status and download: 2 per second, 20 per minute, 200 per hour,1000 per day.
- viewTemplate management request: 1 per second, 10 per minute, 100 per hour, 500 per day. Note: Rate Limit information are returned with every call under the Response Header section.
Limitations on Reporting API are collectively exhaustive. If one of the limit is met, Reporting API will not return data.
Structure and Concept
Reporting API utilize the concept of view Template and Metadata.
Key facts about viewTemplate:
- Reporting viewTemplate specifies the types of records to report on (documentType), the reporting fields to be included as the response (selectFields), and the reporting filter to be used to select relevant records for inclusion or exclusion (filterFields).
- Out of the box (OOTB) viewTemplates are provided as System-generic viewTemplate. OOTB viewTemplates will only have standard fields.
- Custom viewTemplates can be created and patched for specific selectFields and filterFields. Any custom fields will not exist in OOTB views but they can be added as part of selectFields in a custom viewTemplate, as long as the custom field itself is a persistent, non-derived/computed field.
- Each viewTemplate have a 1:1 relationship with documentType. If you desire data from multiple documentType such as ContractWorkspaceFact and SupplierDim (for example: Contract Title and Company name), separate calls to the respective viewTemplate are needed. One to the view with documentType ContractWorkspaceFact and One to the view with documentType SupplierDim. Any join between the two viewTemplate needs to be completed on your end. More detail on viewTemplate structure can be found HERE
Reporting API Metadata is used to gather information on specific documentType, selectFields, filterFields, PrimaryKeys, and ForeignKeys. Utilizing Metadata, Data definition of specific select or filter fields such as data type, size, precision, and scale become visible. This data definition is important when you plan to store the dataset in your own database as part of your datawarehousing project. Another purpose of Metadata is when we need to create a custom viewTemplate with specific selectFields and filterFields on specific documentType.
When invoking Metadata end point, several parameters are supported. Please review the documentation on Analytical Reporting Metadata for API HERE
Next, I will be sharing several video recording on how to invoke Metadata, getting viewTemplates, creating custom viewTemplate, getting data via synchronous and asynchronous call.
I assume that one reading this post would already know the process of creating application from SAP Ariba developer portal for Analytical Reporting API and have the required apiKey and secret to generate token.
Video 1 – Invoking metadata:
Video 2 – Getting viewTemplates, Creating custom viewTemplate, and Getting data via the Synchronous method:
Video 3 – Getting data via the Asynchronous method:
With Metadata end point, we can retrieve all available select and filter fields available on a specific documentType in SAP Ariba Analytical Reporting API. Utilizing the Metadata, we can create a custom viewTemplate with the required select and filter fields. Once the viewTemplate is set, data can be retrieved via Synchronous and Asynchronous method, depending upon your project requirements.
On the part 3, I will discuss the best practice on SAP Ariba Analytical Reporting API along with some FAQ and Q&A section. Please feel free to post your comments on the section below and submit questions via this link