You are on page 1of 87

Best Practices for SAP Analytics Cloud Backend

and Analytics Designer Performance

Radim Bacinschi, Product Expert, BI & Analytics Competence Center, SAP


Mark Labouze, Product Expert, BI & Analytics Competence Center, SAP
Abdellatif Astito, Product Expert, BI & Analytics Competence Center, SAP

August 25, 2021

PUBLIC
Agenda

Links to key resources

SAP Analytics Cloud - Performance Best Practices when using SAP Analytics Cloud with:
▪ SAP BW live
▪ SAP HANA live

SAP Analytics Performance Troubleshooting

Analytics Designer for SAP Analytics Cloud - Performance Best Practices (in about 30 min)

Analytics Designer for SAP Analytics Cloud - Performance Troubleshooting

Questions and Answers

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Disclaimer

This document is provided without a warranty of any kind, either express or implied, including but not limited to, the implied
warranties of merchantability, fitness for a particular purpose, or non-infringement. This document is for informational
purposes and may not be incorporated into a contract. SAP assumes no responsibility for errors or omissions in this
document.

This presentation is not subject to your license agreement or any other service or subscription agreement with SAP. SAP
has no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or
release any functionality mentioned therein. This document, or any related presentation and SAP's strategy and possible
future developments, products and or platforms directions and functionality are all subject to change and may be changed
by SAP at any time for any reason without notice. The information in this document is not a commitment, promise or legal
obligation to deliver any material, code or functionality.

All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ
materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements and
they should not be relied upon in making purchasing decisions.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


SAP Analytics Cloud Backend
Performance Best Practices

Content contribution: Stephane Perdigeon, Mihaela Radulescu, Silke Jahr, Jacques Buchholz, David Gonzalez,
Matthias Badaire, Radim Bacinschi
Links to
Key Resources
Links to key resources

• SAP Analytics Cloud Best Practices for Performance Blog: click here

• Master Knowledge Base Article on SAP Analytics Cloud performance troubleshooting: click here

• How to enable HTTP/2 to support multi-processing in SAP Analytics Cloud: click here

• SAP Analytics Cloud Performance Analysis Tool: click here

• SAP Analytics Cloud Optimized View Mode: click here, and here

• Chrome Developer Tools


• Performance Analysis Reference: click here
• HAR file generation: click here
• Capturing performance timeline: click here

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Links to key resources

• SAP Note 2670064 - FAQ: SAP HANA Multi-Dimensional Services (MDS)


• SAP Note 2550833 - HANA build-in procedure: EXECUTE_Analytical Engine
• SAP Note 2245483 – Long runtime for input help – read mode M
• SAP Note 2572550 - OLAP effort too large; add filter or remove drill down characteristic
• SAP Note 2715030 - Considerations when using SAP BW and SAP S/4HANA Live Connections in SAC
• SAP BW Query Merge: click here
• Query batching: click here
• Optimizing two-structure query performance: click here
• SAP HANA performance analysis for the view: click here
• Hide in SAP HANA unnecessary dimension or measures: click here
• SAP Analytics Cloud – SAP BW live connection best practices: click here
• SQL Optimization: click here

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


SAP Analytics Cloud Backend
Performance Best Practices
Performance Best Practices

1. Re-save story
 to take advantage of recently released SAP Analytics Cloud performance improvements.

2. Avoid AUTO Top N, instead use Top N.


 where N is a specified number, for example 5, 10, 20, etc.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


CHARTS and TABLES

1. Limit number of charts and tables per page.


 Limiting or reducing number of charts and tables on a stary page improves
readability, decreases number of backend requests and improves performance.

2. Avoid charts with a large number of data points (>500).


• Lowering the number of individual data points makes the information easier to read
and analyze, it also helps story to load faster with less load on backend.

3. Limit number of cells in a table.


 Limiting number of cells in a table improves readability, decreases number of
backend requests and improves performance.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


GEOSPATIAL

1. Reduce number of points on the map.


2. Location clustering
 is auto enabled when on bubble layer with 5,000+ points.
 to further improve, enable location clustering with 1,000 points.
