03-19-2010 2:07 AM
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
04-30-2010 11:06 AM
In the structure of IT_FIELDCAT, it has field COL_OPT, set it to 'X' for each column to optimize the width
03-19-2010 10:40 AM
03-19-2010 10:51 AM
One possibilty what i see is there must be some default layout in the layout management without column width optimize.
Please check it.
04-30-2010 11:06 AM
In the structure of IT_FIELDCAT, it has field COL_OPT, set it to 'X' for each column to optimize the width