‎2010 Apr 14 12:03 PM
Hi,
I'm using cl_gui_alv_tree_simple like i've seen in the program 'BCALV_TREE_SIMPLE_DEMO'
and like in the demo the columns dont apear optimized for the width of it's content.
How can I do this?
edit
in the code we can found this
* optimize column-width
CALL METHOD tree1->column_optimize
EXPORTING
i_start_column = tree1->c_hierarchy_column_name
i_end_column = tree1->c_hierarchy_column_name.but it seems to do nothing...
‎2010 Apr 14 2:03 PM
You need to give the column name of type LVC_FNAME.
CALL METHOD tree1->column_optimize
EXPORTING
I_START_COLUMN = nnnnnnnnnnnnnn
I_END_COLUMN = nnnnnnnnnnnn
I_INCLUDE_HEADING = 'X'
EXCEPTIONS
START_COLUMN_NOT_FOUND = 1
END_COLUMN_NOT_FOUND = 2
others = 3
‎2010 Apr 14 2:18 PM
‎2010 Apr 14 2:50 PM
Forget the above post. you need to make the changes in field catalog..
in field catalog set this property.
ls_fieldcatalog-outputlen = '12'. *12 is the length of that column.
‎2010 Apr 14 3:06 PM
The above post would set the column width to a static width, which, I don't think is what you are looking for.
Try this:
ls_fieldcat-COL_OPT = 'X'
where ls_fieldcat is defined as:
DATA: ls_fieldcat TYPE lvc_s_fcat.
and you are in a loop through your field catalog.
‎2010 Apr 14 3:37 PM
col_opt didtn work...i have no idea why..
so i fixed it hardcoding it with the outputleght field