System-dependent Hyperlink from Web Template

Question: Hi,

In summary:
We would like include links between Templates.

Is there a way to include a Hyperlink within a Web Template to another Web Template which references the correct system?
i.e If Template 1 is executed in TEST, the links opens Template 2 in TEST
- If Template 1 is executed in PROD, the links opens Template 2 in PROD

In detail:
I would to somehow link to another template with a link like:
<a href="http://xxxx/sap/bw/BEx?TEMPLATE_ID=ZTEMP2" target="_blank">Template 2</a>
where
    xxxx = bwtest.company.com:8010 - if ZTEMP1 was run in TEST; OR
    xxxx = bwprod.company.com:8000 - if ZTEMP1 was run in PROD.

Note: Our web templates are deployed within our intranet (not the portal).

I'm guessing that it could somehow be done with javascript, but I don't how it could determine the System of the Template 1 (or the javascript to concatenate the System & URL).

Many Thanks
Adrian

Answer:
Hi

you can use it like this
<a href=SAP_BW_URL_Get() + '&CMD=LDOC&TEMPLATE_ID=ZTEMP2'...

SAP_BW_URL_Get() translates to http://yoursys:80xx/sap/... at runtime

Hope it helps

Answer:
Many thanks TeMatuaNgahere,

I've just discovered that I may have been overcomplicating it for myself.
By removing the first domain name and folder part of the HREF tag, Template 2 will inherit this part from Template. Of course, this the norm with static web pages, I just didn't assume it would work with BW.

Hence if Template 1 had the URL of
http:// bwtest.company.com:8010/sap/bw/BEx?TEMPLATE_ID=ZTEMP1.
- a hyperlink of: <a href="BEx?TEMPLATE_ID=ZTEMP2">Template 2</a>
-> automatically becomes
http:// bwtest.company.com:8010/sap/bw/BEx?TEMPLATE_ID=ZTEMP2.

Thanks again and Regards
Adrian
Copyright ?2007 - 2008 www.jt77.com