05-25-2009 8:54 AM
dear all
I have an issue with the cl_salv_table function
im trying to optimise only one column but the column is not being optimised, using
lv_cols = lv_rep->get_column( columname = 'AS4TEXT' ).
lv_cols->set_optimize( value = 'X' ).
its not being optimized
does anybody know
05-25-2009 9:00 AM
Hi,
Not sure how you have defined lv_cols. Try this code
DATA
: ITAB TYPE TABLE OF T000.
SELECT *
FROM T000
INTO TABLE ITAB.
DATA :
GR_SALV_TABLE TYPE REF TO CL_SALV_TABLE.
CL_SALV_TABLE=>FACTORY( IMPORTING R_SALV_TABLE = GR_SALV_TABLE
CHANGING T_TABLE = ITAB ).
DATA
: LR_COLUMNS TYPE REF TO CL_SALV_COLUMNS_TABLE.
LR_COLUMNS = GR_SALV_TABLE->GET_COLUMNS( ).
DATA
: LR_COLUMN TYPE REF TO CL_SALV_COLUMN_TABLE.
LR_COLUMN ?= LR_COLUMNS->GET_COLUMN( 'MANDT' ).
LR_COLUMN->SET_OPTIMIZED( 'X' ).
GR_SALV_TABLE->DISPLAY( ).
Edited by: Rajvansh Ravi on May 25, 2009 10:06 AM
05-25-2009 9:19 AM
05-25-2009 9:23 AM
Hi,
No. That is just a different syntax.
I think you need to use the method SET_OPTIMIZED(For single column) of class CL_SALV_COLUMN_TABLE.
The method you have used is set_optimize of CL_SALV_COLUMNS_TABLE (For all columns).
Regards
05-25-2009 10:47 AM
05-25-2009 11:19 AM
Hi Sia,
Have a look at this link where there was a discussion about similar issue.
[CL_SALV_TABLE Problem - Optimize single Column |;
I completely forgot about this thread till now.
See the reply given by Naimesh Patel.
The code which i posted previously seems to work as the client field always has 3 characters.
I tried with one other table and the method did not work.
If this ia actually a bug then the only other way is to use either
lr_column->set_output_length( 40 ).
or optimise all the columns
lr_columns->set_optimize( 'X' ).
Regards
05-25-2009 1:28 PM