cancel
Showing results for 
Search instead for 
Did you mean: 

Set multiple values in a web template via JavaScript

Former Member
0 Kudos

Hi,

I have a web template displaying a query containing a mandatory variable. Multiple values are allowed for the variable.

By manually inserting a link in the template I succeeded in setting a single value for the variable with JavaScript, but how is it possible to pass multiple values for that variable?

So far my link target looks like this:

"sap/bw/BEx?sap-language=EN&bsplanguage=EN&CMD=LDOC&

TEMPLATE_ID=ZJS_WT_1&VAR_NAME_1=ZJS_V_R&VAR_VALUE_EXT_1=1"

How do I have to modify the line?

Cheers,

Jost

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thank both of you for your replies!

I already consulted the WebAPI, that's where I got the way to set a single value for a variable from. But it doesn't tell me how to set multiple values (not ranges).

The Query Monitor is indeed a good feature, I didn't know about it before. In this case, however, I tried to identically construct the URL without success. Most of the parameters are simply ignored.

Did no one ever set multiple values for a variable manually?

Former Member
0 Kudos

Jost -

I haven't tried this yet...but I suspect it could work. In the below example, I have a variable on Company Code and am setting it equal to 3 different values. Give it a shot.

&CMD=PROCESS_VARIABLES&SUBCMD=VAR_SUBMIT

&VAR_ID_1=ZCCMPCOD0001

&VAR_ID_2=ZCCMPCOD0001

&VAR_ID_3=ZCCMPCOD0001

&VAR_OPERATOR_1=EQ

&VAR_VALUE_LOW_EXT_1=IP01

&VAR_VALUE_HIGH_EXT_1=

&VAR_SIGN_1=I

&VAR_OPERATOR_2=EQ

&VAR_VALUE_LOW_EXT_2=IP05

&VAR_VALUE_HIGH_EXT_2=

&VAR_SIGN_2=I

&VAR_OPERATOR_3=EQ

&VAR_VALUE_LOW_EXT_3=IP50

&VAR_VALUE_HIGH_EXT_3=

&VAR_SIGN_3=I

Former Member
0 Kudos

Thank you, David, it works!

There is a slightly simpler way:

&CMD=IDOC

&VAR_NAME_1=ZJS_V_R

&VAR_VALUE_EXT_1=100

&VAR_NAME_2=ZJS_V_R

&VAR_VALUE_EXT_2=200

&VAR_NAME_3=ZJS_V_R

&VAR_VALUE_EXT_3=300

Still I wonder how many values I can assign, i.e. how long can a URL be?

Kind regards,

Jost

Answers (2)

Answers (2)

Adem_Baykal
Product and Topic Expert
Product and Topic Expert
0 Kudos
Former Member
0 Kudos

One of the easiest ways to figure out the URL to be generated is to go to transaction rsrt and it will show you the URLs that are built after the variable screen inputs. Hope this helps.

thanks,

Jeff