Many tools are available for creating Web templates, but they offer little help when it comes to modifying data in a report or formatting cells. The author introduces you to a little-known interface that allows you to create object-oriented classes to enhance and modify your Web reports. He offers some ABAP and HTML code to modify a report so it will display special graphics in individual cells along with data.
Key Concept
The table interface allows users to modify ABAP-based object-oriented classes for use with Web templates. The table interface can be employed for making modifications in a presentation as well as in specific data sets. While many of you probably use Web BW reporting either to perform testing or in your productive environment, or for both, you may not know about the table interface and how it works. Like a user exit offers a point of entry for additional coding, the table interface allows you to modify, change, or enhance data using HTML and ABAP programming.
Although the cell editor enhancement in the Query Builder in BW 3.x allows you to modify data in any specific report cell, the table interface allows you to modify any part of your query result in the Web environment. Access is permitted before the data is displayed in an Internet browser and you can manipulate any part of a report including formatting such as row or column headers. Changes also can be made to content using new calculations, by adding new information, or via hyperlinks that reference more detailed information, graphics, pictures, etc.
The best part of the table interface is that it works exactly the same with BW 2.x and BW 3.x systems. Because it requires adding some HTML and ABAP coding, however, you should be familiar with each program before attempting to make report modifications via the table interface.
The Table Interface in Action
This simple example illustrates how you can enhance a report with the table interface. When displaying your company’s sales data in a Web report, wouldn’t it be great to add a small graphical indicator such as an arrow showing that sales went up or down compared to another period? The table interface allows you to place this type of graphic into individual report cells.
You can directly load Microsoft Word documents, pictures, and other files as master data attributes in BW 3.x. Flagging a file when maintaining your InfoObjects and master data and uploading the pictures, documents, etc. allows BW to display the same document symbol in all lines selected. With the table interface, you can offer a “live” thumbnail graphic instead of displaying the same static placeholder in each individual line of your reports. An up-to-date picture is retrieved from graphics stored at the master data level instead of a small document symbol.
With a report used to monitor and display disk space of individual BW InfoObjects such as ODS tables, I’ll show you how the table interface can be employed to add easily recognized graphics. I’ll provide you with the code required to add thumbs-up and thumbs-down icons (Figure 1) to reflect disk space availability. The code is available by clicking this link.

Figure 1
Web reports before (left) and after adding graphics (right) using the table interface
Enabling the Table Interface
Before you can use the table interface to gussy up a report, you must provide for the functionality. The table interface is based on ABAP object-oriented (OO) programming and classes. Rather than copying ABAP-OO classes like you copy function modules, you inherit them. With this approach, the inherited class references code from the original class so it can be adapted and changed without losing the functionality that is often lost when copying. Inheriting also eliminates the need to continuously update the code because it is updated automatically when the original class is updated.
Use transaction SE80 to access the Object Navigator in BW. Select Class / Interface (Figure 2), and enter class name CL_RSR_WWW_MODIFY_TABLE
. This class supports the table interface functionality because all reports for the Web access it.

Figure 2
Enter the name of the custom class and save
Inherit class CL_RSR_WWW_MODIFY_TABLE to a class in the customer name space. I recommend keeping the original name intact and adding Z to the prefix to indicate it is a custom class. Enter the new name in the appropriate field (Figure 3) in the Class Builder screen.

Figure 3
Establish that the new object is a class
To create the custom class, click on Yes in the dialog box in Create Object screen. Select the Class button and click on the green check mark icon in the Object Type screen. Then, in the Create Class screen, click on the inherit icon circled in Figure 4. In the next screen, type the name of the original class in the Superclass field, and save the new class.

Figure 4
Inherit the original ABAP-OO class
Modify the Method
The Class Builder allows you to select and modify various Attributes, Methods, Events (such as error messages), and more. You also can view all the relevant methods and parameters for class CL_RSR_WWW_MODIFY_TABLE using the Class Builder. The methods, which include Attribute_Cell, Characteristic_Cell, Data_Cell, etc. are displayed in left frame (Figure 5) and double-clicking on a method reveals its parameters.

Figure 5
Methods are displayed in the left frame and parameters are listed on the right
After creating the new custom ABAP-OO class, you need to modify the DATA_CELL method with some code to display the graphics in your report. Click the Methods tab in the Class Builder screen and select the DATA_CELL method. Redefine the method by clicking on the redefine icon circled in Figure 6.

Figure 6
To modify a method, click on the redefine icon circled above
As I noted earlier, modifying the method requires adding some new code. You must augment the method with a mixture of ABAP and HTML code so you should have some knowledge of each. Add the DATA_CELL code to the method as shown in Figure 7.

Figure 7
Redefined method with custom coding
The custom code saves the value in one column (referred to as the 2nd column in the code) and checks it against the value in another (3rd column). It then displays the appropriate graphic corresponding to which value is higher or lower.
The URL points to graphics uploaded to the MIME Repository but the graphics can be stored anywhere in the system. I suggest using the MIME Repository because it is easily accessible from within BW.
Tip!
To avoid future mistakes, do not manually change any data or formatting in the cells. Only make enhancements by adding code to the table interface as described here.
Note that while you can also calculate new results for your report at the same time that you add the icon, I recommend that you build all your routine calculations into the query using the BEx Query Designer prior to using the table interface. I’m concerned that steps may be omitted over time and you may forget to do these extra calculations in future reports that use the table interface.
After you’ve added the new code and activated the changes in BW, reports must be instructed to use the newly derived class instead of the default class. Change your Web templates in the Web Application Designer (Web AD) by first opening the appropriate report template. Click on the HTML button and add a new parameter telling the Web template to use the customized class instead of the original class. Enter the class name to be specified in the object tag (Figure 8) of the Table Web item or the Generic Navigation Block Web item in the syntax:
<object>
<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="DATAPROVIDER_1"/>
<param name="WIDTH" value="350"/>
<param name="CAPTION" value="Statistic Data ( Table view)"/>
<param name="MODIFY_CLASS"
value="Z_JBO1_CL_RSR_WWW_MODIFY_TABLE"/>
ITEM: TABLE_1
</object>

Figure 8
Add a new parameter to the Web template in Web AD
Save the changes and run the report.
Joerg Boeke
Joerg Boeke is an SAP NetWeaver BW solution architect and senior consultant working with BIAnalyst GmbH & Co.KG, with 19 years experience in SAP NetWeaver BW, having worked on it since SAP BW 1.2A. He offers significant expertise in the SAP NetWeaver BW reporting area, including design, data integration, data visualization, performance optimization, and the cleanup of existing SAP NetWeaver BW systems. He is the author of SAP BW 7.x Reporting - Visualize your data.
You may contact the author at Joerg.boeke@bianalyst.de.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.