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: 

optimizing column width on alv grid

Former Member
0 Kudos

Hello SAP gurus,

I am using method SET_TABLE_FOR_FIRST_DISPLAY for ALV grid display.

Here is a section of the code.

IS_LAYOUT-STYLEFNAME = 'CELLTAB'.

IS_LAYOUT-CWIDTH_OPT = 'X'.

CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

I_STRUCTURE_NAME = 'YSTRUCT'

IS_LAYOUT = IS_LAYOUT

IT_TOOLBAR_EXCLUDING = IT_TOOLBAR

CHANGING

IT_OUTTAB = IT_OUTTAB[]

IT_FIELDCATALOG = IT_FIELDCAT[]

IT_SORT = IT_SORTINFO[].

Although I set the parameter for optimizing column width, when the grid is displayed, it is not optimized.

Through the change layout button ( on the ALV GRID ), when I check the parameter for 'Optimize Columns' on the Display tab, it is checked. I am not sure, inspite of that why the grid is not optimized.

Can anyone help me.

Thank you,

Reeta

1 ACCEPTED SOLUTION

giancarla_aguilar
Participant

In the structure of IT_FIELDCAT, it has field COL_OPT, set it to 'X' for each column to optimize the width

3 REPLIES 3

Former Member
0 Kudos

anybody please ?

kesavadas_thekkillath
Active Contributor
0 Kudos

One possibilty what i see is there must be some default layout in the layout management without column width optimize.

Please check it.

giancarla_aguilar
Participant

In the structure of IT_FIELDCAT, it has field COL_OPT, set it to 'X' for each column to optimize the width