Skip to Content
0
Former Member
Aug 09, 2005 at 07:27 PM

Determining a variable's current value with JavaScript

27 Views

I'm writing a web template that has a dropdown box to switch a table from currency type 20 (group currency, the default) to currency type 10 (local currency). The dropdown box works, but I'd like the option selected to stay displayed after the screen refreshes.

For example, a user would run the template to see data in group currency by default. They would pull down the "Currency Type" menu and select "Local" to change the display to local currency. When the user does this, the table is updated to display data in local currency, but the dropdown box resets to "Currency Type".

I've done this before with other dropdown boxes (using SAPBWGetDataProviderDimensions to check properties of characteristics) but I didn't see anything in the HTML source to indicate which value for the Currency Type variable is currently selected.

I'm using BW 3.0B SP25.

Any ideas?

The code for the dropdown box is below, if anyone is interested.

<select size="1" name="currfilter" OnChange="location.href=this.options[selectedIndex].value"> 
<option selected value="#">Currency Type</option> 
<option value="<SAP_BW_URL DATA_PROVIDER='DP_FIN' CMD='PROCESS_VARIABLES' 
SUBCMD='VAR_SUBMIT' VAR_NAME_1='0P_CURRT0001' VAR_VALUE_EXT_1='20'>">Group</option> 
<option value="<SAP_BW_URL DATA_PROVIDER='DP_FIN' CMD='PROCESS_VARIABLES' 
SUBCMD='VAR_SUBMIT' VAR_NAME_1='0P_CURRT0001' VAR_VALUE_EXT_1='10'>">Local</option> 
</select>