You are on page 1of 11

How to

Hide a Column in your Web Query with the Table Interface


BUSINESS INFORMATION WAREHOUSE

ASAP "How to " Paper

Valid from: December 2002


Applicable Releases: BW 3.0B
SAP (SAP America, Inc. and SAP AG) assumes no responsibility for errors or omissions in these materials. These materials are provided as is without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. mySAP BI How-To papers are intended to simplify the product implementation. While specific product features and procedures typically are explained in a practical business context, it is not implied that those features and procedures are the only approach in solving a specific business problem using mySAP BI. Should you wish to receive additional information, clarification or support, please refer to SAP Professional Services (Consulting/Remote Consulting).

HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE

1 Business scenario
(1) You are a BW consultant for an e-intelligence project and have the task of changing the layout of a BW Web report. In particular you want to concatenate 2 different items of information (DocumentNumber and Document Item) in one column, and hide the column that provides the additional information (Document Item). (2) The Web report has 7 columns in total. The first column is hidden (see point 1). The Web report output has 6 columns and you need to add CRs (carriage returns) after 3 columns.

2 The result
The solution of the first subtask is based on a Web report. In the first column, the Document Number and the Document Item are displayed. The Document Item is read from the hidden first column Document Item.

After 3 columns a CR is added.

2002 SAP AMERICA, INC. AND SAP AG

HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE

3 The step by step solution


3.1 Query definition

1. An InfoCube exists that contains at least 6 characteristics and 1 key figure. For this example, we will use an InfoCube that has the characteristics: 0CALDAY 0MATERIAL 0MATL_GROUP 0CUSTOMER 0DOC_ITEM 0DOC_NUM and the key figure: 0AMOUNT A query is created on the basis of this InfoCube. Therefore, the function Table Display used.

2. The first columns will be hidden. In this case it is 0DOC_ITEM.

The result lines are always suppressed.

2002 SAP AMERICA, INC. AND SAP AG

HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE

3. Do not flag the option Hide Repeated Key Values in the Query Properties.

3.2

Publishing a query on the Web

4. The Query is published on the Web with the Web Application Designer.

5. Use the table Web Item and use Drag & Drop to move it with to the right Template.

6. Select the DataProvider. (The query created in point 1.)

2002 SAP AMERICA, INC. AND SAP AG

HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE

7. In the Web template, the table ITEM should be changed. The following tag is added
<param name="MODIFY_CLASS" value="ZHCOLAPP">

ZHCOLAPP is the name of the class that changes the Web task later during Web template runtime (see below).

8. Do not Flag Suppress Repeated Texts

9. Save the Web template

2002 SAP AMERICA, INC. AND SAP AG

HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE

3.3

Creating the class ZHCOLAPP in the BW system

10. Log on to the BW system. Classes are created in transaction SE24 (Class Builder). You can create the class ZHCOLAPP here.

Choose 'class' as the object type.

11. The class ZHCOLAPP takes the same properties as the superclass CL_RSR_WWW_MODIFY_TABLE. Click Superclass in the Properties of the Class Interface. If the class is to be transported, you must assign the class to a customer development class when you create it. Activate the Class.

2002 SAP AMERICA, INC. AND SAP AG

HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE

12. Cross-method attributes/tables are defined on the tab page 'attributes'. The attribute name is I_DCOITEM Activate the class

13. Various methods are given for this class. The following methods must be redefined: CAPTION_CELL CHARACTERISTIC_CELL

These methods are defined in the superclass, yet do not contain any programming logic. 14. First of all, the method CAPTION_CELL is implemented. Position the cursor on the name of the method and click on 'Redefine'.

2002 SAP AMERICA, INC. AND SAP AG

HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE

15. The data structures provided by the table interface are used in the methods. For a complete description of the table interface and the data structures, see the documentation on 'Web Reporting Table Interface'.

16. The implementation of the CAPTION_CELL method (header line) uses the parameters: I_X Column information C_CELL_CONTENT Cell Content To hide the first column the HTML comment tag <!-- is used. This will be added, when the firstcolumn (i_x = 1) is processed during runtime of the query. During processing of the second column (i_x = 2), the comment tag is closed -->. This tag is concatenated with the header cell content.

method CAPTION_CELL . *CALL METHOD SUPER->CAPTION_CELL * EXPORTING * I_X = * I_Y = * I_IS_EMPTY = * I_IOBJNM_ROW = * I_ATTRINM_ROW = * I_TEXT_ROW = * I_IOBJNM_COLUMN = * I_ATTRINM_COLUMN = * I_TEXT_COLUMN = * I_IS_REPETITION = * I_COLSPAN = * I_ROWSPAN = * CHANGING * C_CELL_ID = * C_CELL_CONTENT = * C_CELL_STYLE = * C_CELL_TD_EXTEND = * . * First column if i_x = 1. * add comment tag move '<!-- ' to C_CELL_CONTENT. endif. * Second column if i_x = 2. * close comment tag concatenate '--> ' C_CELL_CONTENT into C_CELL_CONTENT. endif. endmethod.

