on 10-17-2005 12:49 PM
Hi Guys,
I am trying to have a Bex report use the BPS variables in the web interface. I have managed to do so with 1 variable, but we have a number of variables.
I have created the code below to get the result. however this doesn't seem to work.
Can anyone help me with this issue.
Gert van de Vreede
<iframe
id ="Z_WA_BPS_GRSALPR001"
src="/sap/bw/BEx?cmd=ldoc&TEMPLATE_ID=Z_WA_BPS_GRSALPR001"
style="width:1200;height:300">>
</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( 'Z_WA_BPS_GRSALPR001' );
var url = '/sap/bw/BEx?cmd=ldoc&TEMPLATE_ID=';
var queryVar1 = '&VAR_NAME_1=0SALESORG&VAR_VALUE_EXT_1=';
var queryVar2 = '&VAR_NAME_2=ZZHOUSE&VAR_VALUE_EXT_2=';
var queryVar3 = '&VAR_NAME_3=ZZBRAND&VAR_VALUE_EXT_3=';
var queryVar4 = '&VAR_NAME_4=ZZLINE&VAR_VALUE_EXT_4=';
var queryVar5 = '&VAR_NAME_5=ZCOREC&VAR_VALUE_EXT_5=';
var queryVar6 = '&VAR_NAME_6=ZSUBCAT&VAR_VALUE_EXT_6=';
var queryVar7 = '&VAR_NAME_7=ZZMARCAT&VAR_VALUE_EXT_7=';
var queryVar8 = '&VAR_NAME_8=0VERSION&VAR_VALUE_EXT_8=';
var appl = 'Z_WA_BPS_GRSALPR001';
var bpsVarvl1 = '<%=descr(salesorg_var/value)%>';
var bpsVarvl2 = '<%=descr(House_var/value)%>';
var bpsVarvl3 = '<%=descr(Brand_var/value)%>';
var bpsVarvl4 = '<%=descr(Line_var/value)%>';
var bpsVarvl5 = '<%=descr(Core_cat_var/value)%>';
var bpsVarvl6 = '<%=descr(Sub_cat_var/value)%>';
var bpsVarvl7 = '<%=descr(marcat_var/value)%>';
var bpsVarvl8 = '<%=descr(VarvlSel7/value)%>';
bpsVarvl1 = varValueConvert(bpsVarvl1);
bpsVarvl2 = varValueConvert(bpsVarvl2);
bpsVarvl3 = varValueConvert(bpsVarvl3);
bpsVarvl4 = varValueConvert(bpsVarvl4);
bpsVarvl5 = varValueConvert(bpsVarvl5);
bpsVarvl6 = varValueConvert(bpsVarvl6);
bpsVarvl7 = varValueConvert(bpsVarvl7);
bpsVarvl8 = varValueConvert(bpsVarvl8);
// create URL
url = url + appl + 0SALESORG + bpsVarvl1 + ZZHOUSE + bpsVarvl2 + ZZBRAND + bpsVarvl3 + ZZLINE + bpsVarvl4 + ZCOREC + bpsVarvl5 + ZSUBCAT + bpsVarvl6 + ZZMARCAT + bpsVarvl7 + 0VERSION + bpsVarvl8;
// remove possible white spaces
url = url.replace(/ /,"");
// alert('Generated URL: ' + url);
// set source attribute of iframe to new URL
frame.src = url;
</script>
I had a similar problems. The causes & findings were
1. I had fiscal period and I did not pass fiscal year variant. In other words, for compounded characteristics, pass both the values.
2. I had some wrong assignments, Checked those by using alert url
3. There is a limitation on the size of url string, believe it is 200 or 250. Find out if you exceed the length.
Hope this helps
-NS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gert,
the following line is wrong:
url = url + appl + 0SALESORG + bpsVarvl1 + ZZHOUSE +
bpsVarvl2 + ZZBRAND + bpsVarvl3 + ZZLINE +
bpsVarvl4 + ZCOREC + bpsVarvl5 + ZSUBCAT +
bpsVarvl6 + ZZMARCAT + bpsVarvl7 + 0VERSION +
bpsVarvl8;
Try this:
url = url + appl + '0SALESORG' + bpsVarvl1 + 'ZZHOUSE' +
bpsVarvl2 + 'ZZBRAND' + bpsVarvl3 + 'ZZLINE' +
bpsVarvl4 + 'ZCOREC' + bpsVarvl5 + 'ZSUBCAT' +
bpsVarvl6 + 'ZZMARCAT' + bpsVarvl7 + '0VERSION' + bpsVarvl8;
Regards
Marc
SAP NetWeaver RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.