Skip to Content

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

/wp-content/uploads/2015/01/application_scripts_624169.png

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:

/wp-content/uploads/2015/01/getuseragent_624239.png

Here is an explanation of the above string:

/wp-content/uploads/2015/01/getuseragent__624240.png

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.

/wp-content/uploads/2015/01/4_624241.jpg

/wp-content/uploads/2015/01/5_624245.jpg

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.

/wp-content/uploads/2015/01/6_624246.png

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:

/wp-content/uploads/2015/01/7_624247.png

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

/wp-content/uploads/2015/01/8_624248.png

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

/wp-content/uploads/2015/01/9_624249.png

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

/wp-content/uploads/2015/01/10_624250.png

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

/wp-content/uploads/2015/01/11_624251.png

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:

/wp-content/uploads/2015/01/12_624253.png

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.

/wp-content/uploads/2015/01/13_624254.jpg

/wp-content/uploads/2015/01/14_624255.jpg

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.

/wp-content/uploads/2015/01/15_624256.png

/wp-content/uploads/2015/01/16_624257.png

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.

/wp-content/uploads/2015/01/17_624261.png

/wp-content/uploads/2015/01/18_624262.jpg

/wp-content/uploads/2015/01/19_624264.jpg

/wp-content/uploads/2015/01/20_624265.jpg

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.

/wp-content/uploads/2015/01/21_624266.png

/wp-content/uploads/2015/01/22_624267.png

  • 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.

/wp-content/uploads/2015/01/23_624268.jpg

/wp-content/uploads/2015/01/24_624272.jpg

/wp-content/uploads/2015/01/25_624273.jpg

/wp-content/uploads/2015/01/26_624274.jpg

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.

/wp-content/uploads/2015/01/27_624275.png

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.

Source: http://visualbi.com/blogs/design-studio/sap-design-studio-1-4-whats-new-apis/

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply