Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Set Column width in CL_SALV_TABLe

Former Member
23,665

Hi,

I am using CL_SALV_TABLE for ALV output.

In my case my ALV column headings are optimized and show only medium text and Short text according to my values.

But I want to see the Long text for all fields.

So Can anyone help me out to set the column width to show the longtext.

Thanks

1 ACCEPTED SOLUTION
Read only

anesh_kumar
Active Participant
0 Likes
10,717

Hi

Pass null value to both medium and short text

than you can see long text for all the fields

see the below code

l_column->set_long_text( 'this is long text' ).

l_column->set_medium_text( ' ' ).

l_column->set_short_text( ' ' ).

Let me know how it goes

Regards

Hi,

I am using CL_SALV_TABLE for ALV output.

In my case my ALV column headings are optimized and show only medium text and Short text according to my values.

But I want to see the Long text for all fields.

So Can anyone help me out to set the column width to show the longtext.

Thanks

5 REPLIES 5
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
10,717

Use the method set_output_length of class cl_salv_column

Read only

anesh_kumar
Active Participant
0 Likes
10,718

Hi

Pass null value to both medium and short text

than you can see long text for all the fields

see the below code

l_column->set_long_text( 'this is long text' ).

l_column->set_medium_text( ' ' ).

l_column->set_short_text( ' ' ).

Let me know how it goes

Regards

Read only

0 Likes
10,717

@Anesht,

It works nice. Its really helpful.

@ALL

Thank you ALL.

Read only

Former Member
0 Likes
10,717


DATA: LO_COL_TAB TYPE REF TO CL_SALV_COLUMNS_TABLE,
      LO_COLUMN TYPE REF TO CL_SALV_COLUMN.

LO_COLUMN  = LO_COL_TAB->GET_COLUMN( 'COLUMN NAME' ).
LO_COLUMN->SET_OUTPUT_LENGTH('15').  " Set Column Width...

Read only

Former Member
0 Likes
10,717

I don't think you really want to do that for every column, since the long column title is 40 characters...better to do for a single column, using col width setting as previously stated.