How to … create a Multiple selection with a Selection List Item

How to…

Create Multiple Selections with a Selection List Item in Web Reporting

Business Information Warehouse

ASAP “How to…” Paper

Applicable Releases: BW 2.0B, 2.1C

May 2001

1998 SAP America, Inc. and SAP AGTable of Contents

How to … create a Multiple selection with a Selection List Item

1Business Scenario

You want to use a selection list in a Web Reporting template to choose filter values. In contrast to standard selection, you want to be able to select more than one value to be sent to the BW server as filter values.

2The Result

You obtain a Web report with an output table. There is a selection list for filtering by the 'plant' characteristic. You can choose more than one value. As soon as you click on the 'Apply Filter Values' button, the output of the table is modified in line with the filter. The graphic below shows the report before you apply the filter.

Below you can see the results of the filter. The filter values chosen are displayed in the first line of the selection list. The results table has been modified in line with the filter. Note that the filter has not collapsed the plant list. You can only collapse the plant list by using the FILTER_COLLAPS=’ ‘ command in the command URL (see the coding example in 3.2).

3The Step By Step Solution

3.1Generate the Web template for your report

1.Generate a workbook and save a corresponding query view. /
2.Start the Web Publisher and position an item as a table. /
3.Now position another item as a selection list. This item should be displayed without a title. The underlying characteristic is 0PLANT. You must also activate the option 'Display Only Values'. /
4.Generate a Web template containing both items. You can do this with a wizard, or manually. /
5.Check out the Web template and modify it as specified in section 3.2.
6.Then check the template in again .
7.Start the template in the browser. There is now a selection list that allows you to make multiple value selections. /

3.2Coding Example for a Web Template

The segments of the following template coding that are in blue must be added manually after the template has been generated using the Publisher wizard.

<HTML>

<HEAD>

<link rel = "stylesheet" href= "/sap/its/mimes/webrfc/bw/BwReports.css"
type="text/css">

<!-- JavaScript function to create the command URL -->

<SCRIPT language="JAVASCRIPT">

function Submit_Form_1() {

var url = "<SAP_BW_URL DATA_PROVIDER='*' MULTI='X' FILTER_COLLAPS=' '>";

for (var i = 0, j = 1; i < document.form_1.select_1.options.length; i++)

{

if (document.form_1.select_1.options[i].selected) {

url = url +

"&filter_iobjnm_" +

j +

"=0PLANT" +

"&filter_value_" +

j++ +

"=" +

document.form_1.select_1.options[i].value;

}

}

document.form_1.action=url

}

</SCRIPT>

</HEAD>

<BODY>

<!-- Data Provider Tag -->

<object>

<param name='OWNER' value='SAP_BW'>

<param name='CMD' value='SET_DATA_PROVIDER'>

<param name='DATA_PROVIDER' value='Initial'>

<param name='VIEWID' value='Initial'>

<param name='DATA_PROVIDER_WBID' value='13YZ01ZCGUKWJZC7GZKXDLL81'>

DATA_PROVIDER :Initial

</object>

<form name="form_1" onSubmit="Submit_Form_1()" method="post">

<select name="select_1" multiple size="5">

<!-- Selection List Item -->

<object>

<param name='OWNER' value='SAP_BW'>

<param name='CMD' value='GET_ITEM'>

<param name='ITEM' value='Sel_List_01'>

<param name='ITEMID' value='Sel_List_01'>

<param name='ITEMWBID' value='13YZ01ZCGUKWJZC7GZKXDLL81'>

<param name='DATA_PROVIDER' value='Initial'>

ITEM :Sel_List_01

</object>

</select>

<input type="SUBMIT" value="Apply Filter Values">

</form>

<!-- Table Item Tag -->

<object>

<param name='OWNER' value='SAP_BW'>

<param name='CMD' value='GET_ITEM'>

<param name='ITEM' value='Tab_01'>

<param name='ITEMID' value='Tab_01'>

<param name='ITEMWBID' value='13YZ01ZCGUKWJZC7GZKXDLL81'>

<param name='DATA_PROVIDER' value='Initial'>

ITEM :Tab_01

</object>

</BODY>

</HTML>

2001 SAP America, Inc. and SAP AG1