Showing results for 
Search instead for 
Did you mean: 

Query View Selector Item followup command

Former Member
0 Kudos

In the same manner in which you can issue two commands at once, e.g. CMD= and CMD_1=, can you attach a followup command to the Query View Selector? Or invoke javascript?

There are a couple of things I would like to do. One is to re-post the Variables Screen upon invocation of the new view. The other would be to invoke a specific query variant along with the view.

Thanks in advance,


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The query view selector generates the cod ebehind it in the ABAP class, so there isn't a direct way to do this. You can use an html form (dropdown, listbox, etc...) and have that call the same commands that the query view selector calls. This will allow you to replicate the functionality and post additional commands by choosing a query view. The other option is actually running a javascript function on the load of the page. This javascript function will call the function "SAPBWGetItemProp" and that will return the query view that is selected. If that query view is selected, then you can additionally execute another command. The problem with that approach, is the screen may flicker once every time this multiple command is running, so the html form is a better approach (unless you have a lot of views and maintaining the html form is tedious).

Former Member
0 Kudos

Hi Prakash,

I alsmost see what you are talking about with the forms approach. Could you cut and paste something similar, or a reference example, to show where to start? I can't see how SAPBWGetItemProp would accomplish anything similar to what was required.


Former Member
0 Kudos

Here is an example of using a formlist. I created a template with a simple example that switches between 2 views. There is one major downside with using view that usually leads me to avoid using them. When you switch to another view, any filter values that were set in the web template are then lost as you switch to the new view, as the view stores all it's filters. You can pass the filter values over, but that's quite a bit of work. Therefore, I usually try to use the SET_NAV_STATE command to change the current view to my new view. This now dynamically can change the view to be another view just by specifying what your drilldown state is. It's far more powerful. I'll post an example using the SAPBWGetItemProp method next...


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


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

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

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

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




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

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

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




<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"/>

<script type="text/javascript">

/* Changes the View */


function SAPFilter(unitname)


switch (unitname) {

case "1":



case "2":



case "3":








<form name="dropdownlist2" method="post" action="">

<select name="viewval" class="SAPBexDdl" onChange="JavaScript:SAPFilter(this.value);" size="1" >

<option value="0"> Select View </option>

<option value="1"> View 1 </option>

<option value="2"> View 2 </option>

<option value="3"> View 3 </option>

</select> </form>


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

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

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

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

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





Former Member
0 Kudos

Very Nice, Prakash.



Answers (0)