cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript in WAD

Former Member
0 Kudos

Hi,

I just wanna have the name of the InfoProvider using a javascritp function in the web application designer ?

alert(INFOPROVDER) something like that ?

Thanks in advance

Aleksi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can use the Text Element Item to display the InfoProvider

Drag a text element item onto your template and set properties:

General Title: No

Border Type: No Borders

Display General Text Elements: Ticked

Display Static Filter Value: un-ticked

Display Variable Values: un-ticked

List of Text Elements: - Element Type: General Text Symbol and Element ID: INFOCUBE

Link to SAP Help:

http://help.sap.com/saphelp_nw04/helpdata/en/9f/4e9d39d44cd45ee10000000a11402f/content.htm

Former Member
0 Kudos

Thanks for that ... but now how I can use the value of the INFOCUBE in a JavaScript function for example in a alert

alert(TEXT_ELEMENT); ???

That don't work ...

Former Member
0 Kudos

Hi ,

You can use this code to get INFOCUBE in javascript.

Give Id to textelemnt cell.

<table>

<tr>

<td id="dataAsOf">>

TextElement item

</td>

</tr>

</table>

In Javascript use this code

var dataAsOf =

document.getElementById("dataAsOf").innerText ;

Regards

Madhukar

Former Member
0 Kudos

Thanks for your help ... I'm triny to do that : I have an object (DROPDOWNBOX for example) and I want to load this object with a different characteristic according to the InfoCube on which is based the query :

<object>

<param name="OWNER" value="SAP_BW"/>

<param name="CMD" value="GET_ITEM"/>

<param name="NAME" value="GR1DROPDOWNBOX_2"/>

<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER_DDOWN"/>

<param name="DATA_PROVIDER" value="DP"/>

<param name="GENERATE_CAPTION" value=""/>

<script type="text/javascript">

<!--

if (INFOCUBE = YSPT ...)

{

<param name="IOBJNM" value="ygrch009"/>

{

else

{

<param name="IOBJNM" value="zgrch009"/>

}

-->

</script>

<param name="BOOKED_VALUES" value="Q"/>

<param name="MAXVALUES" value="500"/>

<param name="ONLY_VALUES" value="X"/>

<param name="TARGET_DATA_PROVIDER_1" value="DP"/>

ITEM: GR1DROPDOWNBOX_2

</object>

Someone could hep me ? It's possible to do that ?

Thanks in advance

Former Member
0 Kudos

Rather than trying to get the InfoCube couldn't you base your logic on the characteristics available from the dataprovider?

In Javascript use function SAPBWGetDataProviderDimensions to get the available "Dimensions" i.e. characteristics & structures

For example:

var dims = SAPBWGetDataProviderDimensions("DATAPROVIDER_1");

var type = "y";

if (dims != null)

{

for(j=1;j<dims.length;j++)

{

alert(dims[j][0] ); // this line added to display each characteristic

if (dims[j][0] == "ZFIELD") type = "z";

}

if (type == "z")

// logic to set Web Item attributes

}

Have a review of SAP help on Command URLs (e.g. changing Web Item Attributes) and also on Use of JavaScript Functions.

http://help.sap.com/saphelp_nw04/helpdata/en/b4/0fa239cec06b40e10000000a11402f/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/d9/4a853bc623c075e10000000a114084/content.htm

former_member184494
Active Contributor
0 Kudos

Aleksi,

You cannot put javascript n the object tab ,

however, you can have an onload() function which is called after the form is loaded and then pass the parameters for the page and then refresh the page to reflect the new values...

Arun

Answers (0)