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: 

ALV - auto width on data_changed

michael_fallenbchel
Active Participant
0 Kudos

Hi experts,

I have an ALV, created with class CL_GUI_ALV_GRID.

In this ALV, I have a few input fields.

Now I want to "auto-resive" the cell width after maintaining data.

For example - I have column material number.

When I enter a material here, next colum "Material text" will be filled (using "Data_changed").

Now this column material text should be auto resized.

How to do that? I have tried to set  cwidth_opt to X for the layout, but it's not working.

Any ideas?

Thanks

Michael

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Michael,

In fieldcat:  --> ls_fieldcat-col_opt = abap_true


and:

call method g_alv->get_frontend_fieldcatalog

       importing

         et_fieldcatalog = fieldcat.

call method g_alv-->set_frontend_fieldcatalog

       exporting

         it_fieldcatalog = fieldcat.

call method g_alv->refresh_table_display

      EXPORTING

        is_stable      = stbl

        i_soft_refresh = space.

I hope you help.

2 REPLIES 2

Former Member
0 Kudos

Hello Michael,

In fieldcat:  --> ls_fieldcat-col_opt = abap_true


and:

call method g_alv->get_frontend_fieldcatalog

       importing

         et_fieldcatalog = fieldcat.

call method g_alv-->set_frontend_fieldcatalog

       exporting

         it_fieldcatalog = fieldcat.

call method g_alv->refresh_table_display

      EXPORTING

        is_stable      = stbl

        i_soft_refresh = space.

I hope you help.

0 Kudos

Hi,

already tested with col_opt = 'X'.

This does not work.

But I found the solution - col_opt must be 'A'...sometimes it could be so easy 😉

Thanks

Michael