Question:
Gurus,
I have to display a large number of coulms in a report. This is going beyond 2 pages if I print in portrait format. Is there a way I can reduce the edit the width of individual coulmns and wrap the text as we can do in Excel and try to reduce the column width.
Need expert advice and solution.
Thanks
Answer:
do you want to fix the column-width in general or only for printing???
_________________
Administration
www.OpelClubSCENE.de
Answer:
Hi Rello,
My primary concern is for printing, but I would love to learn how it could be done in the report itself.
Thanks
Answer:
Any news on that topic? I would be interested too..
Answer:
There is a useful help 'How to Hide a Column in your Web Query with Table Interface.
Even though you don't want to hide you may be able to adapt the explanation to wrap text.
Text from help below;
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
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 (Document-
Number 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 CR’s (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.
3 The step by step solution
3.1 Query definition
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.
The first columns will be hidden. In
this case it is 0DOC_ITEM.
The result lines are always
suppressed.
Do not flag the option “Hide
Repeated Key Values” in the Query
Properties.
3.2 Publishing a query on the Web
The Query is published on the Web
with the Web Application Designer.
Use the table “Web Item” and use
Drag & Drop to move it with to the
right Template.
Select the DataProvider. (The query
created in point 1.)
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).
Do not Flag “Suppress Repeated
Texts”
Save the Web template
3.3 Creating the class ZHCOLAPP in the BW system
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.
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.
Cross-method attributes/tables are
defined on the tab page 'attributes'.
The attribute name is “I_DCOITEM”
Activate the class
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.
First of all, the method
CAPTION_CELL is implemented.
Position the cursor on the name of
the method and click on 'Redefine'.
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'.
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.
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.
3.4 Add Carriage Return
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.
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 =
* 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.
* add </TR><TR> tag
if i_x = 4.
concatenate C_CELL_CONTENT
'</TR><TR>'
into C_CELL_CONTENT.
endif.
endmethod.