3. When location clustering is enabled, moving map causes SAP Analytics Cloud to
submit backend queries.
4. To create a location-enabled model from a live SAP HANA data connection
 prepare a calculation view with location dimensions.
 location data must be prepared through SAP HANA Studio.
 after creating a model based on the calculation view in SAP Analytics Cloud, you
can add one or more location dimensions to map the Location Data imported from
the live SAP HANA system.
 For help download instructions on Creating a Geo model from Live HANA
Calculation View

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


SAP Analytics Cloud Backend
Performance Best Practices: SAP BW
11 Golden Rules for SAP Analytics Cloud with SAP BW live connection

On Story / Query Level On Admin Level


1. Tailored queries: don’t retrieve unnecessary data 9. Enable HTTP/2 on SAP BW
2. Use either story filter OR input enabled variables 10. Customize number of parallel SAP BW sessions
3. Set read mode 11. Update SAP BW InA interface
4. Avoid restricted key figures in SAP Analytics
Cloud live models
5. Avoid page filters with cascading effect
6. Query Merge
7. Improve story building performance
8. Specify Memory Limit for SAP BW Queries

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 1: Tailored queries: don’t retrieve unnecessary data
A. Reduce the number of dimensions

A. Reduce the number of dimensions

In SAP BW Modeling Tools, in “Free


Characteristics” section, reduce the
number of query’s dimensions.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 1: Tailored queries: don’t retrieve unnecessary data
B. Hide Key Figures, which are not relevant for initial state

B. Hide Key Figures, which are not


relevant for initial state

In SAP BW Modeling Tools, in


“Display” section, set key figures
which are not relevant for initial state
to “Hide (can be shown)”, or if
feasible set it even to “Hide”.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 2: Use either story filter OR input enabled variables

Where possible use SAP Analytics Cloud


story or page filters.

Where possible avoid queries with variables


processed by Manual Input / Default Value.

Do not use both: SAP Analytics Cloud filters


and SAP BW input variables.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 3: Set read mode M for variable prompt dialog

Master Data Table


Check the read mode for query filter
value in the definition of the
characteristic itself and change to
”Values in master data table“.
For details see SAP Note 2245483

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 3: Set read mode M for variable prompt dialog

Story and page filter read mode can


be configured on the level of the
query in SAP BW Modeling Tools.
Overwriting the backend setting
within the SAP BW query does not
affect the read mode of the filter
values in the variable screen.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 4: Avoid restricted Key Figures in SAP Analytics Cloud Live Models

Restricted Key Figures should be


created in the SAP BW Modeling
Tools, not in SAP Analytics Cloud

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 5: Avoid page filters with cascading effect

Improve performance by turning off


the cascading effect in settings for
filter or input control.

In SAP Analytics Cloud edit a story,


select a story filter, under settings
there is “Cascading Effect” option

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 6: Query Merge

Improve performance by merging


backend calls for multiple charts
within a story.

In SAP Analytics Cloud edit a


story, click on , click on ”Query
Settings”, check “Enable Query
Merge” and “Visualize Query
Merge”

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 6: Query Merge

The same background color in different


charts indicates that queries have been
merged.
Prerequisites and supported charts

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 7: Improve Story Building performance

Enable “Optimize Story Building


Performance“ option in the SAP
Analytics Cloud model
preferences

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 7: Improve Story Building performance

Enable “Optimize Performance for


Two-Structure Queries” option in
the SAP Analytics Cloud model
preferences: documentation

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 8: Specify Memory Limit for SAP BW Queries

For big queries check the query design,


and try to find out if it is necessary to fetch
such a huge data volume.

Try to add more filters or remove drill down


characteristics to reduce the data size.

To reduce the data volume of a SAP BW


query set a maximum value for the OLAP
effort.
For details see SAP Note 2572550

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 9: Enable HTTP/2 on SAP BW

Enable HTTP/2 to increase max number of parallel requests

 Official documentation:
