cancel
Showing results for 
Search instead for 
Did you mean: 

Webreporting - more than one DataProvider - Switch with Command URL

Former Member
0 Kudos

Hi all,

i am using a web template with

2 charts (CHART_1 and CHART_2) with DATAPROVIDER_1

and

2 tables (TABLE_1 and TABLE_2! with DATAPROVIDER_2

I use a command url to switch between Table_1/Chart_1 and Table_2/Chart_2.

So now my BIG PROBLEM:

In the web template it is possible to make a printout/mail/export to excel by clicking on buttons! Problem is that the CommandURLs behind those buttons only works with dataprovider1 (code). So if i make Chart2/Table2 visible and hide table1/chart1 the buttons will work but only with dataprovider1! Is it possible to use a variable in command url where only the visible dataprovider will be used? HELP! In other words. If dataprovider2 is used the buttons (print/mail/excel) will work with dataprovider2?

Thanks in advance,

M. Erbil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mehmetali,

copy&paste the attached coding in your html-body.

Below the "visible" table you will find the buttons for switch between TABLE_1 / TABLE_2 and a variable export button.

best regards

Jens

<BODY>

<object>

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

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

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

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

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

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

ITEM: TABLE_2

</object><object>

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

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

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

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

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

ITEM: TABLE_1

</object>

<A class=SAPBEXBtnEmph href="<SAP_BW_URL item='TABLE_2' hidden='X' cmd_1='item=TABLE_1&hidden='>">&nbsp;Show Table 1</A>

<A class=SAPBEXBtnEmph href="<SAP_BW_URL item='TABLE_2' hidden='' cmd_1='item=TABLE_1&hidden=X'>">&nbsp;Show Table 2</A>

<SCRIPT language="JavaScript">

<!--

var prop = SAPBWGetItemProp("TABLE_1");

var hidden = true;

if (prop != null){

for(i=1;i<prop.length;i++){

if (prop<i>[0] == "HIDDEN") hidden = (prop<i>[1] == "X");

}

}

if (hidden) {

document.write('<A class=SAPBEXBtnEmph href="<SAP_BW_URL DATA_PROVIDER='DATAPROVIDER_2' CMD='EXPORT' FORMAT='XLS'>">&nbsp;Export Table</A>');

}

else {

document.write('<A class=SAPBEXBtnEmph href="<SAP_BW_URL DATA_PROVIDER='DATAPROVIDER_1' CMD='EXPORT' FORMAT='XLS'>">&nbsp;Export Table</A>');

}

--->

</SCRIPT>

</BODY>

Former Member
0 Kudos

Hi Jens,

but what if i use three or more table?

Regards,

M. Erbil

Former Member
0 Kudos

Hi,

then you must change your javascript and the command url...

try it again with following coding:


regards

Jens

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Mehmetali,

That's odd. I just tested the 'exoport' command and when specifying the dataprovider it exported that dataproviders information to an Excel file. (example <a href="<SAP_BW_URL DATA_PROVIDER='DATAPROVIDER_2' CMD='EXPORT' FORMAT='XLS'>">Export</a>). Are you specifying the dataprovider on your command URLs?

Regards,

Oliver

Former Member
0 Kudos

Hi,

I want to use only one command url! Like:

<a href="<SAP_BW_URL DATA_PROVIDER='VARIABLEFORVISIBLEDP' CMD='EXPORT' FORMAT='XLS'>">Export</a>

This should be possible with javascript?

One variable should hold the visible DP!

I dont want to use 2 butttons. Just one.

Regards,

M. Erbil!

Message was edited by: Mehmetali Erbil

Adem_Baykal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi M. Erbil,

i think you are searching something like this:

<script language="Javascript">

var bla = "www.sap.html";

document.write('<a href=' + bla + '>click me');

</script>

Its only a hint

Regards,

Adem

Former Member
0 Kudos

Hi Adem,

thank you very much - Thats not a solution but a very good hint. I will try to make a workable version of coding. Hope it works. Otherwise i will ask you again. Thanks man. Regards,

M. Erbil

Former Member
0 Kudos

Hi Adem,

thank you very much - Thats not a solution but a very good hint. I will try to make a workable version of coding. Hope it works. Otherwise i will ask you again. Thanks man. Regards,

M. Erbil.

Adem_Baykal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Before i forget:

var bla;

if (document.getElementById("TABLE_1").style.visibility="visible"){

bla = "page1.html";

}

else {

bla = "page2.html"

}

Regards,

Adem