Skip to Content
author's profile photo Former Member
Former Member

Dropdowns and JavaScript - Puzzler??

Hi All,

(I'm currently dealing with OSS on this but I thought I would check here as well to see if anyone has any ideas.)

Here's an outline of the scenario I'm developing:

I have a "launch pad" template that basically includes some buttons to launch different templates/queries in separate browser windows.

These launched templates include a couple of dropdowns to filter on the data.

The users didn't want the (All) description as a default but something more informative. So I followed the instructions in OSS note 597042 to change it as below:.


if (document.DDOWNBOX_1.FILTER_VALUE_1.options[0].value=="!ALL"){document.DDOWNBOX_1.FILTER_VALUE_1.options[0].text='Select a value';}


This works fine the first time a browser is launched but it fails each subsequent time (ie. the description goes back to "All"). Looking at the source of the web page I can see that the dropdown object is being incremented each time... (i.e. <form id="_1" method="POST" name="DDOWNBOX_1").... DDOWNBOX_1 becomes DDOWNBOX_2 then DDOWNBOX_3 and so on.

I did some more searching on OSS and found that by toggling the NO_SESSION_COOKIE on in the templates this problem went away. Or so I thought....

During development I had hardcoded the URL's behind the buttons to launch the browsers. Now I am trying to use JavaScript to generate the URLs so that it will work in all environments (DEV, QA and PRD). To do this I am using the SAP_BW_URL_Get() function. When I do this the problem reappears. From what I can tell, the function itself returns a bunch of characters (session ID??) and the begining of the command parameter string.

To make a long story short:

Has anyone else experienced this?

Does anyone know of a way to retrieve the app server and port number through JavaScript so that I can build my own URL instead of using SAP_BW_URL_Get() or <SAP_BW_URL>?



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2005 at 02:48 PM


    change the Javascript Coding to

    all_forms = document.getElementsByTagName('form');

    for (i=0; i< all_forms.length; i++) {

    if (all_forms<i>.name.substring(0,9) == 'DDOWNBOX_') {

    if (all_forms<i>.FILTER_VALUE_1.options[0].value=="!ALL")

    all_forms<i>.FILTER_VALUE_1.options[0].text='Select a value';




    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Just an update. I got some more info from OSS and I've been able to solve my problem just by using the relative path instead of using SAP_BW_URL_Get(). A very simple solution for my long winded problem - "can't see the forest for the trees!".



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.