Blogs / SAP / SAP BusinessObjects / SAP Design Studio / General / SAP Design Studio 1.4 – What’s New in APIs

SAP Design Studio 1.4 – What’s New in APIs

Jan 6, 2015

SHARE

SAP Design Studio 1.4 has been very surprising in many interesting ways ever since its release. Through this post, I have tried to capture some aspects of APIs in the latest release.

1. Application Scripts

SAP Design Studio 1.4 – What’s New in APIs

a) getUserAgent() – Provides browser-specific information such as browser type, version and so on. This is typically helpful to avoid inconsistent behaviour of applications across different browsers.

Here is how a string is retrieved when this function is called:

SAP Design Studio 1.4 – What’s New in APIs

Here is an explanation of the above string:

SAP Design Studio 1.4 – What’s New in APIs

b) searchDataSources() – This script helps retrieving the datasources’ present in the specified connection. When you pass the connection parameters and the search string, it returns an array of DataSourceDescriptors.

SAP Design Studio 1.4 – What’s New in APIs
SAP Design Studio 1.4 – What’s New in APIs

Use Case: Can be used to consume different queries in a dashboard with a single DataSource alias and reassign it to a query upon selection from a dropdown

c) getResourceString() – Retrieves the Resource string of the ID that is passed as a parameter.

2. State Scripts

To utilise the undo features on State Scripts, define the “Maximum number of Undo Steps” property in Application properties tab. Maximum number of steps is limited to 20.

SAP Design Studio 1.4 – What’s New in APIs

a) backOneStep() – The state of the application is reverted by one step. This captures all the filters applied but cannot remove the selection made in the component.

b) backToStart() – Very helpful in restoring the application to its original state. It required manual code to do this earlier by clearing filters and hiding the components.

c) isBackOneStepAvailable() – Returns the availability or non-availability of a previous step.

d) isBackToStartAvailable() – Ensures whether the Reset Initial view option is available.

The following screen shows the initial view of a dashboard:

SAP Design Studio 1.4 – What’s New in APIs

As a first step I have applied dimension filter to the chart on right.

SAP Design Studio 1.4 – What’s New in APIs


In subsequent steps, a drilldown filter is applied from crosstab and yearly data chart.

SAP Design Studio 1.4 – What’s New in APIs

While clicking the ‘Undo’ button, the dashboard state is gone one step backward. Keep a track of count near ‘Undo’ button.

SAP Design Studio 1.4 – What’s New in APIs

On subsequent Undo, a message is prompted that says the initial view has been reached.

SAP Design Studio 1.4 – What’s New in APIs

Similarly, we could use the script ‘backToStart()’ for the ‘Reset’ button, that restoring the dashboard to its initial state by clearing any filters that are applied to it.

Here are the code snippets for the above functions:

SAP Design Studio 1.4 – What’s New in APIs

Caution: While using the undo/reset features, the few selection changes are not reverted but the processing happens in the background

3. Dimension Filter

a)setDimension()– Enables us to change the Dimension set to Dimension Filter dynamically at run time. So by having a single Dimension Filter we can filter across many dimensions by switching

SAP Design Studio 1.4 – What’s New in APIs
SAP Design Studio 1.4 – What’s New in APIs

Caution: After the dimension has been changed at runtime, the name of the changed Dimension cannot be fetched via getDimensionByName() API. This function returns the initial dimension but not the changed one.

b) showFilterDialog()– Displays the Dialog box of the Dimension Filter on demand.

Caution: The Dialog box is shown only on the page where the Dimension Filter Component exists and not on a different page.

SAP Design Studio 1.4 – What’s New in APIs
SAP Design Studio 1.4 – What’s New in APIs

4. DataSourceAlias

The following APIs have been added in SAP Design Studio 1.4:

a) Conditional Formatting:

APIs are available to retrieve the Conditional Formats (Exceptions) that are applied at BEx and implement it in our Dashboard when required. Related APIs are as:

  • getConditionalFormats()
  • setConditonalFormatActive()
  • isConditionalFormatActive()
  • getConditionalFormatName()

Use case: Created a query with three Exceptions later consuming it in SAP Design Studio Application. All the Exceptions are populated in a List Box and applying those on demand. A Text Box is populated to depict which particular Conditional Format is applied based on List Box selection.

SAP Design Studio 1.4 – What’s New in APIs
SAP Design Studio 1.4 – What’s New in APIs
SAP Design Studio 1.4 – What’s New in APIs

Output:

SAP Design Studio 1.4 – What’s New in APIs

b) Measure Filters:

Handful of new APIs with respect to “Measures” is as follows:

  • getMeasuresDimension() – Retrieves only the Measures in the DataSource. It’s a subset of getDimensions() function where all the dimensions along with Measures(Key Figures) are retrieved.
SAP Design Studio 1.4 – What’s New in APIs
SAP Design Studio 1.4 – What’s New in APIs
  • getMeasureFilters()
  • getMeasureFilterName()
  • isMeasureFilterActive()
  • setMeasureFilterActive()

Use case: Created a query with two conditions that is to be consumed in the Application. All the Conditions (Filters) are populated in a List Box and applied on-demand. A Text Box is populated to depict which particular Measure Filter is applied based on List Box selection. An Input Field is used to set value for the Filter.

SAP Design Studio 1.4 – What’s New in APIs
SAP Design Studio 1.4 – What’s New in APIs
SAP Design Studio 1.4 – What’s New in APIs

Output:

SAP Design Studio 1.4 – What’s New in APIs

c) getVariableValue()

This API was listed in the ‘What’s New Guide of SAP Design Studio 1.4′ as a recent addition, under the objectDataSource Alias but I was not able to locate in the SAP Design Studio 1.4 Application.

SAP Design Studio 1.4 – What’s New in APIs

These are some features that I found interesting (in addition to what’s here) to me but the quest for more interesting features is still on.


Corporate HQ:
5920 Windhaven Pkwy, Plano, TX 75093

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com


Copyright © Visual BI Solutions Inc.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This!

Share this with your friends and colleagues!