https://help.sap.com/doc/7b5ec370728810148a4b1a83b0e91070/1610%20000/en-
US/frameset.htm?c7b46000a76445f489e86f4c5814c7e8.html

 Related SAP blog: https://blogs.sap.com/2016/10/19/connectivity-news-abap-7.51/

 It can increase backend load, ensure backend is configured to support this increased load

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 10: Number of parallel SAP BW sessions

Multiple SAP BW queries generated by


SAP Analytics Cloud widgets can run in
parallel.

Increasing Parallel sessions can increase


load on SAP BW server.

Ensure that SAP BW backend is configured


to support increase in parallel sessions.

Configure in SAP Analytics Cloud System /


Administration / System Configuration

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Rule 11: Update SAP BW InA interface

To take advantage of Optimized View Mode, a Apply SAP BW patches:


new SAP Analytics Cloud performance  SAP Note: 3029060
improvement feature, update SAP BW InA  SAP Note: 3045207
interface.  SAP Note: 3049412
 SAP Note: 3041816
For details please refer to Blog, SAP Analytics  SAP Note: 3048800
Cloud help and SAP Note: 2715030  SAP Note: 2981266

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


SAP Analytics Cloud Backend Performance
Best Practices: SAP HANA live
Model Design for SAP HANA Live Connections

• Define calculations at model level to use power of backend to do calculations


• Link / blend the models on SAP HANA side
• Do calculations after aggregations
• Avoid complex expressions in Calculated Columns
• Do JOINS on key or indexed columns, not on calculated columns
• Filter data as early as possible
• Reduce data flow between views
• Try not to transfer larger result sets between SAP HANA and SAP Analytics Cloud
• Try to limit granularity of the time dimension only to the necessary level
• If using a reverse proxy, make sure it doesn’t become performance bottleneck

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Hide unused dimensions in SAP HANA live model

Hide unnecessary dimensions


in SAP Analytics Cloud model.
Expose only metadata required
by the business users.
See Dimensions in Live Data
Model

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Performance Analysis Tool

Run performance analysis on SAP HANA


model.
SAP Analytics Cloud performance cannot be
better than performance of underlying SAP
HANA model.
More details here

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Backend best practices: Query Batching

Query batching allows grouping


multiple queries into one query.

In SAP Analytics Cloud edit a


story, click on , click on
”Query Settings”, check
“Enable Query Merge”

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Backend best practices: HTTP/2

Enable HTTP/2 to increase max number of parallel requests

▪ Official documentation: https://help.sap.com/doc/7b5ec370728810148a4b1a83b0e91070/1610%20000/en-


US/frameset.htm?c7b46000a76445f489e86f4c5814c7e8.html

▪ Related SAP blog: https://blogs.sap.com/2016/10/19/connectivity-news-abap-7.51/

▪ Configuring HTTP/2 on HANA XS: SAP Note 3086998

▪ It can increase backend load, ensure backend is configured to support this increased load

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


SQL optimization

Use Execute in ‘SQL Engine’ option


SQL optimization is available in SAP HANA
SPS09 or newer
For more details see SAP Note 2223597

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Story Design for SAP HANA live connection

• Avoid to load all and filter after – use aggregated data, show detailed information on
other story pages where you can jump to by a using a hyperlink

• To display the dimension members in a certain order, define an additional column in


SAP HANA table where the order is defined. More details here .

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Optimized View Mode

Take advantage of Optimized View Mode, a new SAP Analytics Cloud


performance improvement feature.

For details please refer to Blog, SAP Analytics Cloud help and SAP
Note: 2715030

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Improve Story Building performance

Enable “Optimize Story Building


Performance“ option in the SAP
Analytics Cloud model
preferences

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


SAP Analytics Cloud
Performance Troubleshooting
Using SAP Analytics Cloud Performance
Analysis Tool to analyze performance issues
SAP Analytics Cloud Performance Analysis Tool

SAP Analytics Cloud Performance


Analysis Tool: click here

In SAP Analytics Cloud navigate to


Files / System / Common / SAC Content
open Performance Analysis Tool

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


SAP Analytics Cloud Performance Analysis Tool

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Using Chrome Developer Tools to analyze
SAP Analytics Cloud performance issues
Resources

