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 display

Former Member
0 Kudos
95

How to minimise the column width in ALV display.

Thanx in Advance.

Regards,

Johnn.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
65

Hello John,

It can be done by using the fielcat variable <b>outputlen</b>.

If useful reward.

Vasanth

11 REPLIES 11

Former Member
0 Kudos
65

Hi Johnn,

set the parameter colwidth_optimize in the layout as 'X'.

or refer standard ALV Programs that starts with BCALV*.

Regards,

Suchi

0 Kudos
65

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.

Former Member
0 Kudos
65

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

Former Member
0 Kudos
66

Hello John,

It can be done by using the fielcat variable <b>outputlen</b>.

If useful reward.

Vasanth

0 Kudos
65

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.

0 Kudos
65

Hi Johnn,

U can write like this

fiedcattab-outputlen = '15'.

Hope this wud help u.

Regds,

Seema.

0 Kudos
65

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.

0 Kudos
65

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

0 Kudos
65

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.

0 Kudos
65

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.

Former Member
0 Kudos
65

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