Skip to Content
0
Jun 11, 2016 at 05:43 PM

Difference in execution logic of setVariableValue

267 Views

Hi Friends,

Lately, I am trying to pass the values of the BEX variables on click of dropdown component. I noticed the different execution styles of setVariableValue function. Can you please try to explain what actually happens in background. I have seen several threads to understand the logic but still it is unclear as I read somewhere setvariablevalue function also load the datasource along with setting the value of the variable.

Possibility to Bypass mandatory prompts on DS startup

//Variable 0P_CALYE is a mandatory variable on 0CALYEAR.

var varyear = YEAR.getSelectedValue();

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

A

DS_2.loadDataSource();

DS_2.setVariableValue("0P_CALYE",varyear);

DS_2.setVariableValue("/PKG/HR_P_0CALMONTH_O", "");

DS_2.reloadData();

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

B

DS_2.setVariableValue("0P_CALYE",varyear);

DS_2.setVariableValue("/PKG/HR_P_0CALMONTH_O", "");

DS_2.loadDataSource();

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

C

DS_2.setVariableValue("0P_CALYE",varyear);

DS_2.setVariableValue("/PKG/HR_P_0CALMONTH_O", "");

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

D

DS_2.setVariableValue("0P_CALYE",varyear);

Eventually, the code written in section A worked for my requirement. However, I dont understand why the other three did not work.

Thanks,

Gaurav