Capture a HAR file using the Network tab in Google Chrome Developer Tools. See article 2280022
for further information.

Capture a performance timeline using the Performance tab in Google Chrome Developer Tools.
See article 2413393.

Review article 2630653 - How to Troubleshoot and Trace SAP Analytics Cloud connecting to on-
premise / acquired / imported data.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Preparing computer for troubleshooting

Laptop optimization:
▪ Plug laptop in power outlet, do not run on battery
▪ Set high performance power plan
▪ If possible, use wired network, not Wi-Fi
▪ If issue is reproducible without VPN then test without VPN
▪ Stop all apps like outlook and others
▪ Traces should be recorded on a physical machine, not on Citrix
▪ Do not record screen as it takes lots of CPU and disk IO
▪ Do not do conference calls, screens sharing during traces collection.

Chrome optimization:
▪ Use a single tab, close all other unused Chrome tabs
▪ Disable all chrome://extensions

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Troubleshooting a performance issue
1. Reproduce and capture network trace

2. Analyze network trace

3. For network bottleneck:


a) focus on network performance improvements

4. For backend bottleneck:


a) check network trace for long running queries
b) identify slow widget based on long queries
c) apply backend best practices

5. For frontend bottleneck:


a) identify slow feature / widget through story simplification
b) analyze widget definition
c) apply frontend best practices
d) capture performance timeline, see article 2413393

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Chrome Developer Tools

1. Open SAP Analytics Cloud story


to troubleshoot
2. Open Chrome Dev Tools:
• Mac: Option + ⌘ + I
• Win: Shift + Ctrl + I

3 main useful tabs:


• Network tab: allows us to inspect
network calls
• Performance tab: allows us to perform
deep analysis of story run
• Elements tab: allows us to identify
SAP Analytics Cloud story widgets

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Network Trace (HAR)
Collection and Analysis
Network Trace (HAR file) collection

HAR file generation SAP Note 2280022

1. Select “Network” tab

• check “preserve logs”

• check “disable cache”

2. Immediately open SAC story

3. Stop recording as soon as story is


loaded

4. Save the HAR file

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Ignore websocket request

When analyzing network trace please ignore websocket request


• Websocket is always open, a very long request.

• It is by design. Not an issue that it is long. Please ignore it

• It is used for notifications from the backend.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Network Trace analysis

Most common long running calls


to backend are usually are
“GetResponse”
▪ Filter on GetResponse calls
▪ The widget will not finish loading
until this backend request finished

Identify long requests for analysis

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Check backend runtime

Check backend runtime statistics:


select a GetResponse, in Preview
tab expand “Performance Data”.

A detailed breakdown of timing of


backend query execution phases
helps to identify the backend
bottleneck location.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Network Trace analysis

Green (Waiting Time To First Byte) shows time


to first byte. Time from browser sending request
and until the first bytes comes back from the
server.
Backend query run time + network time
From previous slide backend time is 1.438804
sec, while here we see that WTTFB time 3.29
sec.
Estimated network time = 3.29 – 1.43 = 1.85 sec
Check the network performance.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Network Trace analysis

Blue shows how much time data


transfer took over the network.
Here we see 334kB transferred in 3.05
seconds (~0.1 MBps).
Slow transfer rate may be caused by a
slow network, a network bottleneck.
Check the network performance.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Network bottleneck
Network

Wireless: test by using wired connection.

VPN: using VPNs may affect performance as VPN may


tunnel requests to SAP Analytics Cloud via your VPN
connection. Compare the performance when connected
directly to your network. If you notice a significant
improvement, contact your VPN / IT administrator.

Test from a different network / location.

Work with IT to troubleshoot network.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Backend bottleneck
Backend bottleneck

For backend bottleneck


1. check network trace for long running queries
2. identify slow widgets
3. apply backend best practices

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Finding SAP Analytics Cloud
widget
Find Widget that caused the GetResponse call

Identify and copy the Widget ID


located in the ”WidgetId”
property in the header of
GetResponse request, under
“Request Payload” / “ClientInfo” /
“Context” / “WidgetId”.