2002 SAP AMERICA, INC. AND SAP AG

HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE

17. The code described in point 16 is also added to method CHARACTERISTIC_CELL. In addition the DOC ITEM number is memorized in the first column.
* save document-item number move I_CHAVL_EXT to l_docitem.

In column 2 the DOC ITEM number is added to the cell content. * close comment tag concatenate '--> ' C_CELL_CONTENT '/' l_docitem into C_CELL_CONTENT separated by space.

method CHARACTERISTIC_CELL . *CALL METHOD SUPER->CHARACTERISTIC_CELL * EXPORTING * I_X = * I_Y = * I_IOBJNM = * I_AXIS = * I_CHAVL_EXT = * I_CHAVL = * I_NODE_IOBJNM = * I_TEXT = * I_HRY_ACTIVE = * I_DRILLSTATE = * I_DISPLAY_LEVEL = * I_USE_TEXT = * I_IS_SUM = * I_IS_REPETITION = ** I_FIRST_CELL = RS_C_FALSE ** I_LAST_CELL = RS_C_FALSE * I_CELLSPAN = * I_CELLSPAN_ORT = * CHANGING * C_CELL_ID = * C_CELL_CONTENT = * C_CELL_STYLE = * C_CELL_TD_EXTEND = * . * First column if i_x = 1. * save document-item number move I_CHAVL_EXT to l_docitem. * add comment tag move '<!-- ' to C_CELL_CONTENT. endif. * Second column if i_x = 2. * close comment tag concatenate '--> ' C_CELL_CONTENT '/' l_docitem into C_CELL_CONTENT separated by space. endif.

endmethod.

2002 SAP AMERICA, INC. AND SAP AG

HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE

3.4

Add Carriage Return


method CAPTION_CELL . *CALL METHOD SUPER->CAPTION_CELL * EXPORTING * I_X = * I_Y = * I_IS_EMPTY = * I_IOBJNM_ROW = * I_ATTRINM_ROW = * I_TEXT_ROW = * I_IOBJNM_COLUMN = * I_ATTRINM_COLUMN = * I_TEXT_COLUMN = * I_IS_REPETITION = * I_COLSPAN = * I_ROWSPAN = * CHANGING * C_CELL_ID = * C_CELL_CONTENT = * C_CELL_STYLE = * C_CELL_TD_EXTEND = * . * First column if i_x = 1. * add comment tag move '<!-- ' to C_CELL_CONTENT. endif. * Second column if i_x = 2. * close comment tag concatenate '--> ' C_CELL_CONTENT into C_CELL_CONTENT. endif. * add </TR><TR> tag if i_x = 4. concatenate C_CELL_CONTENT '</TR><TR>' into C_CELL_CONTENT. endif. endmethod. method CHARACTERISTIC_CELL . *CALL METHOD SUPER->CHARACTERISTIC_CELL * EXPORTING * I_X = * I_Y = * I_IOBJNM = * I_AXIS = * I_CHAVL_EXT = * I_CHAVL = * I_NODE_IOBJNM = * I_TEXT = * I_HRY_ACTIVE = * I_DRILLSTATE =

18. After 3 Columns a HTML </TR> tag will be added. </TR> closes the row. In addtion a <TR> tag is added to open the new row. In this example the CR is at column 4 added, because the the first column is hidden.
* add </TR><TR> tag if i_x = 4. Concatenate C_CELL_CONTENT '</TR><TR>' into C_CELL_CONTENT. endif.

The code is added to method CAPTION_CELL and CHARACTERISTIC_CELL.

2002 SAP AMERICA, INC. AND SAP AG

HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE
* I_DISPLAY_LEVEL * I_USE_TEXT * I_IS_SUM * I_IS_REPETITION ** I_FIRST_CELL ** I_LAST_CELL * I_CELLSPAN * I_CELLSPAN_ORT * CHANGING * C_CELL_ID * C_CELL_CONTENT * C_CELL_STYLE * C_CELL_TD_EXTEND * . = = = = = RS_C_FALSE = RS_C_FALSE = = = = = =

* First column if i_x = 1. * save document-item number move I_CHAVL_EXT to l_docitem. * add comment tag move '<!-- ' to C_CELL_CONTENT. endif. * Second column if i_x = 2. * close comment tag concatenate '--> ' C_CELL_CONTENT '/' l_docitem into C_CELL_CONTENT separated by space. endif. * add </TR><TR> tag if i_x = 4. concatenate C_CELL_CONTENT '</TR><TR>' into C_CELL_CONTENT. endif. endmethod.

2002 SAP AMERICA, INC. AND SAP AG

10

You might also like