cancel
Showing results for 
Search instead for 
Did you mean: 

Using Javascript in BW Report

Former Member
0 Kudos

Hi All,

I have a requirement that, when i execute my BW report on browser one specific field should get populated.

eg.

When BW report is executed in browser,

Sold to Party - will be filled up with say '531'

I have created a Javascript code for the same, but unable to find where to use that code.

Please suggest how to use java script code in BW reports/ Web Templates.

Thanks

Bapujee Naidu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In WAD, you will have HTML view. Try out there and see.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Niadu,

Did you tried this option? May be helpful.

Execute query after filling "Sold to Party" variable with 531 and save the result set as view. Use this view as data provider in web template. Check template property "Force variable screen display" .

Now, when you run the template in browser, the "Sold to Party" varibale is populated with 531 in variable screen.

So there is no need of Java Script.

Regards

MB

Former Member
0 Kudos

Hi Madhukar,

Sorry for being not clear.I will explain my scenario to you.

1.User will logon to a web portal(not SAP-EP) and there will be a link for BW report.

2.When user clicks on that link,his login ID(login ID of Web portal) will be sent as sold to party in the query selection variable

3.For BW authentication I have provided a common userID(anonymous and will not be prompted) to execute reports,i.e.users will be differentiated by their sold to party.

hope i'm clear now.

Please help.

Regards,

Bapujee Naidu

Message was edited by: Bapujee Naidu

Former Member
0 Kudos

Iam closing this thread.

Kindly do not post any replies as I can't award u points.

Thanks to all......

Former Member
0 Kudos

Use the onload event in javaScript.

You need to determine the ID of the field you are trying to populate ... easiest is to load the page normally, then view the source and find the field details.

The javascript for updating a field is:

document.<formname>.<elementID>.value = <value>

So, you need to determine:

->formname - once you have located your element you want populated, search upwards for the <form> tag and you will get the name

->elementID - you can use the name or ID ... ID is generally safer as you can have multiple elements on a page with the same name

Hope this helps

Cheers,

Andrew

Former Member
0 Kudos

Hi Andrew,

Thanks for the reply.

I have added the java script code in the web template,but the code gets executed once you provide the values for selection screen variables.

But I want to populate the fields of selection screen variables.

Any Suggestions will be greatly appreciated.

regards

Bapujee Naidu

Message was edited by: Bapujee Naidu