Application Development 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: 

Column Width Optimise not working

Pawan_Kesari
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Pawan,

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

Regards,

Darren

former_member1033672
Participant

The problem is you use wrong atribute

try this: gs_layout-CWIDTH_OPT = 'X'.

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!!