Skip to Content
0

Passing to multiple prompts using script

Jan 29, 2017 at 07:55 PM

98

avatar image

Hi,

I have a bunch of drop-downs in my dashboard.

After making selections in all of the drop-downs, I would like to pass them together as input to the prompts in the query using a button. For this I've added a button with script as shown below:

DS_1.setVariableValue(Variable1, dropdown_1.getSelectedValue());

DS_1.setVariableValue(Variable2, dropdown_2.getSelectedValue());

DS_1.setVariableValue(Variable3, dropdown_3.getSelectedValue());

...

By doing so, does it apply all the variable values at one go or will the 2nd line be called only after the the 1st has been completed ?

Also, would it make sense to use the event "On Before Prompts Submit" in this case for setting the values of variable2, variable3 using a function ? I am not opening the prompt dialog.

Thanks,

Viren

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Tammy Powlas
Jan 29, 2017 at 09:03 PM
1

Viren - on your first question, my experience has been the former, not the latter.

On your second question, please see Karol's document here regarding "on before prompt submit" https://archive.sap.com/documents/docs/DOC-63888

Show 5 Share
10 |10000 characters needed characters left characters exceeded

Hi Tammy,

Thank you for answering my first question.

I've already looked at the following documents from Karol:

https://archive.sap.com/documents/docs/DOC-63888

https://archive.sap.com/documents/docs/DOC-64462

In the document, it is mentioned that - "This event is executed only when you press "OK" on the prompt dialog."

My question is if i do not use the prompt dialog and try to change variables values using the script, will it still call the "On Before Prompt Submit" event ? I ask this because as per the document, the event is placed between "Set Variables" and "Variables Submitted" states.

Thanks,

Viren

0

HI Viren,

Did you tried like this ?

DS_1.setVariableValueExt(Variable1, dropdown_1.getSelectedValue();

dropdown_2.getSelectedValue()

);

0

Sounds like it might work based on Martin's blog - see https://blogs.sap.com/2015/10/27/design-studio-merged-prompts-and-parallel-processing/ - maybe you should try it yourself with your data

0

Hi Tammy,

I tried it and looks like it works only with the prompt dialog.

Thanks for all the help.

0

Hi Viren,

Karol's document that Tammy originally referenced confirms that the "On Before Prompts Submit" event is only triggered for the Prompt Dialog, as per the following excerpt:

---------------------------------------------------------------------------------------------------------------------------------------

Reaction on Variable Changes (New Event).

There is a new event introduced on APPLICATION level - "On Before Prompts Submit". This event allows you to react on changed variables and e.g. change some of those shortly before the prompts get submitted. This can be used for the "simulated merge scenario".

Pic. 5. New Event "On Before Prompts Submit"

The event is located here in the Data Source state model - this event is triggered on application level and is data source independent!

Question: When is this Event triggered exactly?

Answer: This event is executed only when you press "OK" on the prompt dialog. It is placed to be able to react on the prompt dialog.

---------------------------------------------------------------------------------------------------------------------------------------

0