2006 Oct 11 9:20 AM
How to minimise the column width in ALV display.
Thanx in Advance.
Regards,
Johnn.
2006 Oct 11 9:48 AM
Hello John,
It can be done by using the fielcat variable <b>outputlen</b>.
If useful reward.
Vasanth
2006 Oct 11 9:33 AM
Hi Johnn,
set the parameter colwidth_optimize in the layout as 'X'.
or refer standard ALV Programs that starts with BCALV*.
Regards,
Suchi
2006 Oct 11 9:45 AM
I am using this method.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'gt_STRUCT'
IS_VARIANT = GS_LAYOUT
I_SAVE = X_SAVE
I_DEFAULT = LV_DEF
IS_LAYOUT = GS_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = GT_BPSTAB[]
IT_FIELDCATALOG = GT_FIELDCATALOG[]
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
.
where can i set the colwidth_optimize.
2006 Oct 11 9:35 AM
Hi,
In the SLIS_LAYOUT_ALV, there is a property called COLWIDTH_OPTIMIZE.
Set his property as COLWIDTH_OPTIMIZE = 'X'.
Automatically your column width will get reduced.
JLN
2006 Oct 11 9:48 AM
Hello John,
It can be done by using the fielcat variable <b>outputlen</b>.
If useful reward.
Vasanth
2006 Oct 11 9:56 AM
Hello vasanth,
I am going to display nearly 15 columns.
First column should be of length 15.
Second & third column be of lenght 10.
Fourth column should be of length 15.
fifth & sixth column be of length 10.
..........
outputlen has value '00000' in debugging mode.
How to set the length.
please help me.
2006 Oct 11 9:59 AM
Hi Johnn,
U can write like this
fiedcattab-outputlen = '15'.
Hope this wud help u.
Regds,
Seema.
2006 Oct 11 10:10 AM
I cannot assign like this....
gt_fieldcatalog is a table without header line.
i declared it like this
Data : GT_FIELDCATALOG TYPE LVC_T_FCAT.
2006 Oct 11 10:22 AM
Hi john
use like this
DATA: I_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF I_FCAT.
READ TABLE I_FCAT INTO WA_FCAT WITH KEY FIELDNAME = 'NDAYS'.
IF SY-SUBRC EQ 0.
WA_FCAT-REPTEXT_DDIC = 'X'.
WA_FCAT-SELTEXT_S = TEXT-007.
WA_FCAT-SELTEXT_M = TEXT-007.
WA_FCAT-SELTEXT_L = TEXT-007.
WA_FCAT-OUTPUTLEN = 12.
WA_FCAT-JUST = 'L'.
MODIFY I_FCAT FROM WA_FCAT INDEX SY-TABIX.
CLEAR WA_FCAT.
ENDIF.
so change the length here ..
declate fcat like above...it will work
2006 Oct 11 1:04 PM
Hi rk,
i can adjust the width only for column on monday,
How can i do it for other columns with days like tues,thurs, wed....
DATA : WA_FIELDCATALOG LIKE LINE OF GT_FIELDCATALOG.
LOOP AT GT_FIELDCATALOG INTO WA_FIELDCATALOG.
IF SY-SUBRC = 0.
READ TABLE GT_FIELDCATALOG INTO WA_FIELDCATALOG WITH KEY FIELDNAME = 'MONDAY' .
WA_FIELDCATALOG-OUTPUTLEN = 20.
MODIFY GT_FIELDCATALOG FROM WA_FIELDCATALOG INDEX SY-TABIX .
CLEAR WA_FIELDCATALOG.
ENDIF.
2006 Oct 11 1:12 PM
Hi John
You have to Read for every field and fill the catalog.
do same for all the columns you require.
Awards points if useful.
2006 Oct 11 10:22 AM
Hi Johnn,
You can set the parameter CWIDTH_OPT in the structure for layout (LVC_S_LAYO - Passed in the method against IS_LAYOUT under EXPORTING) as 'X' and the column width will get adjusted automatically.
If you want to set the column width for each of the columns you can do so at the time of populating the Field Catalog with the parameter OUTPUTLEN.
Regards,
Manoj