Skip to Content
author's profile photo
Former Member

javascript and bex

Hello All,

There are four steps in my web application;

1> Instead of the standard navigation block web item , we would like to use the normal html drop down box for the filter values.

This step is done, but the html drop down box displays an extra option value apart from the existing filter value, i.e it displays (All) as well apart from the standard filter values.

How Can I remove (All)the same from the drop down box??

2> On the same web template , below the drop down boxes there are four buttons which point to different web templates(queries).

All the reports have a similar selection criteria.Based on the values that the user selects in the drop down box and press oneof the buttons, the query corresponding to that web template should be shown

Ths step is partially done, I am able to go to the desired web template but am unable to pass the values for the filter selection.

On the button click I am generating a url at run time and in the url I am adding the filter selection criteria(based on command urls)

The web template opens but it is not filtered according to the values selected in the drop down box.

3> when the web template opens the drop down box value that was selected on the previous page should be set by default in the new web template, however the values in the drop down box does not appear to be selected.

4>if I select a numeric value like a financial year then the value persists in the drop down box without any extra coding or effort.Is it possible for other drop down boxes as well.

The code for my template is as mentioned below:

<HTML>

<!-- BW data source object tags -->

<object>

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

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

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

<param name="QUERY" value="ZIB_DEFAULT_FY"/>

<param name="INFOCUBE" value="ZIB_RPT"/>

DATA_PROVIDER: DATAPROVIDER_1

</object>

<object>

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

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

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

<param name="QUERY" value="ZIB_DEFAULT_FY_CNT"/>

<param name="INFOCUBE" value="ZIB_RPT"/>

DATA_PROVIDER: DP_BPP_DEFFYC

</object>

<object>

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

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

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

<param name="QUERY" value="ZIB_DEFAULT_FY"/>

<param name="INFOCUBE" value="ZIB_RPT"/>

DATA_PROVIDER: DB_BPP_DEFF

</object>

<object>

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

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

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

<param name="DATA_PROVIDER_ID" value=""/>

DATA_PROVIDER: DB_BPP_DEFFYC

</object>

<object>

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

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

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

<param name="QUERY" value="ZIB_DEFAULT_FY"/>

<param name="INFOCUBE" value="ZIB_RPT"/>

DATA_PROVIDER: DB_BPP_DEFFY

</object>

<object>

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

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

<param name="TEMPLATE_ID" value="ZIV_ZIB_RPT_ACTDFY_PB34023"/>

TEMPLATE PROPERTIES

</object>

<SCRIPT language="JavaScript">

var varFilter1="";

var varFilter2="";

var varFilter3="";

var varFilter4="";

var varFilter5="";

var varFilter6="";

var varFilter7="";

var varFilter8="";

var staticUrl="http://myserver:myport/sap/bw/BEx?SAP-LANGUAGE=E&CMD=ldoc";

var filterUrl="";

var templateUrl="";

var showUrl="";

var filterUrl1="";

function getValues()

{

varFilter1=document.frmName.FILTER_VALUE_1.options[document.frmName.FILTER_VALUE_1.selectedIndex].value;

varFilter2=document.frmName.FILTER_VALUE_2.options[document.frmName.FILTER_VALUE_2.selectedIndex].value;

varFilter3=document.frmName.FILTER_VALUE_3.options[document.frmName.FILTER_VALUE_3.selectedIndex].value;

varFilter4=document.frmName.FILTER_VALUE_4.options[document.frmName.FILTER_VALUE_4.selectedIndex].value;

varFilter5=document.frmName.FILTER_VALUE_5.options[document.frmName.FILTER_VALUE_5.selectedIndex].value;

varFilter6=document.frmName.FILTER_VALUE_6.options[document.frmName.FILTER_VALUE_6.selectedIndex].value;

varFilter7=document.frmName.FILTER_VALUE_7.options[document.frmName.FILTER_VALUE_7.selectedIndex].value;

varFilter8=document.frmName.FILTER_VALUE_8.options[document.frmName.FILTER_VALUE_8.selectedIndex].value;

}

function getFilterUrl()

{

if (varFilter1=="(All)")

filterUrl=filterUrl;

else

filterUrl= filterUrl"&FILTER_IOBJNM_1=0SALES_OFF&FILTER_VALUE_1="varFilter1;

if (varFilter2=="(All)")

filterUrl=filterUrl;

else

filterUrl=filterUrl"&FILTER_IOBJNM_2=ZFISCYR&FILTER_VALUE_2="varFilter2;

if (varFilter3=="(All)")

filterUrl=filterUrl;

else

filterUrl=filterUrl"&FILTER_IOBJNM_3=ZFISCMON&FILTER_VALUE_3="varFilter3;

if (varFilter4=="(All)")

filterUrl=filterUrl;

else

filterUrl=filterUrl"&FILTER_IOBJNM_4=OSALES_GRP&FILTER_VALUE_4="varFilter4;

if (varFilter5=="(All)")

filterUrl=filterUrl;

else

filterUrl=filterUrl"&FILTER_IOBJNM_5=ODOC_TYPE&FILTER_VALUE_5="varFilter5;

if (varFilter6=="(All)")

filterUrl=filterUrl;

else

filterUrl=filterUrl"&FILTER_IOBJNM_6=ZPRDTY&FILTER_VALUE_6="varFilter6;

if (varFilter7=="(All)")

filterUrl=filterUrl;

else

filterUrl=filterUrl"&FILTER_IOBJNM_7=ZLDSRC&FILTER_VALUE_7="varFilter7;

if (varFilter8=="(All)")

filterUrl=filterUrl;

else

filterUrl=filterUrl"&FILTER_IOBJNM_8=OPMNTTRMS&FILTER_VALUE_8="varFilter8;

}

