Lukas,
the only way you can get a variable value to a javascript variable is if you have it on screen. if you are passing to another BW query - you can use the RRI option and call the RRI Receiver through the URL and the values will get passed.
My knowledge on the WEB API is rusty but remember doing something like that...