Professional Documents
Culture Documents
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.
HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE
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.
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
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.
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).
HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE
3.3
10. Log on to the BW system. Classes are created in transaction SE24 (Class Builder). You can create the class ZHCOLAPP here.
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.
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'.
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.
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.
HOW TO HIDE A COLUMN IN YOUR WEB QUERY WITH THE TABLE INTERFACE
3.4
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.
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.
10