2006 Jul 12 6:54 AM
Hi there,
Is seems like it is not possible to optimize columns selectively with the new OO ALV. Ive tried switching on the optimize flag for selected columns in my table but they still appear in full column width. Any one has any idea?
Also, is it possible to build a multi-line column header?
Thanks,
Audrey
Hi there,
Is seems like it is not possible to optimize columns selectively with the new OO ALV. Ive tried switching on the optimize flag for selected columns in my table but they still appear in full column width. Any one has any idea?
Also, is it possible to build a multi-line column header?
Thanks,
Audrey
2006 Jul 12 6:59 AM
1. Optimize column, I think, depends on two things, either on the length of the data or on the length of the heading of the column. So, probably you have lengthier heading because of which full length of the column is being displayed.
2. It is not possible to have multi line heading for the columns.
Regards,
Ravi
Note : Please mark all the helpful answers
2006 Jul 12 7:01 AM
Hi,
Try this one for optimizing column
DATA LR_COLUMNS TYPE REF TO CL_SALV_COLUMNS_TABLE.
lr_columns = r_salv_table->get_columns( ).
lr_columns->set_optimize(abap_true).
To my knowledge u can't create a multi line column in OOALV.
Thanks,
Anand
2006 Jul 12 7:32 AM
Hi,
Thanks for all the replies.
Anand,
That optimizes the entire table (ie. ALL columns). What I hope to do is to optimize selected columns.
Cheers,
Audrey
2006 Jul 12 8:00 AM
Hi,
For optimizing selected columns.
here i tried it for single column matnr. u can try for all the selected columns.
try this.
DATA LR_COLUMNS TYPE REF TO CL_SALV_COLUMNS_TABLE.
DATA LR_COLUMN TYPE REF TO CL_SALV_COLUMN_TABLE.
LR_COLUMNS = r_salv_table->GET_COLUMNS( ).
LR_COLUMNS->SET_OPTIMIZE( ABAP_FALSE ).
TRY.
LR_COLUMN ?= LR_COLUMNS->GET_COLUMN( 'MATNR' ).
LR_COLUMN->SET_OPTIMIZED(ABAP_TRUE).
CATCH CX_SALV_NOT_FOUND.
CATCH CX_SALV_EXISTING.
CATCH CX_SALV_DATA_ERROR.
ENDTRY.
Thanks,
Anand
2006 Jul 13 1:06 AM
Hi,
I tried your suggestion and it did not work. I found one of the demo program SALV_TEST_TABLE and selective column optimization didnt work there too.
Cheers,
Audrey
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |