cancel
Showing results for 
Search instead for 
Did you mean: 

How to Access Web Item Values in Web Application Designer

Former Member
0 Kudos

Hi Guru's

I want to access value caontained in a particular webitem dynamically in my custom script .for example

I have a DROPDOWN web item that is attached to a variable ( CALYEAR)

When I select a particular calyear, I need to capture that value in a Javascript variable .

This would enable me to filter other providers that doesn;t use the same variable using the set filter function .

Please send across code snippets / of function library in case any body has them

I am using WAD 7.1.

Thanks for your help

Regards

Nikhil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nikhil,

You can achieve that by creating a script item and writing the javascript in that code: I'am here showing u to do that for the text_item.

In the XHTML layout where your TEXT_ITEM tag is present please add the tag like:

<bi:TEXT_ITEM name="TEXT_ITEM_1" designheight="70" designwidth="200" >

<bi:TEXT_BINDING type="CHOICE" value="CHARACTERISTIC_TEXT_BINDING" >

<bi:CHARACTERISTIC_TEXT_BINDING type="COMPOSITE" >

<bi:DATA_PROVIDER_REF value="DP_2" />

</bi:CHARACTERISTIC_TEXT_BINDING>

</bi:TEXT_BINDING>

</bi:TEXT_ITEM>

in the Script web item write the code like:

function show_data()

{

var x = document.getElementById("data") ;

var str = x.innerText;

var arr = new Array();

arr = arr.split("\n")

//Now all the data will be available in the array arr, use it like as u use an array in

C

for (i=0;i<arr.length;i++)

{

document.write( arr ); //taking the value

}

}

call your function on desired action.

Please write if not clear.

Refer to below thread, (same issue as of urs)

Former Member
0 Kudos

Hello Deepika ,

Thanks for the response my dropdown item look like the following

<bi:DROPDOWN_ITEM name="DROPDOWN_ITEM_1" designheight="32" designwidth="122" >

<bi:WIDTH value="122" />

<bi:HEIGHT value="32" />

<bi:DATA_BINDING_TYPE type="CHOICE" value="CHARACTERISTIC_SELECTION" >

<bi:CHARACTERISTIC_SELECTION type="COMPOSITE" >

<bi:DATA_PROVIDER_REF value="DP_1" />

<bi:CHARACTERISTIC value="0MAT_PLANT__BUSLINE" text="Business Line" />

<bi:LINKED_DATA_PROVIDER_REF_LIST type="ORDEREDLIST" >

<bi:LINKED_DATA_PROVIDER_REF index="1" value="DP_3" />

</bi:LINKED_DATA_PROVIDER_REF_LIST>

</bi:CHARACTERISTIC_SELECTION>

</bi:DATA_BINDING_TYPE>

</bi:DROPDOWN_ITEM>

In your function

function show_data()

{

var x = document.getElementById("data") ;

var str = x.innerText;

var arr = new Array();

arr = arr.split("\n")

.....

there is no element by name "data"

should I use the name reference for the same like "DROPDOWN_ITEM_1"

Where is the ID given to a dropdown web item

Can you please elaborate ont he same

Regards

Nikhil

Former Member
0 Kudos

Hi Nikhil,

1. there is no element by name "data".

Please add 'span' tag here -


Its a html tag, '<' span id = "data" '>'

<bi:DROPDOWN_ITEM name="DROPDOWN_ITEM_1" designheight="32" designwidth="122" >

<bi:WIDTH value="122" />

<bi:HEIGHT value="32" />

<bi:DATA_BINDING_TYPE type="CHOICE" value="CHARACTERISTIC_SELECTION" >

<bi:CHARACTERISTIC_SELECTION type="COMPOSITE" >

<bi:DATA_PROVIDER_REF value="DP_1" />

<bi:CHARACTERISTIC value="0MAT_PLANT__BUSLINE" text="Business Line" />

<bi:LINKED_DATA_PROVIDER_REF_LIST type="ORDEREDLIST" >

<bi:LINKED_DATA_PROVIDER_REF index="1" value="DP_3" />

</bi:LINKED_DATA_PROVIDER_REF_LIST>

</bi:CHARACTERISTIC_SELECTION>

</bi:DATA_BINDING_TYPE>

</bi:DROPDOWN_ITEM>

Close the span tag here:

'<' / Span '>'

please remove ' ' when u place the code, i have to do that as other wise the messanger wil read it as a html tag and remove it.

Now use the code as it is.

2.should I use the name reference for the same like "DROPDOWN_ITEM_1"

No.

3. Where is the ID given to a dropdown web item - I provided that now.

I tried this code with text_item. (other's also used the same ajay & recardo, worked succesfully in our case) . If u have any problem further then let me know.

Thanks.

Former Member
0 Kudos

Nikhil please look out for the span tag syntax on net, and in its id please set data as id = "data",

Thread removes the span tag,

Answers (2)

Answers (2)

Former Member
0 Kudos

Analyse the Generated HTML and the you'll be able to fing the dropdown box item

Former Member
0 Kudos

Hello,

where do I place the span-tag if I want to read a InfoField?

Currently my code is as followed:

<bi:INFO_FIELD_ITEM name="INFO2" designheight="300" designwidth="300" >

<bi:DATA_PROVIDER_REF value="DP_1" />

<bi:INFORMATION_ELEMENT_LIST type="ORDEREDLIST" >

<bi:INFORMATION_TYPE type="CHOICE" index="1" value="CHARACTERISTIC_LIST" >

<bi:CHARACTERISTIC_LIST type="ORDEREDLIST" >

<bi:CHARACTERISTIC index="1" value="/RB05/RBHMATNR" text="/RB05/RBHMATNR" />

</bi:CHARACTERISTIC_LIST>

</bi:INFORMATION_TYPE>

</bi:INFORMATION_ELEMENT_LIST>

</bi:INFO_FIELD_ITEM>

Any hints and tips are welcome!

Christian

ChandranGanesan
Active Contributor
0 Kudos

Hello,

see these docs

[How to Use JavaScript for Customized Query View Selection Web-Item Needs in BW3.5, NW2004|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c02f1616-dbce-2a10-7e90-d162d699218f]

[SAP NetWeaver 2004s BEx Web Application Designer: Working with Advanced Capabilities|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b085e86e-2353-2910-0c96-9f6ab693d0e6]

[Web Services within SAP NetWeaver 2004s BI - Create, Discover, and Consume!|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b5536a7f-0d01-0010-2990-834eed67d6e2]

[Tips and Tricks for SAP BIusiness Intelligence Web Applications|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/902c3e76-fc1c-2a10-c4ab-c734b06603ba]

[Web Application Design for NetWeaver 2004s FAQ|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cea68c65-0901-0010-f5a4-fd34189d8078]

[Web API Reference - Release 3.5|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b1089290-0201-0010-288c-98e4d26487ee]

[BEx Web API FAQ|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0e7bce90-0201-0010-e78b-c635673602ba]

Thanks

Chandran