function show1()

{

getValues();

templateUrl="&TEMPLATE_ID=ZIV_ZIB_RPT_ACTDFY_PB34023";

getFilterUrl();

showUrl=staticUrltemplateUrlfilterUrl;

alert(showUrl);

SAPBWOpenURL(showUrl);

}

function show2()

{

getValues();

templateUrl="&TEMPLATE_ID=ZIV_ZIB_RPT_ATB_DTC_PB34023";

getFilterUrl();

showUrl=staticUrltemplateUrlfilterUrl;

SAPBWOpenURL(showUrl);

}

function show3()

{

getValues();

templateUrl="&TEMPLATE_ID=ZIV_ZIB_RPT_PD_RISK_PB34023";

getFilterUrl();

showUrl=staticUrltemplateUrlfilterUrl;

SAPBWOpenURL(showUrl);

}

function show4()

{

getValues();

templateUrl="&TEMPLATE_ID=ZIV_ZIB_DA_DEFAULT_ANALYSIS_PB34023";

getFilterUrl();

showUrl=staticUrltemplateUrlfilterUrl;

SAPBWOpenURL(showUrl);

}

function show5()

{

getValues();

templateUrl="&TEMPLATE_ID=ZIV_ZIB_RPT_ACTDFY_PB34023";

getFilterUrl();

showUrl=staticUrltemplateUrlfilterUrl;

alert(showUrl);

SAPBWOpenURL(showUrl);

}

</SCRIPT><HEAD>

<META NAME="GENERATOR" Content="Microsoft DHTML Editing Control">

<TITLE>BW Web Application</TITLE>

<link href= "/sap/bw/Mime/BEx/StyleSheets/BWReports.css" type="text/css" rel="stylesheet"/>

</HEAD>

<BODY>

<form name="frmName" method="post" action="http://myserver:myport/sap/bw/BEx?bw/BEx?SAP-LANGUAGE=E&amp;CMD=ldoc&amp;TEMPLATE_ID=ZIV_ZIB_RPT_ACTDFY_PB34023&amp;FILTER_IOBJNM_1=0SALES_OFF&amp;FILTER_VALUE_1=&amp;FILTER_IOBJNM_2=ZFISCYR&amp;FILTER_VALUE_2=&amp;FILTER_IOBJNM_3=ZFISCMON&amp;FILTER_VALUE_3=&amp;FILTER_IOBJNM_4=OSALES_GRP&amp;FILTER_VALUE_4=&amp;FILTER_IOBJNM_5=ODOC_TYPE&amp;FILTER_VALUE_5=&amp;FILTER_IOBJNM_6=ZPRDTY&amp;FILTER_VALUE_6=&amp;FILTER_IOBJNM_7=ZLDSRC&amp;FILTER_VALUE_7=&amp;FILTER_IOBJNM_8=OPMNTTRMS&amp;FILTER_VALUE_8=ZB02">

<B> Wel COme to BPA Attachment Rate Calculator </B>

<table border="1">

<TBODY>

<tr>

<td>

<b>Sales Office</b><select name="FILTER_VALUE_1" size="1" type="MULTIPLE">

<object>

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

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

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

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

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

<param name="GENERATE_CAPTION" value=""/>

<param name="IOBJNM" value="0SALES_OFF"/>

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

ITEM: DROPDOWNBOX_1

</object>

</select>

</td>

<td>

<b>Fiscal Year</b><select name="FILTER_VALUE_2" size="1">

<object>

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

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

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

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

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

<param name="GENERATE_CAPTION" value=""/>

<param name="IOBJNM" value="ZFISCYR"/>

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

ITEM: DROPDOWNBOX_2

</object>

</select>

</td>

<td>

<b>Fiscal Month</b><select name="FILTER_VALUE_3" size="1">

<object>

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

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

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

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

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

<param name="GENERATE_CAPTION" value=""/>

<param name="IOBJNM" value="ZFISCMON"/>

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

ITEM: DROPDOWNBOX_3

</object>

</select>

</td>

<td>

<b>Sales Group</b><select name="FILTER_VALUE_4" size="1">

<object>

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

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

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

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

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

