cancel
Showing results for 
Search instead for 
Did you mean: 

setVariableValueExt() ignored within On Variable Initialization when Load In Script = TRUE

Former Member
0 Kudos

Issue: When an applications data sources are set to load in script, attempting to set variables within On Variable Initialization ceases to work.

Workaround: Move setVariableValueExt() code to On Background Processing AFTER the data source has been loaded (i.e. DS_1.loadDataSource()).

Questions:

  1. Is this expected behavior?
  2. If we execute loadDataSource and then subsequently setVariableValueExt(), wont this refresh the data source twice?
  3. How does this work in scenarios where we have multiple data sources with different subsets of the total amount of variables used by the application? (e.g. DS_1 contains 2 out of 5 variables, DS_2 contains 3 out of 5 variables and so on and so fourth. In this scenario we would not be able to set variable values until a sufficient number of data sources have been loaded).

Accepted Solutions (1)

Accepted Solutions (1)

Karol-K
Advisor
Advisor
0 Kudos

Hi Taygan,

you have picked up quite complex topic 😉 I will try to answer, but still feel free to re-ask on details...

1. yes, this is correct behavior - this event is triggered only once when the application is starting (shortly before onStartup event). It was done to have a place to react directly before the system tries to SUBMIT the variables to the BW server. The important point is the SUBMIT, not the SET event.

2. No, there are script functions which are classified as "data changing" and others as "data requesting". as long the sequence is containing only the "data changing" scripts, there is no SUBMIT of variables (which costs time). This means, if you want to set 10 variables, you should make it in one sequence - and then you can call other scripts like getData or so. Making this in a mixed-sequence, the system will be forced to SUBMIT variables in between.

3. see point 2, the loadDataSource script function is also "data changing".

you can test your scenario with profiling parameter, see .

then, you should see the sequence like here (press "Refresh" button and expand until you find the SET_TEMPLATE command)

In summary, the SUBMIT of variables will be triggered automatically on first call which is requesting data after the variables were un-submitted - and this is the effect of setting new variable value.

Karol

Former Member
0 Kudos

Hi Karol,

Thanks for the detailed response.

I still find it strange that loadDataSource() needs to be called before setVariableValueExt() can be used. If both functions are "data changing" and not actually requesting anything, shouldn't we be able to set variables within On Variable Initialization?

Scenario:

  • Application with 3 data sources.
  • All data sources are set to load in script.
  • DS_1 has variables 1, 2 & 5; DS_2 has variables 1 & 4; DS_3 has variable 3;
  • Data sources are daisy chained to load within On Background Processing.


From what I have observed, I won't be able to call setVariableValueExt() until all three data sources have been loaded. Even though setting variables is an application level function. Why the dependency to load data?

Karol-K
Advisor
Advisor
0 Kudos

Design Studio is not holding the variable values, those are passed directly through BICS layer to the OLAP processor. This means, you can set values only on variables which are available. Variables which are in data sources which are not yet loaded are not available.

in your scenario, once DS_1 is loaded, you can set the variable values for 1,2 & 5. then if you load DS_2, the value of variable 1 is already available (variable merge is active in DS per default). You need set the variable 4 immediately, other wise - in case it is a mandatory variable - the prompt screen will be shown.

If you have a chain which you interrupt (like DS_1 in first backgroung processing call), then you render and call background processing again for DS_2 - the variable SUBMIT will be done shortly before rendering starts (as nothing can be rendered w/o submitted variables.

[...]I won't be able to call setVariableValueExt()[...]

-> what you mean here, check this against explanation above.

Always, first the DS must be loaded, then all variables which are already "known" in OLAP processor can be set.

Karol

Former Member
0 Kudos

Thanks Karol, that makes more sense.

It would be nice if SAP provided this level of detail in process flow diagrams

Karol-K
Advisor
Advisor
0 Kudos

Hi,

we will try to improve - have you seen the flow at page 181 in http://help.sap.com/businessobject/product_guides/AAD14/en/ds14SP01_user_en.pdf

?

Answers (1)

Answers (1)

Former Member
0 Kudos

Note: The contextual help for setVariableValueExt states that the data source is executed.