Skip to Content
0
Former Member
May 17, 2007 at 02:49 PM

Compound value from BPS to BW

16 Views

Hi

I am using an SEM BPS web application and wish to pass multiple variable to BW Web application so to display a report. I need to compound my profit center field with controlling area but cannot work out how to amend the example code on the "How-To" guide. Can any help with this. Code is below:

Thanks

Simon

<iframe

id ="myWebAppl"

src="/sap/bw/BEx?cmd=ldoc&TEMPLATE_ID=MYTEMPLATE"

style="width:800;height:600">>

</iframe>

<script language="JavaScript" type="text/javascript">

function varValueConvert(dispValue){

/* Expected formatting of variable selector: Text(Key) or Key

If there are more than one (...) expression the first is taken.

*/

var keySection = dispValue.match(/\(.*?\)/);

if (keySection){

var keyValue = keySection[0].replace(/\(|\)/g,"");

alert(dispValue + ' : ' + keySection + " : " +keyValue);

return keyValue;

} else {

alert(dispValue);

return dispValue;

}

}

var frame = document.getElementById( 'myWebAppl' );

var url = '/sap/bw/BEx?cmd=ldoc&TEMPLATE_ID=';

var queryVar1 = '&VAR_NAME_1=0PROFIT_CTR&VAR_VALUE_EXT_1=';

var queryVar2 = '&VAR_NAME_2=0VERSION&VAR_VALUE_EXT_2=';

var queryVar3 = '&VAR_NAME_2=0FISCYR&VAR_VALUE_EXT_2=';

var appl = 'XBPSWEBAPP2';

var bpsVarvl1 = '<%=descr(VarCountry/value)%>';

var bpsVarvl2 = '<%=descr(VarVersion_Customer/value)%>';

var bpsVarvl3 = '<%=descr(VarFY_Customer/value)%>';

bpsVarvl1 = varValueConvert(bpsVarvl1);

bpsVarvl2 = varValueConvert(bpsVarvl2);

bpsVarvl3 = varValueConvert(bpsVarvl3);

// create URL

url = url + appl + queryVar1 + bpsVarvl1 + queryVar2 + bpsVarvl2 + queryVar2 + bpsVarvl3;

// remove possible white spaces

url = url.replace(/ /,"");

// alert('Generated URL: ' + url);

// set source attribute of iframe to new URL

frame.src = url;

</script>