Skip to Content
author's profile photo Former Member
Former Member

cl_salv_table - optimise only one column

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2009 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2009 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.