Skip to Content
author's profile photo Former Member
Former Member

Multiple BPS variables in Bex web report

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>

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Oct 18, 2005 at 10:31 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Marc,

      I have tried the change, without success.

      The BPS variables seem to be working as I get a popup for every variable with the correct value.

      the value is not "picked up" in the BW report.

      Regards

      Gert

  • Posted on Oct 19, 2005 at 11:59 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • this how the url should be

      /sap/bw/BEx?cmd=ldoc&TEMPLATE_ID=XXXXX&FILTER_IOBJNM_1=0COMPANY&FILTER_VALUE_EXT_1=999&FILTER_IOBJNM_2=0FISCYEAR&FILTER_VALUE_2=K42006

      wherw XXXXX is your template id name

      By the way, are you trying to use a <b>bex report</b> or a <b>bex app</b>?

      Hope this helps

      -NS

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.