Often, there is a need to recreate the same queries and Web reports to change a small feature, such as a different unit of measure. The author shows you how to avoid this by creating one flexible report, containing many similar reports in one report, with the drop-down box functionality of Web Application Designer (3.0 or higher).
You have seen it before; you have heard it before. A business user has requested that you recreate an existing report in BW for the Web using key figures that are different from the existing report in other uniform measurements like dollars, pounds, or kilograms. Chances are likely that other combinations of key figures in different units of measure will eventually lead to the creation of a new query with the same basic characteristic and filter requirements, but with different combinations of key figures in other series of measurements.
Before you resign yourself to creating multiple queries and Web reports, consider the alternative that Web Application Designer (Web AD) 3.0 or higher offers. A customized drop-down box function used with your BEx Analyzer query gives you the flexibility to create several reports in one report, showing each group of key figures by category in a drop- down box in your Web application.
Even though the Web AD has its own standard drop-down box Web feature, it is used mainly for filtering characteristic values and individual key figures. It does not display a series or combination of key figures together. When the item is launched to the Web, you see individual values of a characteristic or each key figure, depending on the usage of the web item. There is little benefit using the item in this way, especially if the navigational block has the same filtering ability.
A snippet of JavaScript code allows the user to create several series of key figure combinations in a drop- down box group. When a user makes a selection from the drop-box menu, the Web application displays several key figures according to your designated grouping or arrangement in the HTML code. Using this JavaScript code to create the drop-down box function eliminates the need to create multiple queries from the same ODS or InfoCube with the same characteristic and filter features. It also allows you to build queries in an efficient, strategic manner, thereby reducing the number of similar queries.
I’ll show you how you can manipulate BEx functions and classes to create a robust Web application template for continuous use. All you need is knowledge of Web function syntax, JavaScript, and HTML. If you don’t have these skills, then someone on your IT team can help you set this up. You can find information on the Web reporting functions in SAP’s online help; search for the document entitled, “Web Reporting Function Description, 14.February 2001 Version 2.0B13.”
First, let me walk you through a query creation using this drop-down box functionality.
How It Works
When you add the most common and similar key figures and navigational/ characteristic attributes that your user community requests in different queries and group them in the same query, you can use a drop-down box to segregate portions of the data based on categories, units of measure, divisions, and so on, creating multiple reports in one application. Figure 1 shows how to do this.
Figure 1
Example of how you might start to build your Web query
Open BEx Analyzer to create a standard query. Select the navigational dimensions or characteristics and any filters needed for the query, then drag and drop the key figures according to measurements (e.g., units, pounds, tons, or dollars) in groups as seen in the Column section of BEx Analyzer.
The query in Figure 1 has a total of 18 columns in the query definition, but nine columns display when you run this query. You need to set up this query with multiple key figures in different versions, measurements, and so on before you can realize the benefits described earlier.
Now that the query is created, you need components from the query for the drop-down box function to work. Execute the query and find the structure that represents the key figures in the query. Then right-click as shown in Figure 2.
Figure 2
Locate the structure that represents your key figures and right-click on it
Note Include at least one navigational characteristic in your query so that the key figure structure appears.
The Select filter value option exposes all the key figures included in the query. If you right-click on any key figure and select the Technical Names option (Figure 3), you see a 25-character alphanumeric string. These alphanumeric strings play an important role in the Web application designing process.
Figure 3
Right-click on a key figure and select Technical Names to find its associated alphanumeric string
To complete the process for the drop-down box function in Web AD, you must secure the 25-character string for the structure that makes up the series of key figures previously selected. This structure is technically known as a filter_objnm parameter in Web AD. Because the 25-character string is not readily available or intuitive to find, an unorthodox but effective way of obtaining it is by launching your query to the Web, as shown in Figure 4.
Figure 4
By clicking on the tools icon, BEx Analyzer launches a plain version of the report to the Web
Find the 25-character string of the key figure structure by placing your mouse over the structure’s drill-down icon in the navigation section, as shown in Figure 5.
Figure 5
By placing your mouse over the drill-sown icon, the filter object number appears at the bottom of the screen
The structure object number (3KBN6IY6MC6ZM0TR2V7U54UPS) that appears at the bottom of the screen (Figure 6) is required in Web AD to toggle among the segregated series of key figures, as you will see later in this article.
Figure 6
The filter object number
Note In lines 10 to 12, technical structure names are specific to each query. Therefore, each technical name and key figure is diffrent.
Note All technical key names are encased in single quotation marks followed by a space. No carriage returns are between filter values in the code. Carriage returns should, however, exist between groupings of code (i.e., units, pounds, and dollars).
As you construct a Web application by dragging and dropping Web items on the layout form, adding the JavaScript code shown in Figure 7 to your HTML code creates the function (lines 2 to 5) and the drop-down box (lines 9 to 13) for your selections or categories. Because the snippets of code below are minimal, any- one familiar with HTML or JavaScript could add them to Web AD. I recommend that JavaScript novices consult with someone in their IT department.
<HEAD>
<script language=”JavaScript”> //This creates the function.//function MM_jumpMenu(targ,selObj,restore){
eval(targ+”.location=’”+selObj.options[selObj.selectedIndex].value+”’”);
}
</script>
</HEAD>
<BODY>
//creates the drop-down box with the selection of dollars, pounds, and dollars as a choice //
<option selected>Select a View</option>
<option value=”<SAP_BW_URL data_provider=’Sample’ filter_iobjnm=’3KBN6IY6MC6ZM0TR2V7U54UPS’ FILTER_COLLAPSE =’X’
Filter_Value_1=’3KD7Z8MMGCJD3ZMYY38CZ8I9S’ Filter_Value_2=’3KD7Z8UAZB52MM6F3XAP9AGZK’
Filter_Value_3=’3KD7Z91ZI9QS58PV9RD1JCFPC’ ITEM=’TABLE_1’ CAPTION=’Units’>”>Units (000)</option>
<option value=”<SAP_BW_URL data_provider=’Sample’ filter_iobjnm=’3KBN6IY6MC6ZM0TR2V7U54UPS’
Filter_Value_1=’3KD7MH8SGW8A5YHDZ17ZNRAM8’ Filter_Value_2=’3KD7MHGGZUTZOL0U4VABXT9C0’
Filter_Value_3=’3KD7MHO5ITFP77KAAPCO7V81S’ ITEM=’TABLE_1’ CAPTION=’Pounds’>”>Pounds </option>
<option value=”<SAP_BW_URL data_provider=’Sample’ filter_iobjnm=’3KBN6IY6MC6ZM0TR2V7U54UPS’
Filter_Value_1=’3KDAVE5ZNI6TIE415U8HYF2PS’ Filter_Value_2=’3KDAVEDO6GSJ10NHBOAU8H1FK’
Filter_Value_3=’3KDAVELCPFE8JN6XHID6IJ05C’ ITEM=’TABLE_1’ CAPTION=’USD’ >”>USD </option>
</select>
</BODY>
Figure 7
JavaScript code to create function and drop-down box
The important part of this code in terms of creating your series or categories of key figures per selection is lines 9 to 13. To familiarize yourself with the syntax of this code, refer to the latest version of “SAP BW, Web Reporting Function Description 14.February 2001 Version 2.0B13” in SAP’s online help. In line 10, SAP_BW_URL creates links that transfer data providers or items from one state to another. In this case, the data provider ‘Sample’ is transferred to a link along with other items you specify.
Remember the unorthodox way you found the structure for the key figures technically known as the parameter filter_iobjnm. That structure is included in the string as one of the variables that is transferred to a Web link. FILTER_COLLAPSE = ‘X’ (line 10) indicates that the series of key figures used will collapse because, as you will see later, this series of key figures serves as the default/filtered view for the Web application. Collapsing it reduces the number of times you see this selection in the application.
The code in line 10 from Filter_Value_1 through Filter_Value_3 contains your 25- character strings that represent each key figure. To recap, you selected key figures for your query and grouped them according to units of measure. In this example, you want to segregate these units of measures by Units, pounds (LBS), then dollars (USD) in the drop-down box menu. From the Notepad document, arrange the key figures (25-character technical names) according to those groups. Then, copy and paste them into the HTML code in Web AD. Copy the technical name of the key figure corresponding to each Filter_Value_# in sequence, as seen in Figure 7.
Each Filter_Value_# in the code represents a different key figure. The first grouping in units (line 10) involves three key figures represented in the 25-character strings enclosed in single quotation marks followed by the table item and the caption for the table. Duplicating the code for the other two categories (in lines 11 and 12) and changing the caption headings completes your selection listing of available options. When you view the Layout tab in Web AD, you should see a drop-down box.
Finally, you must establish your default view, the view that your users want to view first, whether that view is in units, pounds, or dollars. In the SET_DATA_PROVIDER section, which is automatically created when assigning a data provider to a Web application, provide the listing of the default key figures or view that first appears when the Web application is executed. As Figure 8 shows, filter_iobjnm is added, followed by the technical names for the key figures in units.
As a finishing touch, add a CAPTION parameter to the HTML code to show the value for Units in a Web table item, as Figure 9 shows. This allows the correct title along with the columns of key figures in units to display.
Once the application has been validated and the execution to the browser takes place, the Web application makes a few reports available at the press of a button, all in one report.
The default view is Units, but for any selection that is made, the table caption changes, along with the series of key figures for that unit of measure, as shown in Figure 10.
As you make your selection, these series of key figures display working together with navigational drill-downs, filters, swaps, and sorts, so no functionality is limited or lost because of the drop-down box feature. Your application now has the capacity to be a flexible report stacked with views for multiple purposes to all your users.
Dr. Yasan Gooding
Yasan Gooding, Ph.D., is an information systems specialist with Valero Energy Corporation, Inc. He has worked with SAP NetWeaver BW for five years and works on the BW reporting systems front-end team developing, supporting, and gathering new reporting requirements for implementation to Valero's business units. He is a graduate of Saint Augustine's College and Iowa State University with majors in computer science and education.
Web Application Designer: Create Multiple Reports from One Report with a Drop-Down Box Function
Published: 01/February/2004
Reading time: 18 mins
Often, there is a need to recreate the same queries and Web reports to change a small feature, such as a different unit of measure. The author shows you how to avoid this by creating one flexible report, containing many similar reports in one report, with the drop-down box functionality of Web Application Designer (3.0…
This website uses cookies. If you continue to use the site you consent to our use of cookies in accordance with our Cookie Policy.ACCEPTRead More
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.