Skip to Content

Design Studio: On Variable Initialization – Learning from Learning Hub

So I am learning more about Design Studio from Learning Hub.  You can learn more about Learning Hub here Getting access & accessing SAP Learning Hub #SAPEducation

On Variable Initialization is discussed here as well: DS 1.2 – New Event Triggers

First in Learning Hub SAP explains that you can use the On Variable Initialization event to set query variables to “avoid unnecessary round trip to the backend”.  This will set the mandatory variables all at once.  At BI 2014, it was discussed that the mandatory prompt screen may be difficult on your users; so consider possibly not using it and let your users interact with the dashboard directly.


Above is the mandatory prompt screen if I don’t use the On Variable Initialization event.

In this example, I set all mandatory variables using the On Variable Initialization event by first setting the default in a global variable:


I am setting the date to January 31, 2011 as shown above (dates are strings)

3method for event.PNG

Above is where I set up the code to set the value of the variable, which in this case is the value of the global variable g_date.

So when I run the application there are no prompts, which is nice.


Note I left the default setting Force Prompts to false.


If I set it to true, then the prompt screen is always shown even if I set all mandatory variables in the script.


If you are an ASUG member consider registering for the webcasts below:

You can learn more about Design Studio, including hands-on experience at this Jump Start ASUG Annual Conference SAPPHIRE with a Pre-Conference Session – Back and Better than Ever

You must be Logged on to comment or reply to a post.
  • Hi Tammy, and fellow users

    Thank you for the many articles posted! I would like to add a bit to this: it only works with the data source’s “Load in Script” option set to false.

    Unfortunately if you would set “Load in Script” to true, on the first occurance of DS_*.loadDataSource(); the prompt will still appear; even if you have already set the value in the script like above. (Second time it’s fine.)

    DS version: 16.2.2

    I have spent a few hours on this 🙂 hopefully you can save it!