<param name="GENERATE_CAPTION" value=""/>

<param name="IOBJNM" value="0SALES_GRP"/>

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

ITEM: DROPDOWNBOX_4

</object>

</select>

</td>

</tr>

<tr>

<td>

<b>Sales Document Type</b><select name="FILTER_VALUE_5" size="1">

<object>

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

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

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

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

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

<param name="GENERATE_CAPTION" value=""/>

<param name="IOBJNM" value="0DOC_TYPE"/>

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

ITEM: DROPDOWNBOX_5

</object>

</select>

</td>

<td>

<b>Product Type</b><select name="FILTER_VALUE_6" size="1">

<object>

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

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

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

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

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

<param name="GENERATE_CAPTION" value=""/>

<param name="IOBJNM" value="ZPRDTY"/>

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

ITEM: DROPDOWNBOX_6

</object>

</select>

</td>

<td>

<b>Lead Sources</b><select name="FILTER_VALUE_7" size="1">

<object>

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

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

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

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

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

<param name="GENERATE_CAPTION" value=""/>

<param name="IOBJNM" value="ZLDSRC"/>

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

ITEM: DROPDOWNBOX_7

</object>

</select>

</td>

<td>

<b>Payment Terms</b><select name="FILTER_VALUE_8" size="1">

<object>

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

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

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

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

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

<param name="GENERATE_CAPTION" value=""/>

<param name="IOBJNM" value="0PMNTTRMS"/>

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

ITEM: DROPDOWNBOX_8

</object>

</select>

</td>

</tr>

</TBODY></table>

<input type="submit" value="Go">

</form>

<input type="submit" value="Aged Trial Balance" onClick="show1()">

<input type="submit" value="DTC ATB " onClick="show2()">

<input type="submit" value="Risk Assessment " onClick="show3()">

<input type="submit" value="Default Clearing By Month " onClick="show4()">

<input type="submit" value="Current Fiscal Year" onClick="show5()">

<P><object>

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

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

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

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

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

<param name="WIDTH" value="634"/>

<param name="HEIGHT" value="296"/>

<param name="TITLE_CATEGORIES" value="Aging"/>

<param name="TITLE_VALUES" value="Dollars"/>

<param name="TMP_CHART_DATA_HANDLE" value="IIP_3W6PHPIFD5VK4XZNKS2ZDG00C"/>

ITEM: CHART_1

</object></P>

<P><object>

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

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

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

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

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

ITEM: TB_BPP_DEFFY

</object><object>

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

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

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

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

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

ITEM: TB_BPP_DEFFYC

</object></P>

</BODY>

</HTML>

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Dec 22, 2004 at 11:00 PM

    Hi,

    I have applied the SAP Note and the values in the drop down box are coming fine.

    Now the generated url is

    /sap/bw/BEx?SAP-LANGUAGE=E&PAGENO=28&REQUEST_NO=1&CMD=LDOC&TEMPLATE_ID=ZPB34023_FILTERS_04&FILTER_IOBJNM_8=OPMNTTRMS&FILTER_VALUE_8=ZB02

    Right now it contains only one filter value since I had selected only one filter value.

    For the whole day I had used various other options like using values in stead of filters, using command for submitting values.

    I even did the steps of the document "how to use drop down box to set variable value" even it dodnt work..

    let me now where am I going wrong? or if this functionality is actually achievable in SAP WAD and bex or not?

    let me know if we could discuss this topic offline?

    Thanks and Regards

    Pradeep Bhojak

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Heike,

      One more ::

      I have opened up a window using the following code

      url=SAP_BW_URL_Get() + "&CMD=LDOC&TEMPLATE_ID=my_template_name";

      SAPBWOpenWindow(url,"Filter",800,600);

      The opened window conains the drop down boxes for selecting the filter values.

      I am fetching values the selected values from the drop down boxes on the clck of a button.

      I am getting that and am able it to pass it to the original window.

      My problem is I am unable to close the opened window using any of the close methods

      SAPBWCloseWindow();

      or close();

      Could you please tell me as to how can I close the opened window?

      Thanks and Regards

      Pradeep Bhojak

      Message was edited by: Pradeep Bhojak

      solved it onmy own

      window.close() works

  • author's profile photo
    Former Member
    Posted on Dec 22, 2004 at 07:33 AM

    Hi,

    1) Parameter NO_REMOVE_FILTER http://help.sap.com/saphelp_nw04/helpdata/en/c0/de413a51ce2e3ae10000000a11402f/frameset.htm and note 597042

    2) Please post the url which has been generated. Very difficult to see an error just by looking on the coding

    3) Should work when the filters are parsed correctly.

    General remark: Please change

    var staticUrl="http://myserver:myport/sap/bw/BEx?SAP-LANGUAGE=E&CMD=ldoc";

    to

    var staticUrl="<SAP_BW_URL CMD='ldoc'>";

    Hard coded urls will give you problems.

    Heike

    Add comment
    10|10000 characters needed characters exceeded