In Element Tab search for the


Widget ID, the Widget will be
highlighted

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Analytics Designer
Performance Best Practices

Content provided by Jie Deng, SAP Product Management


Additions & webinar presentation by Abdellatif Astito & Marc Labouze, SAP BI Competence Center
Architecture

Analytics Designer is based on the Story


architecture, adding script runtime and APIs

General Rule: All best practices for stories


are valid for analytic applications

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Analytics Designer

Official Resources
▪ Analytics Designer performance best practices are published
▪ As Blog: https://saphanajourney.com/sap-analytics-cloud/learning-article/performance-best-practices-for-sap-
analytics-cloud-analytics-designer/
▪ Or Developer Handbook: https://saphanajourney.com/sap-analytics-cloud/analytics-designer/ → download
developer handbook → Chapter 13

▪ Story performance best practices are valid for analytic applications as well for those widgets that are
shared between these 2 artifacts (table, chart, geo map etc.)
▪ For details please refer to the best practices of story: https://saphanajourney.com/sap-analytics-cloud/learning-
article/best-practices-for-performance/

▪ SAP Note 2946271 - Performance hints for SAP Analytics Cloud Analytics Designer applications

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Best Practices

Most Important:
▪ Loading invisible widgets in Background
▪ Use the Pause Refresh API
▪ Enable Planning for Tables only when planning is used
▪ Use member info object with setDimensionFilter()
Important:
▪ The Design of the Applications
▪ Analytics Designer Script APIs
▪ Widgets
▪ Other Considerations

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Loading invisible widgets in background 1)

▪ Significantly speed up the application initialization


time if
▪ Application is divided into different pages/tab strips
▪ Less widgets are available on the first page or tab strip
▪ All the invisible artifacts are loaded in background
automatically
▪ Scripts related to initial invisible widgets
▪ Widgets or containers defined within the invisible
containers
▪ Invisible tab strips
▪ You can set application to be loaded in
background via
▪ Analytic application setting dialog
▪ Application URL parameter:
loadInvisibleWidgets=inBackground

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Loading invisible widgets in background 2)
Application startup
With Load invisible widgets in background enabled

▪ Keep the scripts for User Interaction Analytic Application Script Execution

onInitialization event as Application startup


With Load invisible widgets in background disabled
less as possible Load
Application

▪ Try not to access User Interaction Analytic Application Script Execution

invisible widgets for Initialize


visible widgets

onInitialization event Load


Application

▪ if you really need to


Initialize all
access the invisible widgets
Initialize
invisible
widgets
Execute
onInitialization

widgets:
Widget already loaded

▪ Set the widgets to Execute


onInitialization
no yes

“always initialize on Initialize


widget Assuming a widget
was changed during
startup”
Update
widgets if onInitialization event
necessary Assuming a widget
was changed during

▪ Don’t nest the


Update widget
onInitialization event

invisible widgets too


deep into container
structure.
Default mode Loading invisible widgets in background

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Loading invisible widgets in background 3)

▪ Option for widgets: “Always initialize on startup”


▪ Influencing the performance of your analytic
application if the application is run
using background loading
▪ Allowing accessing widgets that are used in
the onInitialization script without the need to wait for
these widgets to be initialized in the background.​

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Pause Refresh Script API 1)

▪ Typical use cases


▪ Pause the initial refresh of widgets until they are
modified during application onInit event to optimize
the application start up performance
▪ Pause the refresh of invisible widgets until they are
getting visible
▪ Pause the refresh of chart and table after each click of
user action. User can take a couple of actions and
then refresh the table/chat all at once.
▪ Pause refresh of chart or table can be configured
in Builder Panel
▪ Setting pause refresh on or off via script API
▪ Chart.getDatasource().setRefreshPaused
▪ Application.setRefreshPaused

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Pause Refresh Script API 2)

Combine pause refresh API and planning enabled


API to achieve the better performance Activate Table:
▪ Set table to planning disabled for the first loading Pause Refresh: false
▪ Set tables to refresh paused for the first rendering (in Planning Enabled: true
widget setting)
▪ Set tables to pause refresh as false as the widget is
needed
▪ Set table to planning enabled Deactivate Table:

Use pause refresh API to avoid unnecessary model Pause Refresh: true
refresh Planning Enabled: false
▪ Some actions (e.g. data action trigger, data input and
also member update) cause the model refresh. Use
pause refresh script API to avoid unnecessary model
refresh
Executing multiple data
▪ Use mass data entry mode plus the pause refresh actions via script APIs:
together to achieve the better performance Suitable for not long-
▪ Leverage data action technical components /script running data actions
API to trigger multiple data actions and then trigger Manually Refresh Data
data refresh via script API
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC
Pause Refresh Script API 3)

Additional Tips:
▪ Reset to refresh paused for charts/tables before
saving the bookmarks
▪ Leverage script API
application.setRefreshPaused to set multiple
widgets. This can reduce the amount of codes.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Enable Planning for Tables only if Planning is used

Loading planning enabled table is expensive.


Therefore we suggest:
▪ Set those tables to planning disabled in property
setting :
▪ All tables which are initially invisible
▪ Tables that are used in onInitialization script
▪ Enable above tables to planning enabled
▪ at the end of the onIntialization script or if they
become visible e.g. by tab switch in the tab strip
widget
▪ after the pause-refresh is disabled.
Table.getPlanning.setEnabled(true);
▪ Pause-refresh API can be leveraged only if the
planning is disabled for the table

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Using MemberInfo object for setDimensionFilter

▪ A setDimensionFilter call using an id only will


trigger a backend roundtrip to fetch the member
description

▪ Using a MemberInfo object with description


instead of id string will avoid the roundtrip

▪ It should be always used if the description is


available

▪ Also if the filter definition never becomes visible to


the end user, some description placeholder can
be used

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


The Design of Applications

▪ Try to avoid building one complex application containing many data


sources
▪ Build multiple applications and use application URL to navigate one
application to the other
▪ Try to divide one application to multiple tabs, panels etc.
▪ In case you have multiple numeric chart widgets and they are
consuming the same data model, you can consider to turn on smart
query merge capability or use getData API to display the key figure
values. This will speed up the performance to avoid multiple
request going to backend.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Script APIs 1)

Using setVariableValue against BW Live Use getResultSet rather than getMembers


connections ▪ The getResultSet method can use the resultset that
▪ When setting several variable values with is already available in the widget and does not need
setVariableValue script method, write these a roundtrip to the backend. The getMembers will
commands in one direct sequence, one after the always lead to an extra roundtrip to the backend
other, without any other script methods in system. So please consider to use to use
between. This sequence is folded into a single getResultSet if it is sufficient for your scenario.
backend call to submit variable values instead of ▪ If you need to use getMembers make sure to use
multiple ones, improving application performance. the available options parameter to limit the list of
returned members.
Prefer setDimensionFilter over
setVariableValue against BW Live Avoid repetition in loops
connections ▪ Avoid repeating instructions in loops (e.g. for or
▪ If a variable is affecting a dimension, consider while). If possible to move these instructions before
using setDimensionFilter method instead of the loop. Even for calls which seems to be cheap
setVariableValue as it avoids roundtrips to the BW such as Table_1.getDataSource().
// Prefer:
backend server. However variables are also used
var ds = Table_1.getDataSource();
for other purposes than filtering. In such cases the
for (var i=0; i<dimensions.lenght; i++) {
usage of variables is still necessary.
ds.setDimensionFilter(dimensions[i], value);
}
// Instead of:
for (var i=0; i<dimensions.length; i++) {
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC
Table_1.getDataSource().setDimensionFilter(dimensions[i], value);}
Script APIs 2)

Modifying DataSources or Widgets at Prefer local variables and function


