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

Column Width Optimise not working

Pawan_Kesari
Active Contributor
0 Likes
5,683

Columnwidth optimise is not working in my case. I know its very simple, just set lvc_s_layo-col_opt = 'X' in layout and pass it to grid in method set_table_for_first_display.

Surprisingly, when I open the layout of grid, it show checkbox 'Optimise Columns' checked and when I press 'ok ' it optimise the columns.

Background:

On module pool screen I have two ALV GRID (cl_gui_alv_grid) displayed by spitting the screen using splitter control (cl_gui_easy_splitter_container) .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,602

Hi Pawan,

Try calling the REFRESH_TABLE_DISPLAY method after initially displaying the ALV. This should get around your issue.

Regards,

Darren

3 REPLIES 3
Read only

Former Member
0 Likes
2,603

Hi Pawan,

Try calling the REFRESH_TABLE_DISPLAY method after initially displaying the ALV. This should get around your issue.

Regards,

Darren

Read only

Former Member
2,602

The problem is you use wrong atribute

try this: gs_layout-CWIDTH_OPT = 'X'.

Read only

2,602

Filip, I mentioned the wrong fieldname here (copied from fieldcat instead of layout), it was actually cwidth_opt.

This particular ALV grid was getting data at runtime based on user interaction. After assigning the data I called method refresh_table_display and data is refreshed on screen, however the column were not optimised.

Before refresh_table_display I called the method set_frontend_layout and this solved the problem.

Thanks for your time!!