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

ALV Column size changing

Former Member
0 Likes
1,410

Hi,

How to change column size of ALV report during run time

Regards,

Hi,

How to change column size of ALV report during run time

Regards,

8 REPLIES 8
Read only

kiran_k8
Active Contributor
0 Likes
1,152

Usman,

Give it like

DATA:itlayout TYPE slis_layout_alv.

itlayout-colwidth_optimize = 'X'.

K.Kiran.

Read only

Former Member
0 Likes
1,152

Hi,

try using

CWIDTH_OPT of lvc_c_layo structure.

data :

w_lay TYPE lvc_s_layo.

w_lay-cwidth_opt = 'X'.

CALL METHOD r_alv_grid->set_table_for_first_display

EXPORTING

i_structure_name = 'FS'

is_layout = w_lay

CHANGING

it_outtab = itab

it_fieldcatalog = t_cat

Read only

Former Member
0 Likes
1,152

Hi Nausal

You can change the output field length passed during field catalog table build code.

However you should NOT make colwidth_optimize 'X'.

Pushpraj

Read only

tarangini_katta
Active Contributor
0 Likes
1,152

HI,

data is_layout type slis_alv_layout.

ls_layout-colwidth_optimize = 'X'.

thanks,

Read only

Former Member
0 Likes
1,152

Hi,

check this link which contains sample code,

Hope it helps u...

Read only

Former Member
0 Likes
1,152

hi!

In your program for,

data :

w_layout TYPE lvc_s_layo.

pass X for,

w_layout-cwidth_opt = 'X'.

this will change the size of your table columns

Read only

Former Member
0 Likes
1,152

Hi,

I think, you need to increase or decrease the width of the column.

It cannot be changed dynamically .....

but what we can do is

In your itab, check all the records for that field's length

take the highest size and pass it to the fieldcat.

and see the results.

So, if less width is there then the width of the column is less and if is very wide then the column will be wide

Regards,

Venkatesh

Read only

Former Member
0 Likes
1,152

Solved