Application Startup arguments over global variables
▪ To define the initial filter, feeding, variable values etc. ▪ If the value is only used in one script, use local
prefer configuring them at design time rather than variable
using script methods during onInitialization event. ▪ If you want to use the value in a script function,
The onInitialization event is executed after widgets pass it as an argument instead of using global
are loaded initially. Changing the DataSouce or variable
Widget during this event will result in another refresh
which may involve requests to the backend server.
▪ In case you really need to modify the widgets (set
different filters or variable values) during Avoid changes in onResultChanged event
onInitialization event, please consider to use pause- ▪ Try not to change own data source directly or indirectly to
refresh API to pause the initial refresh of applications avoid the endless loop
until they are modified during application onInit event

Prefer copyDimensionFilter over setDimensionFilter


▪ If you want to apply an existing filters on further
widgets, prefer to use copyDimensionFilter over
setDimensionFilter.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Widgets

Chart Geo Map


▪ Lowering the number of individual data points ▪ Bubble Layer: switch on Location Clustering
▪ Display with unbooked Data and choose 1,000 for the maximum number
of display points
▪ Prefer to use restricted measures or
calculation instead of defining exception ▪ using the choropleth layer if you are working
aggregation with thousands of locations

Table Avoid duplicating widgets


unnecessary
▪ limit your tables to a maximum of 500 rows
and 60 columns ▪ Try to leverage Move Widgets API to reuse
widgets
▪ Try to leverage Set Style API to change the
Image font color, background color of widgets
▪ images are sized for web and are smaller
than 1MB
▪ The sequence of the optimized format is
SVG, PNG and JPG

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Other Considerations

Browser Mobile
▪ Always try to use Chrome as browser ▪ Number of charts, table and timeseries
▪ take advantage of improved performance with impact the runtime memory
browser caching of apps. This is particularly ▪ Device specification: at least 2GB RAM,
important for apps with multiple charts or better 3GB RAM
models. Cache is valid as long as there are
no structural changes made in the app. Note Application start up mode
that this performance improvement is only
available for Chrome users in a non-incognito ▪ Prefer embed mode in case the toolbar is not necessary
mode.

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Application Designer
Performance Troubleshooting
Application open time analysis

Using SAC Content / Performance Analysis Tool (avail since Q1/2021 and improved for Q3/2021)
As a first insight into the dashboard startup performance…

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Application open time analysis

Deeper analysis with Performance Measurement Popup (available since Q3/2021)


Makes it easier to spot the startup time & best practice conformity for widgets
Insert ?APP_PERFORMANCE_LOGGING=true in URL

CTRL-SHIFT-A

setDimensionFilters without description: field

widgets that are accessed from OnInit script but not set to Pause Refresh=true…

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Settings Check (Default)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Settings Check (Simple Dashboard)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Settings Check (Complex Dashboard)

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Summary / Most Important to Remember

▪ To reach the best application start up performance and save system resource, please
smartly combine the following options
▪ Background loading for invisible widgets
▪ Access as less invisible widgets as possible in OnInit event
▪ Always initialize on Startup for the needed widgets in OnInit event
▪ Pause Refresh the invisible widgets and the widgets that are used in OnInit event
▪ Switch off the planning capability of planning tables if they are not needed or not needed at
the application initialization
▪ Apply pause refresh as much as possible to
▪ invisible widgets and
▪ widgets used in OnInit event
▪ Planning use case
▪ Enable end user to do some UI actions and then refresh chart/table at once
▪ Use Member Info Object for filtering to provide member description

© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC


Questions and
Answers
Thank you.
Contact information:
Stephane Peters, Senior Director, Head of BI & Analytics Competency Center, SAP
Radim Bacinschi, Product Expert, BI & Analytics Competency Center, SAP
Mark Labouze, Product Expert, BI & Analytics Competency Center, SAP
Abdellatif Astito, Product Expert, BI & Analytics Competency Center, SAP
Follow us

www.sap.com/contactsap

© 2021 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of
SAP SE or an SAP affiliate company.
The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its
distributors contain proprietary software components of other software vendors. National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or
warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or omissions with respect to the materials.
The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty
statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional
warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or
any related presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation,
and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platforms, directions, and
functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason
without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or
functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ
materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, and they
should not be relied upon in making purchasing decisions.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names
mentioned are the trademarks of their respective companies.
See www.sap.com/trademark for additional trademark information and notices.

You might also like