Skip to Content
author's profile photo
Former Member

not able to pass prompt values to queries using setVariableValueExt

SAP BusinessObjects Design Studio

Release 1.6 SP1 Patch 2 (Version: 16.1.2)

Source: Relational database, thru UNX

my Initial Application settings:

All my Datasources have "load in script" set to True. Merge Prompts is set to False. Force Prompts on startup is also set to false.

I have a territory prompt that loads a dropdown prompt and i capture the first value of the dropdown and pass it as a setvariablevalueExt to remaining report queries. [ my territory prompt dropdown has values like "AUS - ABC - 1234"]

1. I wanted to avoid "setvariablevalueExt" and use "setFilter" but if i do so (say, my tables have huge data) and try to create queries without any filters and include all columns required to be filtered into select. Now if i try to "edit initial view" or load a chart, it takes too much time and many times, it errors out or times out. hence i added prompts and tried to set them using "setvariablevalueExt". Is there a workaround or a better way of doing this.

2. my on load script:

// hide prompts panel

DIALOG_CONTAINER.setVisible(false);

// load Territory prompt Query and initialize Territory Prompt

APPLICATION.loadDataSources(DS_TERRITORY);

DROPDOWN_TERRITORY.setItems(DS_TERRITORY.getMemberList("_eaHEdbh0EeWuS70gbqxHFA", MemberPresentation.TEXT, MemberDisplay.TEXT, 800));

// capture the first territory value

var firstTerritoryValue = DROPDOWN_TERRITORY.getSelectedValue();

// load data sources

APPLICATION.loadDataSources([DS_PRD_KPIS, DS_PRD_TREEMAP]);

// setting Variables

DS_PRD_TREEMAP.setVariableValueExt("pmSelect Territory", firstTerritoryValue);

DS_PRD_KPIS.setVariableValueExt("pmSelect Territory", firstTerritoryValue);

// Set KPI Values

var gro_prd = DS_PRD_KPIS.getData("_ObIFgc7sEeWmlZgk6MSEDA", {}).value;KPI_GRW_PRD.setText(Convert.floatToString(gro_prd,"#,###"));

var decln_prd = DS_PRD_KPIS.getData("_Oa7RMc7sEeWmlZgk6MSEDA", {}).value;KPI_DECLN_PRD.setText(Convert.floatToString(decln_prd,"#,###"));

This seems to work fine without any script errors. Even though I'm loading 2 datasources i'm populating only 2 text items to keep things simple.

I have a popup container having territory prompt. After loading the initial screen, i click on prompts show button and change territory value and click "OK" button.

My "OK" button script:

// capture the selected territory value

var TerritoryValue = DROPDOWN_TERRITORY.getSelectedValue();

// setting Variables

DS_PRD_KPIS.setVariableValueExt("pmSelect Territory", TerritoryValue);

DS_PRD_TREEMAP.setVariableValueExt("pmSelect Territory", TerritoryValue);

// Set KPI Values

var gro_prd = DS_PRD_KPIS.getData("_ObIFgc7sEeWmlZgk6MSEDA", {}).value;KPI_GRW_PRD.setText(Convert.floatToString(gro_prd,"#,###"));

var decln_prd = DS_PRD_KPIS.getData("_Oa7RMc7sEeWmlZgk6MSEDA", {}).value;KPI_DECLN_PRD.setText(Convert.floatToString(decln_prd,"#,###"));

Now this mostly doesn't work bust strangely works sometimes. Mostly i get a prompt pop up window asking to select territory prompt values (screenshots attached).

I have referred below posts and followed the same steps w.r.t. setting variables and passing prompt selections but still i'm getting errors:

post 1: Things to be noted to improve performance of SAP Design Studio Application

http://scn.sap.com/community/businessobjects-design-studio/blog/2015/05/19/things-that-to-be-noted-to-improve-performance-of-sap-design-studio-application

Improving Initial Load of Dashboard:: Suggests to avoid setvariablevalueExt but if do so, how will i set "edit initial view". This never loads for me due to data size of the tables. I can limit the data only by adding prompts but then i will end up using setvariablevalueExt method to filter latter on.

post 2: Optimize the performance of your SAP BusinessObjects Design Studio solutions – tips and tricks

http://scn.sap.com/community/businessobjects-design-studio/blog/2013/11/29/optimize-the-performance-of-your-sap-businessobjects-design-studio-solutions-tips-and-tricks

followed the suggestions for this post:

“Load in Script” = True

DS_1.loadDataSource();

DS_1.SetVariableValue method to set variable value captured from dropdown prompt

post 3: Difference in execution logic of setVariableValue

http://scn.sap.com/thread/3917915

This post helped but still having issues in my application and thus need help.

Followed option A mentioned in this post excluding DS_2.reloadData() method. Only change in my application is setVariableValue method doesnt work (application crashes) but when setVariableValueExt is used, it runs fine though the filtering sometimes works and sometimes not.

post 4: How to set Filter default display value as selected value

http://scn.sap.com/thread/3421890

This post was also helpful as it clears some questions I had.

This post mostly explains cascading promtps and use of setFilter. I almost truncated by tables so as to contain < 1000 rows from 20M and tried "setFilter" method instead of using variables and that works fine. But I cannot reduce data in tables everytime i need to add queries or change any initial settings.

Thanks,

Srikanth

error 2.PNG (21.2 kB)
error 1.PNG (11.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Jul 11, 2016 at 01:52 PM

    Hi Srikanth,

    Please take a look at the setVariableValueExt method: its parameters are Variable and InputString.

    What is an InputString? Input string syntax allows to specify more complex selection: one or more value, exclude values, value range.

    The script to define a value range is "value 1" + " - " + "value2".

    So design studio thinks that every string like "AUS - ABC - 1234" is a value range, then it searches the values "AUS", "ABC", "1234" in the dimension members and it will return the error if it does not find them.

    But you purpose is to filter the value "AUS - ABC - 1234".


    Design Studio missunderstands your request.


    Is this your situation?


    Regards,


    Giulia

    Add comment
    10|10000 characters needed characters exceeded